-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix flickering visualization #4561
Merged
SteveMacenski
merged 9 commits into
ros-navigation:main
from
logivations:logivations/fix_flickering_visualization
Aug 2, 2024
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
87e8cc9
Fix Flickering visualization
VladyslavHrynchak200204 45dbb67
Refactoring Costmap2DPublisher and Costmap2DROS
VladyslavHrynchak200204 f911fe4
Refactoring costmap_2d_ros.cpp
VladyslavHrynchak200204 f1b1bfe
Refactoring Costmap2DPublisher and Costmap2DROS
VladyslavHrynchak200204 96e6537
Merge branch 'main' into logivations/fix_flickering_visualization
VladyslavHrynchak200204 3bf69bf
Update costmap_2d_publisher.cpp
VladyslavHrynchak200204 35a6cbd
Change map_vis_z from float to double
VladyslavHrynchak200204 29fafb5
Add comment to map_vis_z_ parameter
VladyslavHrynchak200204 c43c1fc
Merge branch 'ros-navigation:main' into logivations/fix_flickering_vi…
VladyslavHrynchak200204 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,8 @@ class Costmap2DPublisher | |
Costmap2D * costmap, | ||
std::string global_frame, | ||
std::string topic_name, | ||
bool always_send_full_costmap = false); | ||
bool always_send_full_costmap = false, | ||
float map_vis_z = 0.0); | ||
|
||
/** | ||
* @brief Destructor | ||
|
@@ -166,6 +167,7 @@ class Costmap2DPublisher | |
double saved_origin_y_; | ||
bool active_; | ||
bool always_send_full_costmap_; | ||
float map_vis_z_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double |
||
|
||
// Publisher for translated costmap values as msg::OccupancyGrid used in visualization | ||
rclcpp_lifecycle::LifecyclePublisher<nav_msgs::msg::OccupancyGrid>::SharedPtr costmap_pub_; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,6 +404,7 @@ class Costmap2DROS : public nav2_util::LifecycleNode | |
bool track_unknown_space_{false}; | ||
double transform_tolerance_{0}; ///< The timeout before transform errors | ||
double initial_transform_timeout_{0}; ///< The timeout before activation of the node errors | ||
float map_vis_z_{0}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double |
||
|
||
bool is_lifecycle_follower_{true}; ///< whether is a child-LifecycleNode or an independent node | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,12 +54,14 @@ Costmap2DPublisher::Costmap2DPublisher( | |
Costmap2D * costmap, | ||
std::string global_frame, | ||
std::string topic_name, | ||
bool always_send_full_costmap) | ||
bool always_send_full_costmap, | ||
float map_vis_z) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double |
||
: costmap_(costmap), | ||
global_frame_(global_frame), | ||
topic_name_(topic_name), | ||
active_(false), | ||
always_send_full_costmap_(always_send_full_costmap) | ||
always_send_full_costmap_(always_send_full_costmap), | ||
map_vis_z_(map_vis_z) | ||
{ | ||
auto node = parent.lock(); | ||
clock_ = node->get_clock(); | ||
|
@@ -146,7 +148,7 @@ void Costmap2DPublisher::prepareGrid() | |
costmap_->mapToWorld(0, 0, wx, wy); | ||
grid_->info.origin.position.x = wx - grid_resolution_ / 2; | ||
grid_->info.origin.position.y = wy - grid_resolution_ / 2; | ||
grid_->info.origin.position.z = 0.0; | ||
grid_->info.origin.position.z = map_vis_z_; | ||
grid_->info.origin.orientation.w = 1.0; | ||
|
||
grid_->data.resize(grid_->info.width * grid_->info.height); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
double