Setting up a custom ROS2 Robot Controller
Our recommended approach for connecting robot hardware to MoveIt Pro is using the defacto ROS standard of the ros_control libraries. However, some hardware does not use that standard for a variety of reasons, and instead just offers basic ROS messages, services, or action interfaces. This guide discusses how to connect robots to MoveIt Pro without ros_control, with some drawbacks.
If your custom controller does not already have a ROS2 integration layer, e.g. exposing a FollowJointTrajectory
or GripperCommand
interface, this setup will not work.
Customize the launch file
The first step is to specify the package
and path
to the launch file for your driver, either by integrating it to the default launch file or crafting your own.
Set this in your config.yaml
under robot_driver_persist_launch_file
:
robot_driver_persist_launch_file:
package: "package_name"
path: "launch/something.launch.py"
Update MoveIt 2 Controller Config File
Next, you will need to update the MoveIt Controller Config File to recognize your custom controller in Pro using this guide.
You may not need to depend on the ros2_control
manager if your custom driver directly exposes the FollowJointTrajectory
action or GripperCommand
interface.
Update MoveIt Pro Config File
Finally, you will need to update your MoveIt Pro robot configuration package config.yaml
to point to your new controller config, and activate the controller by default, if desired. It should look like this:
moveit_params:
moveit_simple_controller_manager:
package: "package_name"
path: "config/moveit/your_controller_manager_above.yaml"
ros2_control:
controllers_active_at_startup:
- "controller_name"
PickNik typically co-develops these advanced configurations with our customers; ask us about how we work with companies on these difficult controller configurations.