Ask Your Question
2

how to move robot in gazebo using joints or motors [closed]

asked 2014-10-02 03:10:07 -0600

Robot gravatar image

updated 2014-10-02 03:49:26 -0600

I have one urdf file for an car look robot . I would like to move the robot in the gazebo simulator. the car have 4 links for 4 wheel. 4 joints attached with the 4 wheel link. I also add actuator and transmission in the robot. I would like to know which method will be the best to move the robot. Should I deal with the joints or is there any other way out to do it. I really stuck in here. please help me.....

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by l0g1x
close date 2015-06-25 00:40:04.880816

1 Answer

Sort by ยป oldest newest most voted
4

answered 2014-10-02 09:14:55 -0600

l0g1x gravatar image

updated 2014-10-02 09:16:56 -0600

Here would be the place to look. It is part of the gazebo_ros_pkgs which you can either apt-get the debian, or download the source for github and compile it yourself. Many gazebo plugin's are listed here, and what you are look for (if your drivetrain system is what i think it is) is the SkidSteerDrive plugin which you will find towards the bottom of the page.

<gazebo>
   <plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
   <updateRate>100.0</updateRate>
   <robotNamespace>/</robotNamespace>
   <leftFrontJoint>front_left_wheel_joint</leftFrontJoint>
   <rightFrontJoint>front_right_wheel_joint</rightFrontJoint>
   <leftRearJoint>back_left_wheel_joint</leftRearJoint>
   <rightRearJoint>back_right_wheel_joint</rightRearJoint>
   <wheelSeparation>0.4</wheelSeparation>
   <wheelDiameter>0.215</wheelDiameter>
   <robotBaseFrame>base_link</robotBaseFrame>
   <torque>20</torque>
   <topicName>cmd_vel</topicName>
   <broadcastTF>false</broadcastTF>
 </plugin>
</gazebo>

Just keep in mind, this format is for a URDF formatted file. If you are using SDF, You should just take out the gazebo tags.

edit flag offensive delete link more

Comments

thank you very much for the help. I have developed the robot using the urdf. should I add the above below my urdf file or create another urdf. After this addition how can I control the wheel rotation. Publishing geometry_msgs::Twist on cmd_vel topic will be enough or any thing else.. Thanks again,,

Robot gravatar imageRobot ( 2014-10-02 09:35:34 -0600 )edit

All you need to do is send the cmd_vel msg, and the plugin listen's to that cmd_vel topic and takes care of moving the robots joints for you, as long as you set up your joints correctly. It will also output a Odom topic if you are interested in it.

l0g1x gravatar imagel0g1x ( 2014-10-02 10:30:20 -0600 )edit

thanks.. I will add the above at the bottom of my urdf file.. and publish Twist msg on cmd_vel topic. nothing else right???

Robot gravatar imageRobot ( 2014-10-02 11:08:42 -0600 )edit

no. Just try it out and see if anything is missing, if it is then let me know

l0g1x gravatar imagel0g1x ( 2014-10-02 11:24:27 -0600 )edit

okay I will and let u know.. thanks again...

Robot gravatar imageRobot ( 2014-10-02 11:49:31 -0600 )edit
1

Hey it worked perfectly.. thanks again

Robot gravatar imageRobot ( 2014-10-06 17:20:06 -0600 )edit

Awesome sounds good!

l0g1x gravatar imagel0g1x ( 2014-10-10 08:55:29 -0600 )edit

May I ask a stupid question ? How to send the cmd_vel msg, and the plugin listen's to that cmd_vel topic ?

Ken-Dung gravatar imageKen-Dung ( 2015-06-14 09:08:27 -0600 )edit

Question Tools

Stats

Asked: 2014-10-02 03:10:07 -0600

Seen: 1,863 times

Last updated: Oct 02 '14