ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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.