Controller
We support the following types of controllers on all platforms:
- ps4: standard Playstation4 controller (bluetooth).
- ps5: standard Playstation5 controller (bluetooth).
- logitech: Logitech F710 (USB dongle).
- xbox: Xbox controller (bluetooth).
Switching between each is done by setting the controller
parameter under the platform
tag.
controller: ps4 # one of ps4, ps5, logitech, xbox
Default Button Mappings
By default, Clearpath platforms use the left and right triggers (typically buttons L1, R1) as the normal deadman and turbo deadman buttons respectively. The vertical axis of the left joystick will control linear speed in the X direction, and the horizontal axis controls angular speed. For omnidirectional robots, the horizontal axis of the right joystick will control linear speed in the Y direction.
Changing Button Mappings
If you wish to change the default button mappings, this can be modified by using the
extras.ros_parameters
field in robot.yaml
. First, find the default configuration file for your controller.
The comments at the top of the file will describe the axis mappings relative to the controller buttons. This varies between controllers.
Next, modify the teleop_twist_joy_node
parameters with your updated button mappings. Here are some examples:
- Right Hand Differential control (PS4)
- Swap linear Y and angular Yaw axes (PS4)
- Deadman buttons on L2 and R2 (PS4)
extras:
ros_parameters:
teleop_twist_joy_node:
axis_linear.x: 4
axis_angular.yaw: 3
enable_button: 5
enable_turbo_button: 4
extras:
ros_parameters:
teleop_twist_joy_node:
axis_linear.y: 0
axis_angular.yaw: 3
extras:
ros_parameters:
teleop_twist_joy_node:
enable_button: 6
enable_turbo_button: 7
Teleop Speeds
By default, holding the left trigger button of the controller enables driving at "normal" speeds while holding the right trigger button enables driving at "turbo" speeds.
The table below shows the default linear and angular speeds for each platform:
Platform | Linear speed (normal, m/s) | Linear speed (turbo, m/s) | Angular speed (normal, rad/s) | Angular speed (turbo, rad/s) |
---|---|---|---|---|
Husky A300 | 0.4 | 1.5 | 0.5 | 1.0 |
Husky A200 | 0.4 | 1.0 | 0.6 | 1.2 |
Jackal | 0.4 | 2.0 | 0.6 | 1.4 |
Warthog | 0.5 | 1.0 | 2.4 | 2.4 |
Dingo-D | 0.4 | 1.0 | 0.6 | 1.0 |
Dingo-O | 0.4 | 1.0 | 0.5 | 1.4 |
Ridgeback | 0.4 | 0.4 | 0.5 | 0.5 |
Changing Teleop Speeds
The normal and turbo teleop speeds can be adjusted by modifying the controller node's ROS parameters by using the
extras.ros_parameters
field in robot.yaml
.
extras:
ros_parameters:
teleop_twist_joy_node:
scale_linear.x: 0.6
scale_angular.z: 0.75
scale_linear_turbo.x: 2.0
scale_angular_turbo.z: 1.0
Normal speed parameters
scale_linear.x
sets the maximum forward/reverse velocityscale_linear.y
sets the maximum left/right velocity (Omnidirectional control only)scale_angular.z
sets the maximum angular velocity
Turbo speed parameters
scale_linear_turbo.x
sets the maximum forward/reverse velocityscale_linear_turbo.y
sets the maximum left/right velocity (Omnidirectional control only)scale_angular_turbo.z
sets the maximum angular velocity
Do not set the normal or turbo velocity limits higher than the robot's maximum velocity. Doing so may make the robot difficult to control. The robot will not exceed its maximum speed, but the scaling on the joystick may result in awkward clipping, causing teleoperation to be jerky.
Changing the joy
device
By default the joy_node
will open one of the following devices, created by a udev
rule included in
the clearpath_robot
package:
Controller type | Linux joy device |
---|---|
ps4 | /dev/input/ps4 |
ps5 | /dev/input/ps5 |
xbox | /dev/input/xbox |
logitech | /dev/input/f710 |
To manually specify a different device file or symlink, use the extras.ros_parameters
field in
robot.yaml
, for example:
extras:
ros_parameters:
joy_node:
dev: /dev/input/js0