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

ROS2 navigation robot to stop 2 meters ahead of the target pose

asked 2023-07-27 01:55:03 -0500

mirakim gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-27 15:30:33 -0500

billy gravatar image

updated 2023-07-27 16:00:33 -0500

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-07-27 01:55:03 -0500

Seen: 199 times

Last updated: Jul 27 '23