-
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
Goal frame_id is not respected consistently #3894
Comments
But consider either consider the I think the idea of trying to navigate relative to the I won't say that we can't be better about navigating in handling alternative reference frames, but I think the particular issue you're running into is due to using an invalid frame for navigation. It seems very strange to think of moving in the frame of the base link circa When measuring the difference in positions between There are alot of technical reasons why what you're trying to do is -- perhaps not wrong -- but probably a bad idea regardless of if we magically updated the stack to do what you propose. Costmap, TF buffer sizes, and other technical concerns remain which would all be resolved even just by using the odometry frame which is especially designed for exactly this kind of purpose - see REP 105. |
They may not completely "ignore" it, in the sense that the
I don't see how If a goal expressed in any other frame than the preconfigured ones is passed in an action request is considered an invalid use case, then I think the action servers must check that early on and return an error immediately. Otherwise, if the
I was not aware that the global frame is something that is meant to be configurable at run-time? What is the added value of having it as an input port of behavior tree nodes? Is there any existing node that updates that at run-time, for example after a new goal was accepted, or is this just a way to passthrough a ROS parameter to a behavior node? I think that is exactly the issue I tried to describe: The fact that the
Yes, I agree that navigating in a frame that moves with the robot may in general not be a good idea. In my case it was just for testing different planner and controller parameters in a completely empty map in simulation, and I simply did not care about where exactly the start pose and target pose is, only their relative pose. So I wanted to send a goal request relative to the robot pose without having to lookup that pose using tf first. Another, more common scenario that does not work right now, maybe without users being aware of the issue, is sending goals with rviz or Foxglove Studio while any other frame than
TF buffer sizes would not be an issue if the goal (or sequence of waypoints) was transformed only once at the time it is accepted by the action server, which was my expectation initially before I took a closer look at the documentation and implementation details. If not, and the goal's original frame is kept as-is while the action is running, then any frame_id other than the pre-configured one, external or not, may result in either undefined behavior if the goal's frame is simply ignored, or tf lookup failures if not and the timestamp of the goal becomes too old. Also the But simply ignoring the goal frame_id and treating a goal with header frame
Thanks, I think I am well aware of the ROS frame conventions and REP-105, and the tf design in general. I have not found a specific reference, but my assumption until now was that any consumer of ROS message with a header is responsible for checking that and to transform the data to "its own reference frame", if needed, and not make any assumption of which frame is chosen by the publisher or requester? In case of actions that may run for an extended period of time, the only question is then whether that is supposed to happen only once initially, or continuously while the goal is active, especially if the header stamp of the request is zero which typically means "the latest available". But okay, let's ignore the maybe unusual case of sending goals in a frame somehow attached to the robot. Unless I missed something plain obvious, also sending goals in the odometry frame ( In contrast, the I fixed this particular one by replacing Note: I found a related ROS answers post from >10 years ago: https://answers.ros.org/question/34684/header-frame_id/ |
Note that lets try not to have these responses turn into walls of text or we're going to need to split out the discussion into one issue at a time. I think is worth starting at the
Can you enumerate these BT nodes or behaviors so I can look at them? I just need the names and I'll look into them.
Sure, transforming the goal's pose into the global frame would be acceptable here, but the planner server takes care of that for us so once the goal is sent to the planner server, its transformed from whatever frame its in to the planner's global frame. Its really just the logging that's a bit off. I think adding the reference frames to the info log would meet the need, no? Except for the request above for BT nodes / behaviors that aren't working as expected. Let me look into those once you give me a list.
Keep in mind that's a 'my first robot demo' tool. That's not supposed to be a fully featured system with complete flexibility. But absolutely, adding generic any-frame requests would be unquestionably nice and a PR to add that would be accepted and merged.
Some behaviors you're interesting in having performed might be desirable in either the local or global frames (e.g. map or odom or other). So the BT nodes are units that can be used generically in many situations, but by default
I think Dimitri was just trying to prove a point to a new user with that response on the basics of TF and frames. But, like I said, I think it should technically be possible to use |
Hi, any update? I think this is something we can address better, but some help would be great as our maintenance time is limited 😄. Helping get some of the leg work done can let us get this done faster on your behalf by having a starting point to getting the more complex code changes made |
…r frames than the pre-configured global_frame (map) Addresses ros-navigation#3894, at least partially.
I submitted a pull request (#3917) that solves the issue for us, but unfortunately I could not reproduce the same problem with the Turtlebot navigation example from the Getting Started guide. I also found that the The patch proposed in #3917 also solves the issue from the description, because the goal pose is transformed early in |
Lets discuss in the PR, but...
Another reason to shake my fist at the removal of |
…l_frame (#3917) * nav2_behavior_tree/nav2_bt_navigator: enable goals to be sent in other frames than the pre-configured global_frame (map) Addresses #3894, at least partially. * Address review comments (#3917 (review)) * Address more review comments (#3917 (review)) * Make uncrustify happy using cuddle braces for single line if statements... * Fix removed global_frame input for the GoalReached node in the unit test
Merged! |
…l_frame (ros-navigation#3917) * nav2_behavior_tree/nav2_bt_navigator: enable goals to be sent in other frames than the pre-configured global_frame (map) Addresses ros-navigation#3894, at least partially. * Address review comments (ros-navigation#3917 (review)) * Address more review comments (ros-navigation#3917 (review)) * Make uncrustify happy using cuddle braces for single line if statements... * Fix removed global_frame input for the GoalReached node in the unit test
…l_frame (ros-navigation#3917) * nav2_behavior_tree/nav2_bt_navigator: enable goals to be sent in other frames than the pre-configured global_frame (map) Addresses ros-navigation#3894, at least partially. * Address review comments (ros-navigation#3917 (review)) * Address more review comments (ros-navigation#3917 (review)) * Make uncrustify happy using cuddle braces for single line if statements... * Fix removed global_frame input for the GoalReached node in the unit test Signed-off-by: gg <[email protected]>
…l_frame (ros-navigation#3917) * nav2_behavior_tree/nav2_bt_navigator: enable goals to be sent in other frames than the pre-configured global_frame (map) Addresses ros-navigation#3894, at least partially. * Address review comments (ros-navigation#3917 (review)) * Address more review comments (ros-navigation#3917 (review)) * Make uncrustify happy using cuddle braces for single line if statements... * Fix removed global_frame input for the GoalReached node in the unit test Signed-off-by: enricosutera <[email protected]>
…l_frame (ros-navigation#3917) * nav2_behavior_tree/nav2_bt_navigator: enable goals to be sent in other frames than the pre-configured global_frame (map) Addresses ros-navigation#3894, at least partially. * Address review comments (ros-navigation#3917 (review)) * Address more review comments (ros-navigation#3917 (review)) * Make uncrustify happy using cuddle braces for single line if statements... * Fix removed global_frame input for the GoalReached node in the unit test
Bug report
Required Info:
Steps to reproduce issue
navigate_to_pose
action:Expected behavior
The robot navigates to a point 10 meters ahead of the current pose, then the action succeeds. With the patch from #2222 (for #2186), which addressed the issue for the
planner_server
, I would have expected that it is possible to send goals in any frame, includingbase_link
or whatever the robot's base frame is. But apparently the goal's header frame_id is still ignored in various other places, for example inNavigateToPoseNavigator::initializeGoalPose()
andGoalReachedCondition::isGoalReached()
.Like the original reporter of #2186, I would expect the header frame_id to be respected in each consumer of the current goal if it is represented as
geometry_msgs/msg/PoseStamped
, independent of whether it has been already transformed to the global navigation frame before or not. Otherwise, if theframe_id
is expected to match the global frame by design and the header stamp also does not play a role, then the goal could have been represented by ageometry_msgs/msg/Pose
message only internally and all action requests.In this specific case of my example, where a goal is provided with respect to the robot frame with a zero header stamp (or any other frame local to the robot) then each attempt to transform it to the global fixed frame would return a pose relative to the latest available position, which cannot be reached by definition. So it would make sense to transform the goal only once in
NavigateToPoseNavigator::initializeGoalPose()
. But in other cases, where the goal is provided in any world-fixed frame other than the configured global frame for navigation, it may be desirable to transform the goal repeatedly using the latest available information from localization (e.g.odom
or any earth-fixed frame when navigating using a global reference like GNSS), almost like the goal would have been updated each time the relevent tf transforms were updated. What would be the expected and/or preferred behavior here for submitting a pull request?Actual behavior
Output (immediately after the goal was accepted):
Navigation stack output:
[bt_navigator-5] [INFO] [1698000807.702693163] [bt_navigator]: Begin navigating from current location (10.29, -0.00) to (10.00, 0.00) [controller_server-1] [INFO] [1698000807.705938492] [controller_server]: Received a goal, begin computing control effort. [controller_server-1] [INFO] [1698000807.708074050] [controller_server]: Reached the goal! [bt_navigator-5] [INFO] [1698000807.742920182] [bt_navigator]: Goal succeeded
The robot does not start to move and the action succeeds immediately. Likely because the start pose in the global map frame is already close to the goal's position coordinates, and therefore the controller's goal checker is happy early on and reports success.
Additional information
I am using the behavior tree
navigate_w_replanning_only_if_path_becomes_invalid.xml
and thenav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController
with thenav2_controller::SimpleGoalChecker
.The text was updated successfully, but these errors were encountered: