Skip to content

Commit

Permalink
joystick and launch file
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiefish committed Dec 22, 2023
1 parent 720529e commit 1ce23b1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ezbot_descr_simul/config/joystick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
teleop_twist_joy_node:
ros__parameters:
axis_linear:
x: 1
y: 0
scale_linear:
x: 1.0
y: -1.0
axis_angular:
yaw: 3
scale_angular:
yaw: 1.0
enable_button: 5
enable_turbo_button: 8
45 changes: 45 additions & 0 deletions src/ezbot_descr_simul/launch/joystick.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument

import os
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time')

joy_params = os.path.join(get_package_share_directory('ezbot_descr_simul'),'config','joystick.yaml')

joy_node = Node(
package='joy',
executable='joy_node',
parameters=[joy_params, {'use_sim_time': use_sim_time}],
)

teleop_node = Node(
package='teleop_twist_joy',
executable='teleop_twist_joy',
name='teleop_twist_joy',
parameters=[joy_params, {'use_sim_time': use_sim_time}]
)

# twist_stamper = Node(
# package='twist_stamper',
# executable='twist_stamper',
# parameters=[{'use_sim_time': use_sim_time}],
# remappings=[('/cmd_vel_in','/diff_cont/cmd_vel_unstamped'),
# ('/cmd_vel_out','/diff_cont/cmd_vel')]
# )


return LaunchDescription([
DeclareLaunchArgument(
'use_sim_time',
default_value='true',
description='Use sim time if true'),
joy_node,
teleop_node,
# twist_stamper
])

0 comments on commit 1ce23b1

Please sign in to comment.