Skip to content

Commit

Permalink
component file
Browse files Browse the repository at this point in the history
  • Loading branch information
KmakD committed Nov 21, 2024
1 parent 3c3a3ac commit 9d5be9f
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions husarion_ugv_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@


def generate_launch_description():
husarion_ugv_desctiption_pkg = FindPackageShare("husarion_ugv_description")
husarion_ugv_controller_common_dir = PathJoinSubstitution(
["/config", "husarion_ugv_controller"]
)

robot_model = LaunchConfiguration("robot_model")
robot_model_dict = {"LNX": "lynx", "PTH": "panther"}
robot_model_env = os.environ.get("ROBOT_MODEL", default="PTH")

robot_description_pkg = PythonExpression(["'", robot_model, "_description'"])
robot_description_common_dir = PathJoinSubstitution(["/config", robot_description_pkg])

declare_robot_model_arg = DeclareLaunchArgument(
"robot_model",
default_value=robot_model_dict[robot_model_env],
description="Specify robot model",
choices=["lynx", "panther"],
)

battery_config_path = LaunchConfiguration("battery_config_path")
declare_battery_config_path_arg = DeclareLaunchArgument(
"battery_config_path",
Expand All @@ -53,7 +66,7 @@ def generate_launch_description():
declare_components_config_path_arg = DeclareLaunchArgument(
"components_config_path",
default_value=PathJoinSubstitution(
[husarion_ugv_desctiption_pkg, "config", "components.yaml"]
[robot_description_common_dir, "config", "components.yaml"]
),
description=(
"Additional components configuration file. Components described in this file "
Expand Down Expand Up @@ -99,16 +112,6 @@ def generate_launch_description():
choices=["True", "true", "False", "false"],
)

robot_model = LaunchConfiguration("robot_model")
robot_model_dict = {"LNX": "lynx", "PTH": "panther"}
robot_model_env = os.environ.get("ROBOT_MODEL", default="PTH")
declare_robot_model_arg = DeclareLaunchArgument(
"robot_model",
default_value=robot_model_dict[robot_model_env],
description="Specify robot model",
choices=["lynx", "panther"],
)

use_sim = LaunchConfiguration("use_sim")
declare_use_sim_arg = DeclareLaunchArgument(
"use_sim",
Expand All @@ -122,14 +125,14 @@ def generate_launch_description():
"wheel_config_path",
default_value=PathJoinSubstitution(
[
FindPackageShare(husarion_ugv_desctiption_pkg),
FindPackageShare(robot_description_pkg),
"config",
PythonExpression(["'", wheel_type, ".yaml'"]),
]
),
description=(
"Path to wheel configuration file. By default, it is located in "
"'husarion_ugv_description/config/{wheel_type}.yaml'. You can also specify the path "
"'panther_description/config/{wheel_type}.yaml'. You can also specify the path "
"to your custom wheel configuration file here. "
),
)
Expand Down Expand Up @@ -160,7 +163,7 @@ def generate_launch_description():
" ",
PathJoinSubstitution(
[
FindPackageShare(husarion_ugv_desctiption_pkg),
FindPackageShare(robot_description_pkg),
"urdf",
robot_description_file,
]
Expand Down

0 comments on commit 9d5be9f

Please sign in to comment.