-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use parameterized frames #1729
Closed
ymd-stella
wants to merge
1
commit into
ros-navigation:master
from
ymd-stella:feat/use-parameterized-frame
Closed
Use parameterized frames #1729
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -45,6 +45,13 @@ RecoveryServer::RecoveryServer() | |
declare_parameter( | ||
"plugin_types", | ||
rclcpp::ParameterValue(plugin_types)); | ||
|
||
declare_parameter( | ||
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. Please add these to our nav2_params.yaml file (and the 2 multi-robot param example files) and verify changing them works properly. |
||
"odom_frame", | ||
rclcpp::ParameterValue("odom")); | ||
declare_parameter( | ||
"robot_base_frame", | ||
rclcpp::ParameterValue("base_link")); | ||
} | ||
|
||
|
||
|
@@ -71,8 +78,12 @@ RecoveryServer::on_configure(const rclcpp_lifecycle::State & /*state*/) | |
shared_from_this(), costmap_topic); | ||
footprint_sub_ = std::make_unique<nav2_costmap_2d::FootprintSubscriber>( | ||
shared_from_this(), footprint_topic, 1.0); | ||
|
||
std::string odom_frame, robot_base_frame; | ||
this->get_parameter("odom_frame", odom_frame); | ||
this->get_parameter("robot_base_frame", robot_base_frame); | ||
collision_checker_ = std::make_shared<nav2_costmap_2d::CollisionChecker>( | ||
*costmap_sub_, *footprint_sub_, *tf_, this->get_name(), "odom"); | ||
*costmap_sub_, *footprint_sub_, *tf_, this->get_name(), odom_frame, robot_base_frame); | ||
|
||
this->get_parameter("plugin_names", plugin_names_); | ||
this->get_parameter("plugin_types", plugin_types_); | ||
|
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.
How are you planning on getting these parameters?
It seems like these would better be input ports for the BT node (see this for example https://github.com/ros-planning/navigation2/blob/71f9a62d0f8dcb0267935d6c6068138b5afad3d5/nav2_behavior_tree/plugins/action/spin_action.cpp#L49) with a default value to map and base_link. Then if you wanted to change, you change the frames in the BT XML file.
I think this could work as well, but you'd need to figure out what namespace this parameter appears in to add to your config file, which actually sounds like the best situation. Figure out where this parameterization is going to be and then add it to our nav2_params.yaml file.
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.
I'm not familiar with nav2_behavior_tree so it's going to take a bit of time.
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.
So I'd recommend just looking at this
spin_dist
as a literal example. All you need to do is add a string templatedBT::InputPort
to the provide input ports function. The order of args is variable name, default value, description string. Then in the constructor of the node usegetInput
to get the input of the 2 variables to store. Then you're done!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.
@ymd-stella you can also use this as a direct guide: #1741 as @naiveHobo did this for the other controller based on your request.