Skip to content

Commit

Permalink
Remove Gazebo Classic support and Update for MoveIt Jazzy/Rolling (#228)
Browse files Browse the repository at this point in the history
* Remove Gazebo Classic support

* Move the repos

* Add to not released repos list as well

* Fix the Robotiq params

* Fix request adapters in ompl_planning.yaml

* Fix the 6DOF too

* Actually fix the configs now

* Switch fake to mock

* Remove one more unnecessary dependency

* Add gz_ros2_control to rolling repos

* Other renames

* Fix .repos files

* Skip the gz_ros2_control rosdep key in Humble CI

* More fixes to get CI working

* Use main branch of ros2_robotiq_gripper and fix gazebo paths

* Additional needed modifications

* Final Modifications

* Formatting Modifications

---------

Co-authored-by: Abed Al Rahman Al Mrad <aalmrad@kinova.ca>
  • Loading branch information
sea-bass and aalmrad authored Jan 13, 2025
1 parent 97a0e7c commit c2b4ce2
Show file tree
Hide file tree
Showing 35 changed files with 153 additions and 289 deletions.
1 change: 1 addition & 0 deletions .github/workflows/humble-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- {ROS_DISTRO: humble, ROS_REPO: testing}
env:
UPSTREAM_WORKSPACE: ros2_kortex-not-released.${{ matrix.env.ROS_DISTRO }}.repos
ROSDEP_SKIP_KEYS: gz_ros2_control
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ If the bug fix you need isn't in a released version or If you want to build this
vcs import src --skip-existing --input src/ros2_kortex/ros2_kortex-not-released.$ROS_DISTRO.repos
```

If you plan on simulating the robot with ignition or gazebo, make sure to pull the additional simulation packages. If you're on ROS2 Humble, run
If you plan on simulating the robot with Gazebo, make sure to pull the additional simulation packages.
If you're on ROS 2 Humble, run
```
vcs import src --skip-existing --input src/ros2_kortex/simulation.humble.repos
vcs import src --skip-existing --input src/ros2_kortex/simulation.jazzy.repos
```

otherwise
Expand All @@ -125,12 +126,10 @@ If the bug fix you need isn't in a released version or If you want to build this

If you plan on using MoveIt, you must make sure that you have it already [installed](https://moveit.ros.org/install-moveit2/binary/) either from binaries or by building it from source.

If you plan on simulating the Gen3 7Dof robot mounted on the Husky mobile robot from clearpath, make sure to pull the additional related packages. On ROS2 Humble, run
```
vcs import src --skip-existing --input src/ros2_kortex/clearpath.repos
```

4. Install dependencies, compile, and source the workspace:
4. Follow the instructions to install [Gazebo Harmonic](https://gazebosim.org/docs/harmonic/getstarted/)

5. Install dependencies, compile, and source the workspace:
```
rosdep install --ignore-src --from-paths src -y -r
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Expand All @@ -140,7 +139,7 @@ If the bug fix you need isn't in a released version or If you want to build this
```
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --parallel-workers 3
```
5. Source the previously built workspace using the following command:
6. Source the previously built workspace using the following command:
```
echo 'source ~/workspace/ros2_kortex_ws/install/setup.bash' >> ~/.bashrc
```
Expand Down Expand Up @@ -215,7 +214,7 @@ You can specify the following arguments if you wish to change your arm configura

* `robot_type`: Your robot model. Default value (and only one) is `gen3`.

* `gripper` : Gripper to use. Possible values for the Gen3 are either `robotiq_2f_85`, `robotiq_2f_140` or `""`. Default is `robotiq_2f_85`. An empty string will not initialise any gripper.
* `gripper` : Gripper to use. Possible values for the Gen3 are either `robotiq_2f_85`, `robotiq_2f_140` or `""`. Default is `""`. An empty string will not initialise any gripper.

* `gripper_joint_name` : Name of the controlled joint of the gripper attached to the arm. Default value is `robotiq_85_left_knuckle_joint`.

Expand Down Expand Up @@ -308,11 +307,11 @@ The `kortex_sim_control.launch.py` launch file is designed to simulate all of ou
```bash
ros2 launch kortex_bringup kortex_sim_control.launch.py \
use_sim_time:=true \
launch_rviz:=false
launch_rviz:=false \
robot_controller:=joint_trajectory_controller
```

* `sim_ignition` : Use Ignition for simulation. Default value is `true`.
* `sim_gazebo` : Use Gazebo Classic for simulation. Default value is `false`.
* `sim_gazebo` : Use Gazebo for simulation. Default value is `false`.
* `robot_type` : Your robot model. Possible values are either `gen3` or `gen3_lite`.Default is `gen3`.
* `robot_name` : Name you would like your robot to have. Default value is `gen3`.
* `dof` : Degrees of freedom of the arm. Possible values are either `6` or `7`.Default value is `7`.
Expand All @@ -325,9 +324,9 @@ ros2 launch kortex_bringup kortex_sim_control.launch.py \
* `description_file` : URDF/XACRO description file with the robot. Default value is `kinova.urdf.xacro`.
* `prefix` : Prefix of the joint names, useful for multi-robot setup. If changed, then also joint names in the controllers' configuration have to be updated. Default value is `""` (none).
* `use_sim_time` : Use simulated clock. Default value is `true`.
* `gripper` : Gripper to use. Possible values for the Gen3 are either `robotiq_2f_85`, `robotiq_2f_140` or `""`. Default is `robotiq_2f_85`. An empty string will not initialise any gripper.
* `gripper` : Gripper to use. Possible values for the Gen3 are: `robotiq_2f_85`, `robotiq_2f_140`, `""` and `gen3_lite_2f`. Default is `robotiq_2f_85`. An empty string will not initialise any gripper.

#### MoveIt2
#### MoveIt 2

To generate motion plans and execute them with a simulated 7 DoF Kinova Gen3 arm with mock hardware:

Expand All @@ -345,7 +344,7 @@ ros2 launch kinova_gen3_6dof_robotiq_2f_85_moveit_config robot.launch.py \
use_fake_hardware:=true
```

To generate motion plans and execute them with an ignition simulated 7 DoF Kinova Gen3 arm (previously launched with the command at the [simulation](#simulation) section):
To generate motion plans and execute them with a Gazebo simulated 7 DoF Kinova Gen3 arm (previously launched with the command at the [simulation](#simulation) section):

```bash
ros2 launch kinova_gen3_7dof_robotiq_2f_85_moveit_config sim.launch.py \
Expand Down
2 changes: 1 addition & 1 deletion kortex_bringup/launch/gen3_lite.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"robot_controller",
default_value="gen3_lite_joint_trajectory_controller",
default_value="joint_trajectory_controller",
description="Robot controller to start.",
)
)
Expand Down
90 changes: 28 additions & 62 deletions kortex_bringup/launch/kortex_sim_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
#
# Author: Marq Rasmussen

import os
from ament_index_python.packages import get_package_prefix
from launch import LaunchDescription
from launch.actions import (
AppendEnvironmentVariable,
DeclareLaunchArgument,
ExecuteProcess,
IncludeLaunchDescription,
OpaqueFunction,
RegisterEventHandler,
Expand All @@ -38,7 +40,6 @@
def launch_setup(context, *args, **kwargs):
# Initialize Arguments
sim_gazebo = LaunchConfiguration("sim_gazebo")
sim_ignition = LaunchConfiguration("sim_ignition")
robot_type = LaunchConfiguration("robot_type")
dof = LaunchConfiguration("dof")
vision = LaunchConfiguration("vision")
Expand Down Expand Up @@ -97,9 +98,6 @@ def launch_setup(context, *args, **kwargs):
"sim_gazebo:=",
sim_gazebo,
" ",
"sim_ignition:=",
sim_ignition,
" ",
"simulation_controllers:=",
robot_controllers,
" ",
Expand Down Expand Up @@ -171,7 +169,7 @@ def launch_setup(context, *args, **kwargs):
condition=UnlessCondition(is_gen3_lite),
)

robot_hand_controller_spawner = Node(
robot_hand_lite_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_lite_hand_controller, "-c", "/controller_manager"],
Expand All @@ -182,42 +180,16 @@ def launch_setup(context, *args, **kwargs):
bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
arguments=["/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock"],
output="screen",
)

# Gazebo nodes
gzserver = ExecuteProcess(
cmd=["gzserver", "-s", "libgazebo_ros_init.so", "-s", "libgazebo_ros_factory.so", ""],
arguments=["/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock"],
output="screen",
condition=IfCondition(sim_gazebo),
)

# Gazebo client
gzclient = ExecuteProcess(
cmd=["gzclient"],
output="screen",
condition=IfCondition(sim_gazebo),
)

# gazebo = IncludeLaunchDescription(
# PythonLaunchDescriptionSource(
# [PathJoinSubstitution([FindPackageShare("gazebo_ros"), "launch", "gazebo.launch.py"])]
# ),
# launch_arguments={"verbose": "false"}.items(),
# )

# Spawn robot
gazebo_spawn_robot = Node(
package="gazebo_ros",
executable="spawn_entity.py",
name="spawn_robot",
arguments=["-entity", robot_name, "-topic", "robot_description"],
output="screen",
condition=IfCondition(sim_gazebo),
robotiq_description_prefix = get_package_prefix("robotiq_description")
gz_robotiq_env_var_resource_path = AppendEnvironmentVariable(
"GZ_SIM_RESOURCE_PATH", os.path.join(robotiq_description_prefix, "share")
)

ignition_spawn_entity = Node(
gz_spawn_entity = Node(
package="ros_gz_sim",
executable="create",
output="screen",
Expand All @@ -241,15 +213,17 @@ def launch_setup(context, *args, **kwargs):
"-Y",
"0.0",
],
condition=IfCondition(sim_ignition),
condition=IfCondition(sim_gazebo),
)

ignition_launch_description = IncludeLaunchDescription(
gz_launch_description = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("ros_gz_sim"), "/launch/gz_sim.launch.py"]
),
launch_arguments={"ign_args": " -r -v 3 empty.sdf"}.items(),
condition=IfCondition(sim_ignition),
launch_arguments={
"gz_args": " -r -v 3 empty.sdf --physics-engine gz-physics-bullet-featherstone-plugin"
}.items(),
condition=IfCondition(sim_gazebo),
)

# Bridge
Expand All @@ -258,10 +232,10 @@ def launch_setup(context, *args, **kwargs):
executable="parameter_bridge",
parameters=[{"use_sim_time": use_sim_time}],
arguments=[
"/wrist_mounted_camera/image@sensor_msgs/msg/Image[ignition.msgs.Image",
"/wrist_mounted_camera/depth_image@sensor_msgs/msg/Image[ignition.msgs.Image",
"/wrist_mounted_camera/points@sensor_msgs/msg/PointCloud2[ignition.msgs.PointCloudPacked",
"/wrist_mounted_camera/camera_info@sensor_msgs/msg/CameraInfo[ignition.msgs.CameraInfo",
"/wrist_mounted_camera/image@sensor_msgs/msg/Image[gz.msgs.Image",
"/wrist_mounted_camera/depth_image@sensor_msgs/msg/Image[gz.msgs.Image",
"/wrist_mounted_camera/points@sensor_msgs/msg/PointCloud2[gz.msgs.PointCloudPacked",
"/wrist_mounted_camera/camera_info@sensor_msgs/msg/CameraInfo[gz.msgs.CameraInfo",
],
output="screen",
)
Expand All @@ -274,11 +248,10 @@ def launch_setup(context, *args, **kwargs):
robot_traj_controller_spawner,
robot_pos_controller_spawner,
robot_hand_controller_spawner,
gzserver,
gzclient,
gazebo_spawn_robot,
ignition_launch_description,
ignition_spawn_entity,
robot_hand_lite_controller_spawner,
gz_robotiq_env_var_resource_path,
gz_launch_description,
gz_spawn_entity,
gazebo_bridge,
]

Expand All @@ -288,18 +261,11 @@ def launch_setup(context, *args, **kwargs):
def generate_launch_description():
declared_arguments = []
# Simulation specific arguments
declared_arguments.append(
DeclareLaunchArgument(
"sim_ignition",
default_value="true",
description="Use Ignition for simulation",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"sim_gazebo",
default_value="false",
description="Use Gazebo Classic for simulation",
default_value="true",
description="Use Gazebo for simulation",
)
)
# Robot specific arguments
Expand Down Expand Up @@ -369,7 +335,7 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"robot_controller",
default_value="gen3_lite_joint_trajectory_controller",
default_value="joint_trajectory_controller",
description="Robot controller to start.",
)
)
Expand Down Expand Up @@ -404,8 +370,8 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"gripper",
default_value="robotiq_2f_85",
choices=["robotiq_2f_85", "robotiq_2f_140", "gen3_lite_2f"],
default_value="",
choices=["robotiq_2f_85", "robotiq_2f_140", "gen3_lite_2f", ""],
description="Gripper to use",
)
)
Expand Down
3 changes: 2 additions & 1 deletion kortex_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
<exec_depend>rviz2</exec_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>xacro</exec_depend>
<exec_depend>gazebo_ros2_control</exec_depend>
<exec_depend>gripper_controllers</exec_depend>
<exec_depend>joint_trajectory_controller</exec_depend>
<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>robotiq_description</exec_depend>
<exec_depend>kortex_description</exec_depend>
<exec_depend>kortex_driver</exec_depend>
<exec_depend>ros_gz_bridge</exec_depend>
<exec_depend>ros_gz_sim</exec_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
2 changes: 0 additions & 2 deletions kortex_description/arms/gen3/6dof/urdf/gen3_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use_fake_hardware:=false
fake_sensor_commands:=false
sim_gazebo:=false
sim_ignition:=false
sim_isaac:=false
isaac_joint_commands:=/isaac_joint_commands
isaac_joint_states:=/isaac_joint_states
Expand All @@ -41,7 +40,6 @@
use_fake_hardware="${use_fake_hardware}"
fake_sensor_commands="${fake_sensor_commands}"
sim_gazebo="${sim_gazebo}"
sim_ignition="${sim_ignition}"
sim_isaac="${sim_isaac}"
isaac_joint_commands="${isaac_joint_commands}"
isaac_joint_states="${isaac_joint_states}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use_fake_hardware:=false
fake_sensor_commands:=false
sim_gazebo:=false
sim_ignition:=false
sim_isaac:=false
isaac_joint_commands:=/isaac_joint_commands
isaac_joint_states:=/isaac_joint_states
Expand All @@ -29,10 +28,7 @@
<ros2_control name="${name}" type="system">
<hardware>
<xacro:if value="${sim_gazebo}">
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</xacro:if>
<xacro:if value="${sim_ignition}">
<plugin>ign_ros2_control/IgnitionSystem</plugin>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</xacro:if>
<xacro:if value="${sim_isaac}">
<plugin>topic_based_ros2_control/TopicBasedSystem</plugin>
Expand All @@ -44,7 +40,7 @@
<param name="fake_sensor_commands">${fake_sensor_commands}</param>
<param name="state_following_offset">0.0</param>
</xacro:if>
<xacro:unless value="${use_fake_hardware or sim_gazebo or sim_ignition or sim_isaac}">
<xacro:unless value="${use_fake_hardware or sim_gazebo or sim_isaac}">
<plugin>kortex_driver/KortexMultiInterfaceHardware</plugin>
<param name="robot_ip">${robot_ip}</param>
<param name="username">${username}</param>
Expand Down
6 changes: 2 additions & 4 deletions kortex_description/arms/gen3/7dof/urdf/gen3_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use_fake_hardware:=false
fake_sensor_commands:=false
sim_gazebo:=false
sim_ignition:=false
sim_isaac:=false
isaac_joint_commands:=/isaac_joint_commands
isaac_joint_states:=/isaac_joint_states
Expand All @@ -41,7 +40,6 @@
use_fake_hardware="${use_fake_hardware}"
fake_sensor_commands="${fake_sensor_commands}"
sim_gazebo="${sim_gazebo}"
sim_ignition="${sim_ignition}"
sim_isaac="${sim_isaac}"
isaac_joint_commands="${isaac_joint_commands}"
isaac_joint_states="${isaac_joint_states}"
Expand Down Expand Up @@ -452,7 +450,7 @@
</joint>
<xacro:if value="${vision}">
<!-- sim camera needs to be rotated which might not apply to built in vision module -->
<xacro:if value="${sim_ignition}">
<xacro:if value="${sim_gazebo}">
<link name="${prefix}camera_link" />
<joint name="${prefix}camera_module" type="fixed">
<origin xyz="0 0.05639 0.01305" rpy="0 ${-PI/2} ${-PI/2}" />
Expand All @@ -472,7 +470,7 @@
<child link="${prefix}camera_color_frame" />
</joint>
</xacro:if>
<xacro:unless value="${sim_ignition}">
<xacro:unless value="${sim_gazebo}">
<link name="${prefix}camera_link" />
<joint name="${prefix}camera_module" type="fixed">
<origin xyz="0 0.05639 -0.00305" rpy="${PI} ${PI} 0" />
Expand Down
Loading

0 comments on commit c2b4ce2

Please sign in to comment.