works somehow on unity in start config
parent
e7c5631de5
commit
6aa952a732
@ -0,0 +1,17 @@
|
||||
arctic_bot/joy_control:
|
||||
ros__parameters:
|
||||
speed_x_axis: 4
|
||||
speed_y_axis: 3
|
||||
speed_throttle_btn: 7
|
||||
|
||||
crosshair_plus_x_btn: -1
|
||||
crosshair_minus_x_btn: -1
|
||||
crosshair_plus_y_btn: -1
|
||||
crosshair_minus_y_btn: -1
|
||||
|
||||
crosshair_step: 0.05
|
||||
|
||||
crosshair_x_axis: 6
|
||||
crosshair_y_axis: 7
|
||||
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
arctic_bot/joy:
|
||||
ros__parameters:
|
||||
# to list connected devices, use:
|
||||
# ros2 run joy joy_enumerate_devices
|
||||
device_id: 0
|
||||
# device_name can used instead of device_id. device_name takes precedence
|
||||
device_name: ""
|
||||
# in [0.; 1.0]
|
||||
deadzone: 0.3
|
||||
# set autorepeat to 0 to disable
|
||||
autorepeat_rate: 20.0
|
||||
sticky_buttons: false
|
||||
# rate control
|
||||
coalesce_interval_ms: 1
|
||||
@ -0,0 +1,69 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import (
|
||||
PathJoinSubstitution,
|
||||
LaunchConfiguration,
|
||||
TextSubstitution,
|
||||
)
|
||||
from launch_ros.substitutions import FindPackageShare
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.descriptions import ParameterFile
|
||||
|
||||
def generate_launch_description():
|
||||
pkg_unity_robot_controller = FindPackageShare(package="").find("unity_robot_controller")
|
||||
|
||||
|
||||
# Launch arguments
|
||||
launch_args = [
|
||||
DeclareLaunchArgument(
|
||||
"use_sim_time",
|
||||
description="Use clock from simulation",
|
||||
default_value="True",
|
||||
),
|
||||
DeclareLaunchArgument(
|
||||
"joy_model",
|
||||
description="Used joystick model (default is T-29)",
|
||||
default_value="T-29.yaml",
|
||||
),
|
||||
DeclareLaunchArgument(
|
||||
"namespace", default_value="arctic_bot", description="Top-level namespace"
|
||||
),
|
||||
]
|
||||
|
||||
joy_config = PathJoinSubstitution([pkg_unity_robot_controller, "config", "joy_config.yaml"])
|
||||
|
||||
model = LaunchConfiguration("joy_model")
|
||||
joy_params = PathJoinSubstitution([pkg_unity_robot_controller,
|
||||
"config",
|
||||
model
|
||||
])
|
||||
|
||||
joy_node = Node(
|
||||
package="joy",
|
||||
executable="joy_node",
|
||||
name="joy",
|
||||
namespace=LaunchConfiguration("namespace"),
|
||||
output="both",
|
||||
parameters=[
|
||||
ParameterFile(joy_config),
|
||||
],
|
||||
)
|
||||
|
||||
joy_control_node = Node(
|
||||
package="unity_robot_controller",
|
||||
executable="joy_control_node",
|
||||
name="joy_control",
|
||||
namespace=LaunchConfiguration("namespace"),
|
||||
output="both",
|
||||
parameters=[
|
||||
ParameterFile(joy_params),
|
||||
],
|
||||
)
|
||||
|
||||
return LaunchDescription(
|
||||
launch_args
|
||||
+ [
|
||||
joy_node,
|
||||
joy_control_node,
|
||||
]
|
||||
)
|
||||
Loading…
Reference in New Issue