Skip to content

Commit

Permalink
Add joy_device launch argument in case js0 isn't the correct joystick
Browse files Browse the repository at this point in the history
  • Loading branch information
civerachb-cpr committed Jul 31, 2024
1 parent f2f30da commit 96f0ff4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion turtlebot4_bringup/launch/joy_teleop.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

from nav2_common.launch import RewrittenYaml

ARGUMENTS = [
DeclareLaunchArgument('joy_device', default_value='/dev/input/js0',
description='Linux joy input device')
]

def generate_launch_description():
pkg_turtlebot4_bringup = get_package_share_directory('turtlebot4_bringup')
Expand All @@ -47,6 +51,9 @@ def generate_launch_description():
joy_node = Node(
package='joy_linux',
executable='joy_linux_node',
parameters=[{
'dev': LaunchConfiguration('joy_device')
}],
name='joy_linux_node',
remappings=[('/diagnostics', 'diagnostics')]
)
Expand All @@ -58,7 +65,7 @@ def generate_launch_description():
parameters=[controller_config]
)

ld = LaunchDescription()
ld = LaunchDescription(ARGUMENTS)
ld.add_action(controller_config_cmd)
ld.add_action(joy_node)
ld.add_action(teleop_twist_joy_node)
Expand Down

0 comments on commit 96f0ff4

Please sign in to comment.