ros2_control Values
ROS 2 Control Configuration
If your manipulator/gripper/base hardware does not have a ros2_control high-bandwidth streaming driver, refer to the Guide to Non-ROS 2 Control Drivers.
If you are following this guide with example_robot_ws, your workspace should look like branch step4.
We are now editing example_robot_mock config.yaml.
ros2_control
Type: object (required if using ros2_control)
Description: Configuration for ros2_control controllers and hardware interfaces.
ros2_control.config
Type: object (required)
Description: Location of the ros2_control controller configuration file.
ros2_control:
config:
package: "example_robot_mock"
path: "config/control/ros2_controllers.yaml"
Teleoperation Requirements
The following broadcasters and controllers must be configured for MoveIt Pro teleoperation:
- "joint_state_broadcaster" of type
joint_state_broadcaster/JointStateBroadcaster - "joint_trajectory_admittance_controller" of type
joint_trajectory_admittance_controller/JointTrajectoryAdmittanceController- This should be set to command all the joints.
- "velocity_force_controller" of type
velocity_force_controller/VelocityForceController- When running on hardware, this requires a ros2_control high-bandwidth streaming driver.
- This should be set to command all the joints.
- "joint_velocity_controller" of type
joint_velocity_controller/JointVelocityController- When running on hardware, this requires a ros2_control high-bandwidth streaming driver.
- This should be set to command all the joints.
If the JointTrajectoryAdmittanceController for your arm is not named "joint_trajectory_admittance_controller" or you want to use a custom JTC you will need to duplicate the Teleoperate Objective and fill out the joint_trajectory_controller_name and controller_action_server ports exposed by Request Teleoperation.
Make your example_robot_mock/config/control/ros2_controllers.yaml
controller_manager:
ros__parameters:
update_rate: 500 # Hz
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
# force_torque_sensor_broadcaster:
# type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
joint_trajectory_admittance_controller:
type: joint_trajectory_admittance_controller/JointTrajectoryAdmittanceController
velocity_force_controller:
type: velocity_force_controller/VelocityForceController
joint_velocity_controller:
type: joint_velocity_controller/JointVelocityController
robotiq_gripper_controller:
type: position_controllers/GripperActionController
robotiq_activation_controller:
type: robotiq_controllers/RobotiqActivationController
# Need to specify these because our MuJoCo robotiq has additional actuators
joint_state_broadcaster:
ros__parameters:
use_local_topics: false
joints:
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6
- robotiq_85_left_knuckle_joint
interfaces:
- position
- velocity
# force_torque_sensor_broadcaster:
# ros__parameters:
# sensor_name: tcp_fts_sensor
# state_interface_names:
# - force.x
# - force.y
# - force.z
# - torque.x
# - torque.y
# - torque.z
# frame_id: tool0
joint_trajectory_admittance_controller:
ros__parameters:
# Joint group to control.
planning_group_name: manipulator
# The tip link of the kinematic chain, i.e. the frame that will be controlled.
ee_frame: grasp_link
# The frame where the force / torque sensor reading is given.
# (Needs to exist in the kinematic chain).
sensor_frame: ft_frame
# The name of the force torque sensor in the robot description which will be used in the admittance calculation.
# ft_sensor_name: tcp_fts_sensor
# Joint accelerations chosen to match MoveIt configs.
stop_accelerations:
- 30.0
- 30.0
- 30.0
- 30.0
- 30.0
- 30.0
velocity_force_controller:
ros__parameters:
# Joint group to control.
planning_group_name: manipulator
# The tip link of the kinematic chain, i.e. the frame that will be controlled.
ee_frame: grasp_link
# The frame where the force / torque sensor reading is given.
# (Needs to exist in the kinematic chain).
sensor_frame: ft_frame
# The name of the force torque sensor in the robot description which will be used in the admittance calculation.
# ft_sensor_name: tcp_fts_sensor
# Maximum joint-space velocities.
max_joint_velocity:
- 1.0
- 1.0
- 1.0
- 1.0
- 1.0
- 1.0
# Maximum joint-space accelerations.
max_joint_acceleration:
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
# Maximum Cartesian-space velocities.
max_cartesian_velocity:
- 0.25
- 0.25
- 0.25
- 1.0
- 1.0
- 1.0
# Maximum Cartesian-space accelerations.
max_cartesian_acceleration:
- 2.0
- 2.0
- 2.0
- 4.0
- 4.0
- 4.0
# Rate in Hz at which the controller will publish the state.
state_publish_rate: 10
# Damping coefficient for the Jacobian damped least-squares inverse.
jacobian_damping: 0.005
# Timeout in seconds after which the controller will stop motion if no new commands are received.
command_timeout: 0.2
# Padding (in radians) to add to joint position limits as a safety margin.
joint_limit_position_tolerance: 0.02
joint_velocity_controller:
ros__parameters:
# Joint group to control.
planning_group_name: manipulator
# Maximum joint-space velocities.
max_joint_velocity:
- 1.0
- 1.0
- 1.0
- 1.0
- 1.0
- 1.0
# Maximum joint-space accelerations.
max_joint_acceleration:
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
- 2.0
command_interfaces: ["position"]
# Padding (in radians) to add to joint position limits as a safety margin.
joint_limit_position_tolerance: 0.02
# Timeout in seconds after which the controller will stop motion if no new commands are received.
command_timeout: 0.2
# Rate in Hz at which the controller will publish the state.
state_publish_rate: 20
robotiq_gripper_controller:
ros__parameters:
default: true
joint: robotiq_85_left_knuckle_joint
allow_stalling: true
stall_timeout: 0.05
goal_tolerance: 0.02
robotiq_activation_controller:
ros__parameters:
default: true
ros2_control.controllers_active_at_startup
Type: array (optional, default: [])
Description: List of controllers to load and activate when MoveIt Pro starts.
ros2_control:
controllers_active_at_startup:
- "joint_state_broadcaster"
# - "force_torque_sensor_broadcaster"
- "joint_trajectory_admittance_controller"
- "robotiq_gripper_controller"
We recommending listing all broadcasters here. If you have a set of non-overlapping "primary" controllers you want to ensure claim your hardware resources on startup, also put those here.
ros2_control.controllers_inactive_at_startup
Type: array (optional, default: [])
Description: List of controllers to load but not activate at startup (can be activated later).
ros2_control:
controllers_inactive_at_startup:
- "velocity_force_controller"
- "joint_velocity_controller"
Controllers that would claim resources used by a controllers_active_at_startup (e.g. a velocity controller that would claim the same hardware resources as a position controller) should be listed here to reduce startup noise about failed controller activation due to conflicting resources.
A controller must be listed in either controllers_active_at_startup or controllers_inactive_at_startup or it will not be spawned.
ros2_control.controllers_not_managed
Type: array (optional, default: [])
Description: List of controllers that MoveIt Pro should not spawn or manage.
ros2_control:
controllers_not_managed:
- "external_controller"
This is typically empty.
ros2_control.controller_shared_topics
Type: array (optional, default: [])
Description: Topic remapping configuration for sharing topics between controllers.
ros2_control:
controller_shared_topics:
/joint_commands:
- "/controller1/joint_commands"
- "/controller2/joint_commands"
This is typically empty.
Multi-arm, Mobile Manipulator, and Multi-tip Tool Teleoperation Considerations
It is important to understand that for safety reasons, ROS 2 Control will not enable you to switch from Controller A to Controller B unless it can fully allocate the command resources Controller A held.
For example, if you want to switch from a controller that commands all joints of your mobile manipulator to a controller that commands only the manipulator joints, you must have controllers configured for:
- mobile base + manipulator
- manipulator only
- mobile base only
Your example_robot_ws workspace should now look like branch step5.