-
Notifications
You must be signed in to change notification settings - Fork 640
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
feat(elevation_map_loader): reduce memory usage of elevation_map_loader #2571
feat(elevation_map_loader): reduce memory usage of elevation_map_loader #2571
Conversation
Signed-off-by: Shin-kyoto <[email protected]>
Signed-off-by: Shin-kyoto <[email protected]>
Codecov ReportBase: 11.39% // Head: 10.54% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2571 +/- ##
==========================================
- Coverage 11.39% 10.54% -0.86%
==========================================
Files 1279 1267 -12
Lines 89170 87680 -1490
Branches 23587 20938 -2649
==========================================
- Hits 10161 9242 -919
- Misses 68239 68573 +334
+ Partials 10770 9865 -905
*This pull request uses carry forward flags. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
void createElevationMapFromPointcloud( | ||
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void createElevationMapFromPointcloud( | |
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader_); | |
void createElevationMapFromPointcloud( | |
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader); |
pcl::shared_ptr<grid_map::GridMapPclLoader> grid_map_pcl_loader_ = | ||
pcl::make_shared<grid_map::GridMapPclLoader>(grid_map_logger); | ||
grid_map_pcl_loader_->loadParameters(this->param_file_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcl::shared_ptr<grid_map::GridMapPclLoader> grid_map_pcl_loader_ = | |
pcl::make_shared<grid_map::GridMapPclLoader>(grid_map_logger); | |
grid_map_pcl_loader_->loadParameters(this->param_file_path); | |
pcl::shared_ptr<grid_map::GridMapPclLoader> grid_map_pcl_loader = | |
pcl::make_shared<grid_map::GridMapPclLoader>(grid_map_logger); | |
grid_map_pcl_loader->loadParameters(param_file_path_); |
@@ -187,15 +189,16 @@ void ElevationMapLoaderNode::createElevationMap() | |||
} else { | |||
grid_map_pcl_loader_->setInputCloud(data_manager_.map_pcl_ptr_); | |||
} | |||
createElevationMapFromPointcloud(); | |||
createElevationMapFromPointcloud(grid_map_pcl_loader_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createElevationMapFromPointcloud(grid_map_pcl_loader_); | |
createElevationMapFromPointcloud(grid_map_pcl_loader); |
@@ -187,15 +189,16 @@ void ElevationMapLoaderNode::createElevationMap() | |||
} else { | |||
grid_map_pcl_loader_->setInputCloud(data_manager_.map_pcl_ptr_); | |||
} | |||
createElevationMapFromPointcloud(); | |||
createElevationMapFromPointcloud(grid_map_pcl_loader_); | |||
elevation_map_ = grid_map_pcl_loader_->getGridMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elevation_map_ = grid_map_pcl_loader_->getGridMap(); | |
elevation_map_ = grid_map_pcl_loader->getGridMap(); |
void ElevationMapLoaderNode::createElevationMapFromPointcloud( | ||
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void ElevationMapLoaderNode::createElevationMapFromPointcloud( | |
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader_) | |
void ElevationMapLoaderNode::createElevationMapFromPointcloud( | |
const pcl::shared_ptr<grid_map::GridMapPclLoader> & grid_map_pcl_loader) |
@@ -97,7 +98,7 @@ class ElevationMapLoaderNode : public rclcpp::Node | |||
bool use_inpaint_; | |||
float inpaint_radius_; | |||
bool use_elevation_map_cloud_publisher_; | |||
pcl::shared_ptr<grid_map::GridMapPclLoader> grid_map_pcl_loader_; | |||
std::string param_file_path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string param_file_path; | |
std::string param_file_path_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or not making a member, using this->declare_parameter("param_file_path", "path_default");
in createElevationMap()
may be good
@@ -50,7 +50,7 @@ ElevationMapLoaderNode::ElevationMapLoaderNode(const rclcpp::NodeOptions & optio | |||
: Node("elevation_map_loader", options) | |||
{ | |||
layer_name_ = this->declare_parameter("map_layer_name", std::string("elevation")); | |||
std::string param_file_path = this->declare_parameter("param_file_path", "path_default"); | |||
this->param_file_path = this->declare_parameter("param_file_path", "path_default"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this->param_file_path = this->declare_parameter("param_file_path", "path_default"); | |
param_file_path_ = this->declare_parameter("param_file_path", "path_default"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to align with other variables.
Signed-off-by: Shin-kyoto <[email protected]>
@kosuke55 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks very much, I did not test but the code looks good.
|
…er (autowarefoundation#2571) * feat: reduce memory usage of elevation_map_loader Signed-off-by: Shin-kyoto <[email protected]> * chore: remove unnecessary comment Signed-off-by: Shin-kyoto <[email protected]> * fix: modify variables' name Signed-off-by: Shin-kyoto <[email protected]> Signed-off-by: Shin-kyoto <[email protected]>
…er (autowarefoundation#2571) * feat: reduce memory usage of elevation_map_loader Signed-off-by: Shin-kyoto <[email protected]> * chore: remove unnecessary comment Signed-off-by: Shin-kyoto <[email protected]> * fix: modify variables' name Signed-off-by: Shin-kyoto <[email protected]> Signed-off-by: Shin-kyoto <[email protected]>
…arefoundation#2571, autowarefoundation#2885, #943) (#337) * feat(elevation_map_loader): reduce memory usage of elevation_map_loader (autowarefoundation#2571) * feat: reduce memory usage of elevation_map_loader Signed-off-by: Shin-kyoto <[email protected]> * chore: remove unnecessary comment Signed-off-by: Shin-kyoto <[email protected]> * fix: modify variables' name Signed-off-by: Shin-kyoto <[email protected]> Signed-off-by: Shin-kyoto <[email protected]> * feat(elevation_map_loader): use polygon iterator to speed up (autowarefoundation#2885) * use grid_map::PolygonIterator instead of grid_map::GridMapIterator Signed-off-by: Shunsuke Miura <[email protected]> * formatting Signed-off-by: Shunsuke Miura <[email protected]> * use use_lane_filter option Signed-off-by: Shunsuke Miura <[email protected]> * delete unused use-lane-filter option Signed-off-by: Shunsuke Miura <[email protected]> * change use_lane_filter to True, clarify the scope Signed-off-by: Shunsuke Miura <[email protected]> * change to use grid_map_utils::PolygonIterator Signed-off-by: Shunsuke Miura <[email protected]> * Add lane margin parameter Signed-off-by: Shunsuke Miura <[email protected]> * use boost geometry buffer to expand lanes Signed-off-by: Shunsuke Miura <[email protected]> * Change use_lane_filter param default to false Signed-off-by: Shunsuke Miura <[email protected]> * update README Signed-off-by: Shunsuke Miura <[email protected]> --------- Signed-off-by: Shunsuke Miura <[email protected]> * perf(behavior_velocity_planner): add faster PolygonIterator (#943) * Add grid_map_utils pkg with faster implementation of PolygonIterator Signed-off-by: Maxime CLEMENT <[email protected]> * suppress error --------- Signed-off-by: Shin-kyoto <[email protected]> Signed-off-by: Shunsuke Miura <[email protected]> Signed-off-by: Maxime CLEMENT <[email protected]> Co-authored-by: Shintaro Tomie <[email protected]> Co-authored-by: Shunsuke Miura <[email protected]> Co-authored-by: Maxime CLEMENT <[email protected]>
…er (autowarefoundation#2571) * feat: reduce memory usage of elevation_map_loader Signed-off-by: Shin-kyoto <[email protected]> * chore: remove unnecessary comment Signed-off-by: Shin-kyoto <[email protected]> * fix: modify variables' name Signed-off-by: Shin-kyoto <[email protected]> Signed-off-by: Shin-kyoto <[email protected]>
Description
When you use large pointcloud map, elevation_map_loader use so much amount of memory and keep it after making elevation_map. So in this PR, remove unused object from member of
ElevationMapLoaderNode
.Before PR, 10GB memory is allocated after generating elevation_map. (Elevation_map is generated in the memory peak with 13+αGB.)
After PR, 1+αGB memory is allocated after generating elevation_map. (Elevation_map is generated in the memory peak with 12GB.)
Related links
JIRA link: TIERIV INTERNAL LINK
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.