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

Update the launch file to work with modern joy. #52

Merged
merged 1 commit into from
Sep 6, 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
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
ros2/teleop_twist_joy
================
=====================

# Overview
The purpose of this package is to provide a generic facility for tele-operating Twist-based ROS2 robots with a standard joystick.
The purpose of this package is to provide a generic facility for tele-operating Twist-based ROS 2 robots with a standard joystick.
It converts joy messages to velocity commands.

This node provides no rate limiting or autorepeat functionality. It is expected that you take advantage of the features built into [joy](https://index.ros.org/p/joy/github-ros-drivers-joystick_drivers/#foxy) for this.
This node provides no rate limiting or autorepeat functionality.
It is expected that you take advantage of the features built into [joy](https://index.ros.org/p/joy/github-ros-drivers-joystick_drivers) for this.

## Executables
The package comes with the `teleop_node` that republishes `sensor_msgs/msg/Joy` messages as scaled `geometry_msgs/msg/Twist` messages.
Expand Down Expand Up @@ -82,8 +83,8 @@ For most users building from source will not be required, execute `apt-get insta

## Run
A launch file has been provided which has three arguments which can be changed in the terminal or via your own launch file.
To configure the node to match your joystick a config file can be used.
There are several common ones provided in this package (atk3, ps3-holonomic, ps3, xbox, xd3), located here: https://github.com/ros2/teleop_twist_joy/tree/eloquent/config.
To configure the node to match your joystick a config file can be used.
There are several common ones provided in this package (atk3, ps3-holonomic, ps3, xbox, xd3), located here: https://github.com/ros2/teleop_twist_joy/tree/rolling/config.

PS3 is default, to run for another config (e.g. xbox) use this:
````
Expand All @@ -96,7 +97,7 @@ __Note:__ this launch file also launches the `joy` node so do not run it separat
## Arguments
- `joy_config (string, default: 'ps3')`
- Config file to use
- `joy_dev (string, default: 'dev/input/js0')`
- `joy_dev (string, default: '0')`
- Joystick device to use
- `config_filepath (string, default: '/opt/ros/<rosdistro>/share/teleop_twist_joy/config/' + LaunchConfig('joy_config') + '.config.yaml')`
- Path to config files
Expand Down
4 changes: 2 additions & 2 deletions launch/teleop-launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def generate_launch_description():
return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument('joy_vel', default_value='cmd_vel'),
launch.actions.DeclareLaunchArgument('joy_config', default_value='ps3'),
launch.actions.DeclareLaunchArgument('joy_dev', default_value='/dev/input/js0'),
launch.actions.DeclareLaunchArgument('joy_dev', default_value='0'),
launch.actions.DeclareLaunchArgument('publish_stamped_twist', default_value='false'),
launch.actions.DeclareLaunchArgument('config_filepath', default_value=[
launch.substitutions.TextSubstitution(text=os.path.join(
Expand All @@ -25,7 +25,7 @@ def generate_launch_description():
launch_ros.actions.Node(
package='joy', executable='joy_node', name='joy_node',
parameters=[{
'dev': joy_dev,
'device_id': joy_dev,
'deadzone': 0.3,
'autorepeat_rate': 20.0,
}]),
Expand Down