Skip to content
Snippets Groups Projects
Commit 5e880912 authored by tauve's avatar tauve
Browse files

[launch] add launch and config files for teleoperate irobot_01 with ps4 wireless controller.

parent fe5115ca
Branches
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ install(
launch
models
worlds
config
DESTINATION
share/${PROJECT_NAME}/
)
......
teleop_twist_joy_node:
ros__parameters:
axis_linear:
x: 1
scale_linear:
x: 0.7
scale_linear_turbo:
x: 1.5
axis_angular:
yaw: 0
scale_angular:
yaw: 0.4
enable_button: 2 # L2 shoulder button
enable_turbo_button: 10 # L1 shoulder button
import os
from ament_index_python.packages import get_package_share_directory
import launch
import launch_ros.actions
def generate_launch_description():
joy_config = launch.substitutions.LaunchConfiguration('joy_config')
joy_dev = launch.substitutions.LaunchConfiguration('joy_dev')
config_filepath = launch.substitutions.LaunchConfiguration('config_filepath')
return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument('joy_vel', default_value='/irobot01/cmd_vel'),
launch.actions.DeclareLaunchArgument('joy_config', default_value='ps3'),
launch.actions.DeclareLaunchArgument('joy_dev', default_value='/dev/input/js0'),
launch.actions.DeclareLaunchArgument('config_filepath', default_value=[
launch.substitutions.TextSubstitution(text=os.path.join(
get_package_share_directory('isae_simulations_package'), 'config', '')),
joy_config, launch.substitutions.TextSubstitution(text='.config.yaml')]),
launch_ros.actions.Node(
package='joy', executable='joy_node', name='joy_node',
parameters=[{
'dev': joy_dev,
'deadzone': 0.3,
'autorepeat_rate': 20.0,
}]),
launch_ros.actions.Node(
package='teleop_twist_joy', executable='teleop_node',
name='teleop_twist_joy_node', parameters=[config_filepath],
remappings={('/cmd_vel', launch.substitutions.LaunchConfiguration('joy_vel'))},
),
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment