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

rotate only in place

asked 2022-08-25 05:17:13 -0500

amit_z gravatar image

Hello, I am using move_base DWA_planner and NavfnROS global planner, and I that the rotations will be performed only in place, i.e the cmd_vel will either have a linear component or an angular component, but not both. How can I achieve this?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2022-08-25 08:38:53 -0500

ljaniec gravatar image

It would be something similar to the carrot_planner mentioned there in the subsection 2.1.1.

2 Global Planner

2.1 Global Planner Selection

To use the move base node in navigation stack, we need to have a global planner and a local planner. There are three global planners that adhere to nav core::BaseGlobal Planner interface: carrot planner, navfn and global planner.

2.1.1 carrot planner

This is the simplest one. It checks if the given goal is an obstacle, and if so it picks an alternative goal close to the original one, by moving back along the vector between the robot and the goal point. Eventually it passes this valid goal as a plan to the local planner or controller (internally). Therefore, this planner does not do any global path planning. It is helpful if you require your robot to move close to the given goal even if the goal is unreachable. In complicated indoor environments, this planner is not very practical.

You would have to modify the code of carrot_runner(ROS Wiki page: http://wiki.ros.org/carrot_planner) to use something similar to the Shim Controller from Nav2 in ROS2 already mentioned here in the other answer. Your robot would go as close as possible to the goal point (carrot_runner), then it should rotate adequately to the next goal position, so it would move in the straight path.

edit flag offensive delete link more
0

answered 2022-08-25 07:25:46 -0500

johnjamesmiller gravatar image

I know Nav2 has a rotation shim that will rotate before starting to drive. That will get you partway there. From your question I am guessing you are using ros1? Unsure if old nav stack has rotation shim.

I am no expert on dwa critics but increasing the weight on straight lines critic to be much higher than everything else and disabling any smoothers might get you there.

Writing your own critic or controller or expanding the shim concept would probably also be good approachs.

If your looking for something quick and dirty you could probably put a node in that listens to cmd_velocity and enforces your requirement by zeroing either angular or linear velocity and then point your motor driving node at your new “filtered_cmd_velocity” topic. Interesting strategies could be zeroing the lesser or alternating based on some duration. Fair warning this will bypass some collision checking. Depending on how tight things are, how quickly your controller loops, how fast your moving, ect this could or could not be an issue!

Good luck! Excited to see what direction you go.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-25 05:17:13 -0500

Seen: 160 times

Last updated: Aug 25 '22