works somehow on unity in start config

This commit is contained in:
moscowsky
2026-06-15 13:42:36 +03:00
parent e7c5631de5
commit 6aa952a732
8 changed files with 185 additions and 40 deletions
+69
View File
@@ -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,
]
)
+1
View File
@@ -54,6 +54,7 @@ def generate_launch_description():
fe_emulator = Node(
package="unity_robot_controller",
executable="fire_extinguisher_emulator_node",
namespace=LaunchConfiguration("namespace"),
parameters=[
{"use_sim_time": LaunchConfiguration("use_sim_time")},
],