This package contains files to simulate the Kinova Gen3 and Gen3 lite robots in Gazebo.
The source code is released under a BSD 3-Clause license.
Author: Kinova inc.
Affiliation: Kinova inc.
Maintainer: Kinova inc. [email protected]
This package has been tested under ROS Kinetic, Gazebo 7 and Ubuntu 16.04 and under ROS Melodic, Gazebo 9 and Ubuntu 18.04.
The arms's controllers are simulated with the gazebo_ros_control
package, which provides PID effort controllers for every joint. It is not an exact simulation of the real arms's behaviour. The simulated arms are stable in most of their workspace, although we have seen the Gen3 be a bit less stable in a very low inertia position (vertical). The gains are set in .yaml files in the kortex_control
package, so they can be modified by end users.
Other disclaimers :
- The simulation has not been tested with simulated payload.
- No characterization was done to compare and quantify the performance of the simulated controllers and the real arm's controllers. The simulation only offers a visually comparable experience to the real arms.
- Very rarely, the base (fixed to the world frame) seems to lose its fixation and the arm goes unstable. We are currently looking for the root cause of this behavior, but we found that clicking Edit ---> Reset Model Poses (Shift + Ctrl + R) in Gazebo is a workaround.
The spawn_kortex_robot.launch file launches the arm simulation in Gazebo, with ros_control controllers and MoveIt!. The launch can be parametrized with arguments :
Arguments:
- start_gazebo : If this argument is false, Gazebo will not be launched within this launched file. It is useful if you already launched Gazebo yourself and just want to spawn the robot. The default value is true (Gazebo will be started).
- gazebo_gui : If this argument is false, only the Gazebo Server will be launched. The default value is true.
- start_rviz : If this argument is true, RViz will be launched. The default value is true.
- x0 : The default X-axis position of the robot in Gazebo. The default value is 0.0.
- y0 : The default Y-axis position of the robot in Gazebo. The default value is 0.0.
- z0 : The default Z-axis position of the robot in Gazebo. The default value is 0.0.
- arm : Name of your robot arm model. See the
kortex_description/arms
folder to see the available robot models. The default value is gen3. - gripper : Name of your robot arm's tool / gripper. See the
kortex_description/grippers
folder to see the available end effector models (or to add your own). The default value is "". For Gen3, you can also put robotiq_2f_85. For Gen3 lite, you need to put gen3_lite_2f. - robot_name : This is the namespace of the arm that is going to be spawned. It defaults to my_$(arg arm) (so my_gen3 for arm="gen3").
- use_trajectory_controller : If this argument is false, one
JointPositionController
per joint will be launched and the arm will offer a basic ROS Control interface to control every joint individually with topics. If this argument is true, a MoveIt! node will be started for the arm and the arm will offer aFollowJointTrajectory
interface to control the arm (via aJointTrajectoryController
). The default value is true. - use_sim_time : If this value is true, Gazebo will use simulated time instead of system clock. The default value is true.
- debug : If this value is true, Gazebo will be launched in debug mode. This option is useful for debugging Gazebo-related issues that won't show in the terminal. The default value is false.
- paused : If this value is true, Gazebo will be started paused. The default value is $(arg use_trajectory_controller) because, when MoveIt! is enabled, Gazebo needs to be started paused to let the controllers initialize.
To launch it with default arguments, run the following command in a terminal :
roslaunch kortex_gazebo spawn_kortex_robot.launch
To launch it with optional arguments, specify the argument name, then ":=", then the value you want. For example, :
roslaunch kortex_gazebo spawn_kortex_robot.launch start_rviz:=false x0:=1.0 y0:=2.55 use_trajectory_controller:=false
You can also have a look at the roslaunch documentation for more details.
Gazebo loads an empty world an first, then the spawn_model
node from the gazebo_ros package is used to load the robot_description
(taken from the Parameter Server) and spawn the robot in the simulator.
The simulated arm is controlled with a effort_controllers/JointTrajectoryController
from ros_controllers.
This controller offers a FollowJointTrajectory interface to control the simulated arm, which is configured with MoveIt! so the trajectories outputed by the move_group
node are sent to the robot in Gazebo and executed.
The RViz Motion Planning plugin offers simple motion planning support for the simulated robot. See the kortex_move_it_config documentation for more details.
There are also individual JointPositionController's for every joint, stopped by default. These are used by the kortex_arm_driver node to do velocity control.
See the kortex_driver package documentation for more details on how to use the simulated arm.
The package also uses a Python script to home the robot after the robot has been spawned. Gazebo is launched with paused physics. Otherwise, the arm would fall to the ground because the controllers are not fully loaded when the robot is spawned in the simulator. When everything is well loaded, the script unpauses Gazebo's physics and executes the robot's Home action.
To properly simulate the grippers in Gazebo, we use two Gazebo Plugins.
Gazebo doesn't offer support for the URDF mimic tag. By loading one instance of this plugin per mimic joint, we are able to simulate those joints properly. The plugin parameters are specified with the transmission elements for the Robotiq gripper and the transmission elements for the Gen3 lite gripper.
Gazebo doesn't support grasping very well. By loading this plugin, we make sure objects grasped by the gripper will not fall. The plugin parameters are specified in with the transmission elements for the Robotiq gripper and the transmission elements for the Gen3 lite gripper.
Two different Python scripts were added to this package: Push Objects and Grab Objects.
- Push Objects : The executable push_test spawns a selected number of objects from YCB objects and, one by one, pushes them away trought the X axis, in a specified order, and then despawns them.
- Grab Objects : The executable grab_test spawns a selected number of objects from YCB objects and takes advantage on the capabilities of the gripper (if present) in order to lift the objects up, one by one, then brings them down again and finally releases and despawns them.
Both executables utilize an object data file in orther to spawn and despawn the objects in suitable positions predifined for the tests. The objects to use in each test must be specified as arguments by their number identifier composed by 3 numerical digits, for example:
rosrun kortex_gazebo grab_test.py 006 035 003 005