How to set wheel joint velocity?

Hi! I built my differential robot with urdf and I want to control it through cpp. My goal is to set velocity of each wheel joint of the two wheel joints 'manually'. in the github there are the files. Effort file can move the robot only straight. S how can I control the joint wheel velocity

https://github.com/luberdis/gazebo.git

Originally posted by niki on Gazebo Answers with karma: 1 on 2018-11-07

Post score: 0

Comment by nkoenig on 2018-11-07:
Can you describe what you have tried? Have you also checked that your robot model has good collision and inertia values? And, I highly recommend following these tutorials to get started building a robot in Gazebo: http://gazebosim.org/tutorials?cat=build_robot

The tutorial on Setting Velocity on Joints and Links has a good overview of some of the options you have using C++.

Originally posted by chapulina with karma: 7504 on 2018-11-07

This answer was NOT ACCEPTED on the original site

Post score: 3

I would like to complete in what @chapulina said with a hands on example. I created a two wheel robot and a plugin that implements two of the three methods explained.

Depending on what you want you can use the PID control or the simple one. PID are of course more realistic and perform much better in that sense, but you have the issues related to PIDs, specially gazebo getting really crazy if the values exceed what its physically possible.

If you just want something that moves, then you can use the NON PID option, which is directly moving the joints.

Also remember that if you only want to move a two wheeled robot, you always have the Differential Drive Option. But I understand that explaining how this is done opens the door to move any number of joints.

I created this super simple two wheeled robot:

I created a ModelPlugin, here you have the cpp code:

set_speed_joint_plugin.cpp

Here you have the model sdf using that plugin:

model.sdf

And here the world that we use:

simple.world

Here I leave you also the GIT with all the code:

The ROSJECT with the whole project ready to use

And a VIDEO explaining a bit more in detail each element of the plugin.

Hope it helped.

Originally posted by Duckfrost with karma: 209 on 2018-11-07

This answer was NOT ACCEPTED on the original site

Post score: 2