Skip to content

Gazebo plugins for controlling the joints

Jennifer Buehler edited this page Jun 9, 2016 · 7 revisions

There are currently two options to control the joints of the example Kinova Jaco arm:

  1. Using the controllers of package gazebo_joint_control. This is described on this wiki page.
  2. Using gazebo_ros_control hardware interfaces, described on this wiki.

There are some limitations for using ros_control (option 2) at the moment. If you would like to learn more about the limited support of ros_control and would like to try it out, please refer to the ROS control wiki.

See also the documentation on gazebo_joint_control for more details about the controllers used in option (1).

Please also check out the tutorial for Jaco in Gazebo which guides you through using the example setup jaco_on_table with Gazebo and joint controllers.

Adjusting parameters

The joint controller will use PID controllers for which you can specify the PID values in a yaml configuration file. An example for the jaco robot is provided in config/JacoControlLocalImpl.yaml:

rosed jaco_gazebo JacoControlLocalImpl.yaml

This YAML file will be loaded onto the parameter server by the example launch file jaco_on_table_gazebo_controlled.launch.

When loading velocity controllers, other PID values are used than when using position controllers. You can adjust values for both position and velocity controllers in the YAML file.

The jaco_on_table_gazebo_controlled.launch file can also be used as a template to load your own robot with the Jaco arm. In this launch file you can also change the configuration YAML file to be loaded:

rosed jaco_on_table jaco_on_table_gazebo_controlled.launch

Joint trajectory execution

The package joint_trajectory_execution offers a ROS action server which provides joint trajectory execution of a control_msgs/FollowJointTrajectoryAction.

The Jaco tutorial files use this implementation to execute joint trajectories. Use this launch file to start up the Jaco on the table along with the trajectory action server:

roslaunch jaco_on_table jaco_on_table_gazebo_controlled.launch

You can now reach the action server on the topic /jaco/joint_trajectory_action/. You may either send your own JointTrajectory, or use RViz to generate one, as described in the jaco MoveIt! tutorial.

Important
While you use trajectory execution, you cannot use the argument load_joint_state_publisher:=true. Because if you do, you will have two "competing" controllers: one that tries to set the positions to the angles as set in the GUI, the other which tries to execute a trajectory.

Note
Trajectory execution will not work if load_ros_controllers:=true, because the default gazebo ROS controller can load only either position or velocity controllers.

Adjusting trajectory execution parameters

The following .yaml file is loaded onto the ROS parameter server by the launch file jaco_on_table_gazebo_controlled.launch.

rosed jaco_gazebo JointTrajectoryParams.yaml

You may use this file as template, or adjust values directly. More about the paramterers can be found on the joint_trajectory_execution wiki

This example launch file provides the option to enable or disable velocity controllers:

rosed jaco_on_table jaco_on_table_gazebo_controlled.launch

Referenced wiki pages