Skip to content

Commit 26e9259

Browse files
xmfcxStepTurtle
authored andcommitted
fix(joy_controller): joy_type is only set from the param.yaml file (autowarefoundation#6475)
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent a594e1a commit 26e9259

7 files changed

+72
-3
lines changed

control/joy_controller/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44

55
`joy_controller` is the package to convert a joy msg to autoware commands (e.g. steering wheel, shift, turn signal, engage) for a vehicle.
66

7+
## Usage
8+
9+
### ROS 2 launch
10+
11+
```bash
12+
# With default config (ds4)
13+
ros2 launch joy_controller joy_controller.launch.xml
14+
15+
# Default config but select from the existing parameter files
16+
ros2 launch joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox
17+
18+
# Override the param file
19+
ros2 launch joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
20+
```
21+
722
## Input / Output
823

924
### Input topics

control/joy_controller/config/joy_controller.param.yaml control/joy_controller/config/joy_controller_ds4.param.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**:
22
ros__parameters:
3-
joy_type: $(var joy_type)
3+
joy_type: DS4
44
update_rate: 10.0
55
accel_ratio: 3.0
66
brake_ratio: 5.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**:
2+
ros__parameters:
3+
joy_type: G29
4+
update_rate: 10.0
5+
accel_ratio: 3.0
6+
brake_ratio: 5.0
7+
steer_ratio: 0.5
8+
steering_angle_velocity: 0.1
9+
accel_sensitivity: 1.0
10+
brake_sensitivity: 1.0
11+
control_command:
12+
raw_control: false
13+
velocity_gain: 3.0
14+
max_forward_velocity: 20.0
15+
max_backward_velocity: 3.0
16+
backward_accel_ratio: 1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**:
2+
ros__parameters:
3+
joy_type: P65
4+
update_rate: 10.0
5+
accel_ratio: 3.0
6+
brake_ratio: 5.0
7+
steer_ratio: 0.5
8+
steering_angle_velocity: 0.1
9+
accel_sensitivity: 1.0
10+
brake_sensitivity: 1.0
11+
control_command:
12+
raw_control: false
13+
velocity_gain: 3.0
14+
max_forward_velocity: 20.0
15+
max_backward_velocity: 3.0
16+
backward_accel_ratio: 1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**:
2+
ros__parameters:
3+
joy_type: XBOX
4+
update_rate: 10.0
5+
accel_ratio: 3.0
6+
brake_ratio: 5.0
7+
steer_ratio: 0.5
8+
steering_angle_velocity: 0.1
9+
accel_sensitivity: 1.0
10+
brake_sensitivity: 1.0
11+
control_command:
12+
raw_control: false
13+
velocity_gain: 3.0
14+
max_forward_velocity: 20.0
15+
max_backward_velocity: 3.0
16+
backward_accel_ratio: 1.0

control/joy_controller/launch/joy_controller.launch.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<launch>
2-
<arg name="joy_type" default="DS4" description="options: DS4, G29, P65, XBOX"/>
32
<arg name="external_cmd_source" default="remote" description="options: local, remote"/>
43

54
<arg name="input_joy" default="/joy"/>
@@ -13,7 +12,7 @@
1312
<arg name="output_gate_mode" default="/control/gate_mode_cmd"/>
1413
<arg name="output_vehicle_engage" default="/vehicle/engage"/>
1514

16-
<arg name="config_file" default="$(find-pkg-share joy_controller)/config/joy_controller.param.yaml"/>
15+
<arg name="config_file" default="$(find-pkg-share joy_controller)/config/joy_controller_ds4.param.yaml"/>
1716

1817
<node pkg="joy_controller" exec="joy_controller" name="joy_controller" output="screen">
1918
<remap from="input/joy" to="$(var input_joy)"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<launch>
2+
<arg name="joy_type" default="ds4" description="options: ds4, g29, p65, xbox"/>
3+
4+
<include file="$(find-pkg-share joy_controller)/launch/joy_controller.launch.xml">
5+
<arg name="config_file" value="$(find-pkg-share joy_controller)/config/joy_controller_$(var joy_type).param.yaml"/>
6+
</include>
7+
</launch>

0 commit comments

Comments
 (0)