Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(joy_controller): joy_type is only set from the param.yaml file #6475

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions control/joy_controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

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

## Usage

### ROS 2 launch

```bash
# With default config (ds4)
ros2 launch joy_controller joy_controller.launch.xml

# Default config but select from the existing parameter files
ros2 launch joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox

# Override the param file
ros2 launch joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
```

## Input / Output

### Input topics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**:
ros__parameters:
joy_type: $(var joy_type)
joy_type: DS4
update_rate: 10.0
accel_ratio: 3.0
brake_ratio: 5.0
Expand Down
16 changes: 16 additions & 0 deletions control/joy_controller/config/joy_controller_g29.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**:
ros__parameters:
joy_type: G29
update_rate: 10.0
accel_ratio: 3.0
brake_ratio: 5.0
steer_ratio: 0.5
steering_angle_velocity: 0.1
accel_sensitivity: 1.0
brake_sensitivity: 1.0
control_command:
raw_control: false
velocity_gain: 3.0
max_forward_velocity: 20.0
max_backward_velocity: 3.0
backward_accel_ratio: 1.0
16 changes: 16 additions & 0 deletions control/joy_controller/config/joy_controller_p65.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**:
ros__parameters:
joy_type: P65
update_rate: 10.0
accel_ratio: 3.0
brake_ratio: 5.0
steer_ratio: 0.5
steering_angle_velocity: 0.1
accel_sensitivity: 1.0
brake_sensitivity: 1.0
control_command:
raw_control: false
velocity_gain: 3.0
max_forward_velocity: 20.0
max_backward_velocity: 3.0
backward_accel_ratio: 1.0
16 changes: 16 additions & 0 deletions control/joy_controller/config/joy_controller_xbox.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**:
ros__parameters:
joy_type: XBOX
update_rate: 10.0
accel_ratio: 3.0
brake_ratio: 5.0
steer_ratio: 0.5
steering_angle_velocity: 0.1
accel_sensitivity: 1.0
brake_sensitivity: 1.0
control_command:
raw_control: false
velocity_gain: 3.0
max_forward_velocity: 20.0
max_backward_velocity: 3.0
backward_accel_ratio: 1.0
3 changes: 1 addition & 2 deletions control/joy_controller/launch/joy_controller.launch.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<launch>
<arg name="joy_type" default="DS4" description="options: DS4, G29, P65, XBOX"/>
<arg name="external_cmd_source" default="remote" description="options: local, remote"/>

<arg name="input_joy" default="/joy"/>
Expand All @@ -13,7 +12,7 @@
<arg name="output_gate_mode" default="/control/gate_mode_cmd"/>
<arg name="output_vehicle_engage" default="/vehicle/engage"/>

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

<node pkg="joy_controller" exec="joy_controller" name="joy_controller" output="screen">
<remap from="input/joy" to="$(var input_joy)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<launch>
<arg name="joy_type" default="ds4" description="options: ds4, g29, p65, xbox"/>

<include file="$(find-pkg-share joy_controller)/launch/joy_controller.launch.xml">
<arg name="config_file" value="$(find-pkg-share joy_controller)/config/joy_controller_$(var joy_type).param.yaml"/>
</include>
</launch>
Loading