Skip to content

Report resource usage #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 75 additions & 26 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,99 @@
# Description

Thank you for opening a PR. Please summarize the changes in 1 or 2 sentences.
Thank you for opening a PR! Please summarize the changes in 12 sentences.

## Type of change

Delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Breaking change (fix or feature that causes existing functionality to not work as expected)
- [ ] Other (please describe):

## Detailed Summary

Provide the motivation, context, and links to any related issues, PRs, or documentation:

- Motivation: Why is this change necessary?
- Context: How does it fit into wavemap's functionality?
- Related issues/PRs: Fixes # (issue) / Links to other PRs

## API Changes

List any changes to wavemap's APIs to help users update their code. Write "None" if there are no changes.

### C++ API:

*

### Python API:

*

## Detailed summary
### ROS1 Interface:

Please describe the motivation, context and a link to related issues (if appropriate). List any dependencies that are required for this change.
*

Feel free to summarize the changes as a list of bullet points.
## Review Notes

Fixes # (issue)
Is there anything specific the reviewers should focus on, or are there unresolved questions? Mention them here.

# Testing

If possible, verify that the changes produce the desired results by extending the unit tests. If you would like us to help you with this, feel free to open the pull request already and let us know.
### Automated Tests

If manual tests were performed to verify these changes, please describe them here and provide instructions to reproduce them. Please also list any relevant details for your test configuration below.
Have you added or modified unit tests to verify these changes? If not, let us know if you'd like assistance.

If the changes are performance related, this is a good place to list the metrics that were used and the improvements that have been achieved.
### Manual Tests

**System information (please complete if relevant):**
- CPU: [e.g. Intel i9-9900K]
- GPU: [e.g. Nvidia RTX 2080Ti] # Only for visualization-related issues
- RAM: [e.g. 32GB]
- OS: [e.g. Ubuntu 20.04]
- Installation: [e.g., Native (ROS with catkin); or Docker]
If manual tests were performed to verify these changes, describe them here and include instructions to reproduce them.
Describe test configurations where applicable.

**Runtime information (please complete if relevant):**
- Launch file: [e.g. Link to the launch file you used]
- Config file: [e.g. Link to the config file you used]
- Dataset name [e.g. Newer College Cloister sequence] # For public datasets
- Custom setup: # For online use or personal datasets
- Depth sensor: [e.g. Livox MID360 LiDAR]
- Pose source: [e.g. Odometry from FastLIO2]
**System information (optional):**

# Checklist:
- CPU: [e.g., Intel i9-9900K]
- GPU: [e.g., Nvidia RTX 2080Ti]
- RAM: [e.g., 32GB]
- OS: [e.g., Ubuntu 20.04]
- API: [e.g., C++, Python, ROS1]
- Installation: [e.g., pre-built Docker, local CMake, Pip, catkin]

**Runtime information (optional):**

- Launch file: [e.g., Link or GitHub Gist]
- Config file: [e.g., Link or GitHub Gist]
- Dataset name (if public): [e.g., Newer College Cloister]
- Custom setup (for private datasets, or live usage):
- Depth sensor: [e.g., Livox MID360 LiDAR]
- Pose source: [e.g., Odometry from FastLIO2]

For performance or accuracy-related changes, include the above system and runtime information and describe:

- **Performance (optional)**
- Measured operation: [e.g. serializing the map, performing 1M queries, processing dataset X]
- Metrics [e.g., CPU time, wall time, total RAM usage]
- **Accuracy (optional)**
- Metrics: [e.g., AUC, accuracy, recall]
- **Summary of changes**
- What metrics improved and by how much?
- Did any metrics worsen?

### Benchmarks (To be completed by maintainers)

We will rerun wavemap's benchmarks and report the results here to validate there are no general performance/accuracy regressions.

# Checklist

General

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added or updated tests as required
- [ ] Any required changes in dependencies have been committed and pushed

Documentation (where applicable)

- [ ] I have updated the installation instructions (in docs/pages/installation)
- [ ] I have updated the code's inline API documentation (e.g., docstrings)
- [ ] I have updated the parameter documentation (in docs/pages/parameters)
- [ ] I have updated/extended the tutorials (in docs/pages/tutorials)
3 changes: 3 additions & 0 deletions examples/cpp/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap_examples_cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(wavemap_examples_cpp VERSION 2.1.1 LANGUAGES CXX)
project(wavemap_examples_cpp VERSION 2.1.2 LANGUAGES CXX)

# Load the wavemap library
# First, try to load it from sources
Expand Down
3 changes: 3 additions & 0 deletions examples/python/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap_examples_python
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------

Expand Down
3 changes: 3 additions & 0 deletions examples/ros1/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap_examples_ros1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------
* Address warnings from new cpplint version (v2.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/ros1/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap_examples_ros1</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>Usages examples for wavemap's ROS1 interface.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions interfaces/ros1/wavemap/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------

Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>Base library for wavemap.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions interfaces/ros1/wavemap_all/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap_all
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------

Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap_all/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap_all</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>Metapackage that builds all wavemap packages.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
3 changes: 3 additions & 0 deletions interfaces/ros1/wavemap_msgs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package wavemap_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------

2.1.1 (2024-10-24)
------------------

Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap_msgs</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>Message definitions for wavemap's ROS interfaces.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
6 changes: 6 additions & 0 deletions interfaces/ros1/wavemap_ros/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog for package wavemap_ros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------
* Report CPU, wall time and RAM usage when rosbag_processor completes
* Adjust wavemap config schemas to resolve false positive validation warnings caused by CLion bug IJPL-63581
* Contributors: Victor Reijgwart

2.1.1 (2024-10-24)
------------------
* Address warnings from new cpplint version (v2.0)
Expand Down
15 changes: 14 additions & 1 deletion interfaces/ros1/wavemap_ros/app/rosbag_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <glog/logging.h>
#include <rosgraph_msgs/Clock.h>
#include <tf/tfMessage.h>
#include <wavemap/core/utils/profile/resource_monitor.h>
#include <wavemap_ros_conversions/config_conversions.h>

#include "wavemap_ros/inputs/depth_image_topic_input.h"
Expand Down Expand Up @@ -75,13 +76,25 @@ int main(int argc, char** argv) {
rosbag_processor.enableSimulatedClock(nh);
}

// Start measuring resource usage
ResourceMonitor resource_monitor;
resource_monitor.start();

// Process the rosbag
if (!rosbag_processor.processAll()) {
return -1;
}

wavemap_server.getMap()->prune();
// Finish processing the map
wavemap_server.getPipeline().runOperations(/*force_run_all*/ true);
wavemap_server.getMap()->prune();

// Report the resource usage
resource_monitor.stop();
LOG(INFO) << "Processing complete.\nResource usage:\n"
<< resource_monitor.getLastEpisodeResourceUsageStats()
<< "\n* Map size: "
<< wavemap_server.getMap()->getMemoryUsage() / 1024 << " kB\n";

if (nh_private.param("keep_alive", false)) {
ros::spin();
Expand Down
2 changes: 0 additions & 2 deletions interfaces/ros1/wavemap_ros/config/wavemap_ouster_os0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,3 @@ inputs:
undistort_motion: true
topic_queue_length: 10
max_wait_for_pose: { seconds: 1.0 }
# reprojected_pointcloud_topic_name: "/wavemap/reprojected_pointcloud"
# projected_range_image_topic_name: "/wavemap/projected_range_image"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <unordered_set>

#include <wavemap/core/indexing/index_hashes.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>
#include <wavemap_msgs/Map.h>
#include <wavemap_ros_conversions/map_msg_conversions.h>

Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap_ros/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap_ros</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>ROS interface for wavemap.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <wavemap/core/integrator/projective/projective_integrator.h>
#include <wavemap/core/utils/iterate/grid_iterator.h>
#include <wavemap/core/utils/print/eigen.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>

namespace wavemap {
DECLARE_CONFIG_MEMBERS(DepthImageTopicInputConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <sensor_msgs/point_cloud_conversion.h>
#include <wavemap/core/data_structure/image.h>
#include <wavemap/core/integrator/projective/projective_integrator.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>
#include <wavemap_ros_conversions/time_conversions.h>

namespace wavemap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <utility>

#include <std_srvs/Empty.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>
#include <wavemap_msgs/Map.h>
#include <wavemap_ros_conversions/map_msg_conversions.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <wavemap/core/map/hashed_chunked_wavelet_octree.h>
#include <wavemap/core/map/hashed_wavelet_octree.h>
#include <wavemap/core/utils/iterate/grid_iterator.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>
#include <wavemap_ros_conversions/geometry_msg_conversions.h>

namespace wavemap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>
#include <wavemap/core/utils/undistortion/pointcloud_undistortion.h>
#include <wavemap_ros_conversions/time_conversions.h>

Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap_ros/src/utils/rosbag_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>

namespace wavemap {
RosbagProcessor::~RosbagProcessor() {
Expand Down
5 changes: 5 additions & 0 deletions interfaces/ros1/wavemap_ros_conversions/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package wavemap_ros_conversions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------
* Update include path for profiler_interface.h
* Contributors: Victor Reijgwart

2.1.1 (2024-10-24)
------------------
* Address warnings from new cpplint version (v2.0)
Expand Down
2 changes: 1 addition & 1 deletion interfaces/ros1/wavemap_ros_conversions/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<package format="2">
<name>wavemap_ros_conversions</name>
<version>2.1.1</version>
<version>2.1.2</version>
<description>Conversions between wavemap and ROS types.</description>

<maintainer email="[email protected]">Victor Reijgwart</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <unordered_set>

#include <ros/console.h>
#include <wavemap/core/utils/profiler_interface.h>
#include <wavemap/core/utils/profile/profiler_interface.h>

namespace wavemap::convert {
bool mapToRosMsg(const MapBase& map, const std::string& frame_id,
Expand Down
5 changes: 5 additions & 0 deletions interfaces/ros1/wavemap_rviz_plugin/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package wavemap_rviz_plugin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.2 (2024-11-20)
------------------
* Report CPU, wall time and RAM usage when rosbag_processor completes
* Contributors: Victor Reijgwart

2.1.1 (2024-10-24)
------------------
* Address warnings from new cpplint version (v2.0)
Expand Down
Loading