This repository provides a simulation of the mobile dual-manipulator robot Freddy in the Gazebo Harmonic simulator. The simulation offers independent control of the Robile base, left Kinova arm, and right Kinova arm components of the robot.
freddy-sim-demo.mp4
- Position, velocity, and effort control for each of the two driven wheels of each Kelo drive of the Robile base
- Position and velocity trajectory control, and effort joint control, for each Kinova arm
- Selectable controllers for the Robile base and Kinova arms using launch arguments
The simulation requires
ros2_control
andros2_controllers
. Install these packages using the following command:sudo apt install ros-${ROS_DISTRO}-ros2-control ros-${ROS_DISTRO}-ros2-controllersIf you are using ROS2 Humble, install Gazebo Harmonic using the following command. Note that Gazebo Harmonic and ROS2 Humble is a 'non-default Gazebo/ROS2 pairing'.
sudo apt-get install ros-humble-ros-gzharmonicCreate the simulation workspace
mkdir freddy_ws cd freddy_ws && mkdir src cd src git clone https://github.com/a2s-institute/freddy-gazebo-simulation.gitThe package's dependencies can be installed with the following command:
vcs import < freddy-gazebo-simulation/dep.repos
Build the workspace
cd .. && colcon build source install/setup.bashWhen building the workspace, ensure that the environment variable
GZ_VERSION
is set toharmonic
. This can be done with the following command:export GZ_VERSION=harmonic
The simulation can be launched using the following command:
ros2 launch freddy_gazebo freddy_gazebo.launch.py
By default, the base_controller
for controlling the Robile base is a velocity controller and the arm_controller
for controlling the Kinova arms is a trajectory_controller
. You can customize the base_controller and arm_controller by providing launch arguments, for example:
ros2 launch freddy_gazebo freddy_gazebo.launch.py arm_controller:=joint_trajectory base_controller:=position
Valid values for arm_controller
are joint_trajectory
and effort
. Valid values for base_controller
are position
, velocity
, and effort
. The joint_trajectory
controller can accept position as well as velocity commands.
For purposes of demonstration, commands can be given to each joint of each component of the robot through keyboard input. The executable for commanding the robot's joints can be launched using the following command:
ros2 run freddy_gazebo freddy_gazebo
The behaviour of this executable can be changed to match the controllers used when launching freddy_gazebo.launch.py
. This can be done by providing arm_controller
and base_controller
arguments as follows:
ros2 run freddy_gazebo freddy_gazebo --ros-args -p arm_controller:=joint_trajectory_velocity -p base_controller:=velocity
Valid values for arm_controller
are joint_trajectory_position
, joint_trajectory_velocity
, and effort
. Valid values for base_controller
are position
, velocity
, and effort
. When using a joint_trajectory_velocity
command scheme, joint positions are additionally rolled out (or integrated) using the commanded velocity.
The robot can be controlled using the keyboard as follows:
Increment state using w e r t y u i o
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
Joint 1 2 3 4 5 6 7 8
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Decrement state using s d f g h j k l
Increment state increment step using +
↑
↓
Decrement state decrement step using -
Choose robot component to command using
q : arm_left
a : arm_right
z : base
The default controllers are loaded automatically, and additional controllers can be loaded using ROS arguments as mentioned above. Alternatively, you can use rqt_controller_manager to switch controllers without restarting the simulation. To switch controllers, first unload the current controller through the UI, then load the desired one, please follow these steps to make sure the correct hardware interfaces are "claimed" and commands run smoothly.
To download rqt_controller_manager, use the following command:
apt install ros-humble-rqt-controller-manager
To run the controller_manager UI, use the following command:
ros2 run rqt_controller_manager rqt_controller_manager --force-discover
In the UI, if controller_manager is not already selected, choose it from the dropdown menu.
To unload a controller, right-click on the desired controller and select "De-activate and Unload".
To load the desired controller, right-click on it and select 'Load, Configure and activate'.
The package has the following environment requirements and dependencies:
- ROS2 Humble
- Gazebo Harmonic (tested on Gazebo Sim version 8.3.0 and 8.6.0)
- Python (tested on Python >=3.10)
ros2_control
framwork for real-time control of robots using ROS2gz_ros2_control
package for integrating theros2_control
controller architecture with the Gazebo simulatorfreddy_description
package for the Freddy description filesros2_kortex
package for the Kinowa Gen3 7DoF arm description
Note that the Robotiq gripper has not been integrated or tested for the simulation.