Turtlebot3 and diff_drive_controller
Hi, I'm learning ROS and I need to control a turtebot3 in a gazebo simulation launched with roslaunch turtlebot3gazebo turtlebot3world.launch. The problem is I need to do that using the diff_drive package, any help or any tutorial?
Asked by mattewthep on 2020-03-23 13:53:21 UTC
Comments
Hi mattewthep,
The turtlebot, as any robot in Gazebo, needs to be described with URDF, generally speaking, using Xacro. In the launch file this line is loading the Robot description in the ROS parameter server and this one is lauching a script to spawn the robot in a Gazebo world.
If you look at any of the Xacro files you will see that they are already loading a Diff drive plugin to control the robot base.This plugin is reading from the
/cmd_vel
topic to command twist msgs.Asked by Weasfas on 2020-03-24 07:54:34 UTC
Thank you, but in order to control the two turtlebot wheels separately is it possible to send the message to /cmd_vel, catched by driff_drive_controller that split it into two messages for the two wheels and then let the turtlebot node subscribe to these two topic and hence receive the messagese for both the wheels but separately?
Asked by mattewthep on 2020-03-24 11:18:25 UTC
Hi @mattewthep,
Why you would want to do that?
The plugin itself is already implementing the diff drive kinematics, thus when you publish a twist on the topic the plugin will apply the kinematic equations to split the command between the two robot wheels. If you want to have two control topics, one for each wheel you may need to implement your own controllers since in the
driff_drive_controller
the command is used for both wheels at the same time programatically.Asked by Weasfas on 2020-03-24 13:01:49 UTC