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

Turtlebot3 keeps rotating in Gazebo

asked 2020-12-16 07:08:06 -0500

updated 2020-12-16 07:16:40 -0500

I have spawned a turlebot3 in Gazebo environment using roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch. I have written a node that just keeps publishing an angular velocity to /cmd_vel. As soon as I start the node, the bot starts rotating in the Gazebo environment. However, when I exit the node from the terminal (by pressing Ctrl + C), the bot keeps rotating in the Gazebo environment. Why is this happening?

I even checked the following in the terminal - rostopic echo /cmd_vel. It didn't return anything. How is then the bot rotating?

Sometimes, I am facing the opposite thing i.e. I am publishing to /cmd_vel but the bot isn't rotating in the Gazebo world.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-16 11:45:16 -0500

tryan gravatar image

However, when I exit the node from the terminal (by pressing Ctrl + C), the bot keeps rotating in the Gazebo environment. Why is this happening?

I even checked the following in the terminal - rostopic echo /cmd_vel. It didn't return anything. How is then the bot rotating?

That happens because the Gazebo controller plugin (gazebo_ros_diff_drive) only updates the velocities when a new message is published on the cmd_vel topic. Unless you tell it to do something different, e.g., a zero velocities message on node shutdown, the robot will just continue to follow the last command.


I am publishing to /cmd_vel but the bot isn't rotating in the Gazebo world.

That one is unexpected and requires troubleshooting. Are there any errors/warnings? What does rosrun rqt_graph rqt_graph show when that happens?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-12-16 07:08:06 -0500

Seen: 503 times

Last updated: Dec 16 '20