Skip to content

Commit 3c3a3ac

Browse files
committed
use configs from /config dir
1 parent 66de8ed commit 3c3a3ac

File tree

5 files changed

+45
-18
lines changed

5 files changed

+45
-18
lines changed

husarion_ugv_controller/launch/controller.launch.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434

3535

3636
def generate_launch_description():
37+
husarion_ugv_desctiption_pkg = FindPackageShare("husarion_ugv_description")
38+
husarion_ugv_controller_common_dir = PathJoinSubstitution(
39+
["/config", "husarion_ugv_controller"]
40+
)
41+
3742
battery_config_path = LaunchConfiguration("battery_config_path")
3843
declare_battery_config_path_arg = DeclareLaunchArgument(
3944
"battery_config_path",
@@ -48,7 +53,7 @@ def generate_launch_description():
4853
declare_components_config_path_arg = DeclareLaunchArgument(
4954
"components_config_path",
5055
default_value=PathJoinSubstitution(
51-
[FindPackageShare("panther_description"), "config", "components.yaml"]
56+
[husarion_ugv_desctiption_pkg, "config", "components.yaml"]
5257
),
5358
description=(
5459
"Additional components configuration file. Components described in this file "
@@ -64,7 +69,7 @@ def generate_launch_description():
6469
"controller_config_path",
6570
default_value=PathJoinSubstitution(
6671
[
67-
FindPackageShare("husarion_ugv_controller"),
72+
husarion_ugv_controller_common_dir,
6873
"config",
6974
PythonExpression(["'", wheel_type, "_controller.yaml'"]),
7075
]
@@ -112,20 +117,19 @@ def generate_launch_description():
112117
choices=["True", "true", "False", "false"],
113118
)
114119

115-
robot_description_pkg = PythonExpression(["'", robot_model, "_description'"])
116120
wheel_config_path = LaunchConfiguration("wheel_config_path")
117121
declare_wheel_config_path_arg = DeclareLaunchArgument(
118122
"wheel_config_path",
119123
default_value=PathJoinSubstitution(
120124
[
121-
FindPackageShare(robot_description_pkg),
125+
FindPackageShare(husarion_ugv_desctiption_pkg),
122126
"config",
123127
PythonExpression(["'", wheel_type, ".yaml'"]),
124128
]
125129
),
126130
description=(
127131
"Path to wheel configuration file. By default, it is located in "
128-
"'panther_description/config/{wheel_type}.yaml'. You can also specify the path "
132+
"'husarion_ugv_description/config/{wheel_type}.yaml'. You can also specify the path "
129133
"to your custom wheel configuration file here. "
130134
),
131135
)
@@ -143,7 +147,6 @@ def generate_launch_description():
143147
)
144148

145149
# Get URDF via xacro
146-
robot_description_pkg = PythonExpression(["'", robot_model, "_description'"])
147150
robot_description_file = PythonExpression(["'", robot_model, ".urdf.xacro'"])
148151
imu_pos_x = os.environ.get("ROBOT_IMU_LOCALIZATION_X", "0.168")
149152
imu_pos_y = os.environ.get("ROBOT_IMU_LOCALIZATION_Y", "0.028")
@@ -157,7 +160,7 @@ def generate_launch_description():
157160
" ",
158161
PathJoinSubstitution(
159162
[
160-
FindPackageShare(robot_description_pkg),
163+
FindPackageShare(husarion_ugv_desctiption_pkg),
161164
"urdf",
162165
robot_description_file,
163166
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file is a placeholder for user-defined animations for the Husarion UGV
2+
# robots lights system. Users can define their own light animations in this
3+
# YAML file.
4+
#
5+
# For more examples and detailed documentation, please visit:
6+
# https://github.com/husarion/panther_ros/blob/ros2/panther_lights/CONFIGURATION.md#defining-animations
7+
#
8+
# Example including a simple custom animation:
9+
#
10+
# user_animations:
11+
# - id: 21
12+
# name: CUSTOM_IMAGE_ANIMATION
13+
# priority: 3
14+
# animations:
15+
# - type: panther_lights::ImageAnimation
16+
# segments: all
17+
# animation:
18+
# image: /config/husarion_ugv_lights/animations/example.png
19+
# duration: 3
20+
# repeat: 1

husarion_ugv_lights/launch/lights.launch.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333

3434
def generate_launch_description():
3535
robot_model = LaunchConfiguration("robot_model")
36-
lights_pkg = FindPackageShare("husarion_ugv_lights")
36+
husarion_ugv_lights_pkg = FindPackageShare("husarion_ugv_lights")
37+
husarion_ugv_lights_common_dir = PathJoinSubstitution(["/config", "husarion_ugv_lights"])
3738
animations_config = PythonExpression(["'", robot_model, "_animations.yaml'"])
3839

3940
animations_config_path = LaunchConfiguration("animations_config_path")
4041
declare_animations_config_path_arg = DeclareLaunchArgument(
4142
"animations_config_path",
42-
default_value=PathJoinSubstitution([lights_pkg, "config", animations_config]),
43+
default_value=PathJoinSubstitution([husarion_ugv_lights_pkg, "config", animations_config]),
4344
description="Path to a YAML file with a description of led configuration.",
4445
)
4546

@@ -69,12 +70,14 @@ def generate_launch_description():
6970
user_led_animations_path = LaunchConfiguration("user_led_animations_path")
7071
declare_user_led_animations_path_arg = DeclareLaunchArgument(
7172
"user_led_animations_path",
72-
default_value="",
73+
default_value=PathJoinSubstitution(
74+
[husarion_ugv_lights_common_dir, "config", "user_animations.yaml"]
75+
),
7376
description="Path to a YAML file with a description of the user defined animations.",
7477
)
7578

7679
driver_config = PythonExpression(["'", robot_model, "_driver.yaml'"])
77-
driver_config_path = PathJoinSubstitution([lights_pkg, "config", driver_config])
80+
driver_config_path = PathJoinSubstitution([husarion_ugv_lights_pkg, "config", driver_config])
7881
lights_container = ComposableNodeContainer(
7982
package="rclcpp_components",
8083
name="lights_container",

husarion_ugv_localization/launch/localization.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def generate_launch_description():
9090
declare_localization_config_path_arg = DeclareLaunchArgument(
9191
"localization_config_path",
9292
default_value=PathJoinSubstitution(
93-
[FindPackageShare("husarion_ugv_localization"), "config", localization_config_filename]
93+
["/config", "husarion_ugv_localization", "config", localization_config_filename]
9494
),
9595
description="Specify the path to the localization configuration file.",
9696
)

husarion_ugv_manager/launch/manager.launch.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828

2929
def generate_launch_description():
3030

31-
husarion_ugv_manager_dir = FindPackageShare("husarion_ugv_manager")
31+
husarion_ugv_manager_pkg = FindPackageShare("husarion_ugv_manager")
32+
husarion_ugv_manager_common_dir = PathJoinSubstitution(["/config", "husarion_ugv_manager"])
3233

3334
lights_bt_project_path = LaunchConfiguration("lights_bt_project_path")
3435
declare_lights_bt_project_path_arg = DeclareLaunchArgument(
3536
"lights_bt_project_path",
3637
default_value=PathJoinSubstitution(
37-
[husarion_ugv_manager_dir, "behavior_trees", "LightsBT.btproj"]
38+
[husarion_ugv_manager_common_dir, "behavior_trees", "LightsBT.btproj"]
3839
),
3940
description="Path to BehaviorTree project file, responsible for lights management.",
4041
)
@@ -50,7 +51,7 @@ def generate_launch_description():
5051
declare_safety_bt_project_path_arg = DeclareLaunchArgument(
5152
"safety_bt_project_path",
5253
default_value=PathJoinSubstitution(
53-
[husarion_ugv_manager_dir, "behavior_trees", "SafetyBT.btproj"]
54+
[husarion_ugv_manager_pkg, "behavior_trees", "SafetyBT.btproj"]
5455
),
5556
description="Path to BehaviorTree project file, responsible for safety and shutdown management.",
5657
)
@@ -60,7 +61,7 @@ def generate_launch_description():
6061
"shutdown_hosts_config_path",
6162
default_value=PathJoinSubstitution(
6263
[
63-
FindPackageShare("husarion_ugv_manager"),
64+
husarion_ugv_manager_common_dir,
6465
"config",
6566
"shutdown_hosts.yaml",
6667
]
@@ -80,7 +81,7 @@ def generate_launch_description():
8081
executable="lights_manager_node",
8182
name="lights_manager",
8283
parameters=[
83-
PathJoinSubstitution([husarion_ugv_manager_dir, "config", "lights_manager.yaml"]),
84+
PathJoinSubstitution([husarion_ugv_manager_pkg, "config", "lights_manager.yaml"]),
8485
{"bt_project_path": lights_bt_project_path},
8586
],
8687
namespace=namespace,
@@ -92,7 +93,7 @@ def generate_launch_description():
9293
executable="safety_manager_node",
9394
name="safety_manager",
9495
parameters=[
95-
PathJoinSubstitution([husarion_ugv_manager_dir, "config", "safety_manager.yaml"]),
96+
PathJoinSubstitution([husarion_ugv_manager_pkg, "config", "safety_manager.yaml"]),
9697
{
9798
"bt_project_path": safety_bt_project_path,
9899
"shutdown_hosts_path": shutdown_hosts_config_path,

0 commit comments

Comments
 (0)