ROS2 navigation robot to stop 2 meters ahead of the target pose
Hello,
I am a newbie to this robot field.
I am now making an environment where the robot is navigating to the target human.
I want the robot to stop 2 meters in front of the target human, to avoid the collision of robot and target human.
I googled my issue and it suggest to set xy_tolerance to 2 in simple goal checker but it does not make the robot stop in front of 2 meters.
Is there any way to solve this issue? thanks in advance!
Asked by mirakim on 2023-07-27 01:55:03 UTC
Answers
You could write a custom node that calcuates the distance from robot to target and stop navigation when you're within whatever distance you want. You can use this node to get current position of robot. https://github.com/MilanMichael/robot_pose_publisher_ros2
and you already know the target so it's a bit of algebra and a message to navigation to stop and doing that is detailed here. https://navigation.ros.org/commander_api/index.html
.
There is also behavior tree implementation may be better suited for you if the person is moving. https://navigation.ros.org/behavior_trees/trees/follow_point.html
Giving this a second thought, probably better to determine the goal position you actually want and provide that to NAV2 instead of giving it a goal you don't actually want to reach.
Asked by billy on 2023-07-27 15:30:33 UTC
Comments