Running your robot with Gazebo
Before starting
.world
file as well as a folder containing meshes and description of the objects to be spawned). If you need further information, see here.Make your package Gazebo-compatible
<transmission>
. Each of these elements must contain at least:<joint name= >
: which corresponds to the name of a defined joint in your urdf file that you want Gazebo to be able to actuate.<type>transmission_interface/SimpleTransmission</type>
: which specifies the type of transmission. More information here.<hardwareInterface>
that should be present in both <joint> and <actuator> tags. It makes the gazebo_ros_control plugin aware of which hardware interface to load (position, velocity or effort interfaces).
The last step is to add the gazebo_ros_control plugin to the URDF file. The plugin should look like this: .. code-block:: xml
- <gazebo>
- <plugin name=”gazebo_ros_control” filename=”libgazebo_ros_control.so”>
<!– Optional - Default being the value of robot name in the urdf/sdf file–> <robotNamespace>my_name_space</robotNamespace> <!– Optional - The period of the controller update (in seconds), default is Gazebo’s period –> <controlPeriod>my_value</controlPeriod> <!– Optional - The location of the robot_description (URDF) on the parameter server, default being ‘/robot_description’ –> <robotParam>my_param_value</robotParam> <!– Optional - The pluginlib name of a custom robot sim interface to be used (see below for more details), default being ‘gazebo_ros_control/DefaultRobotHWSim’ –> <robotSimType>my_value</robotSimType>
</plugin>
</gazebo>
You can find examples of URDF files containing these modifications here, here and here.
Set the simulation parameters
Start GRIP:
roslaunch grip_api start_framework.launch
Leave
simulation
tickedSpecify the Gazebo world file
Specify the associated folder containing all the models to be spawned
If you want your robot to start in a specific joint states, you can define it in the
Starting pose
edit line (optional). The input must respect this formatting:-J <joint_name1> <value> -J <joint_name2> <value>
, as shown in the following image.
Now, if you follow this tutorial, you should be able to run your robot in simulation with Gazebo.