Skip to content

Commit

Permalink
use ROBOT_MODEL_NAME env
Browse files Browse the repository at this point in the history
  • Loading branch information
KmakD committed Dec 4, 2024
1 parent a80dfe5 commit 450e189
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Launch arguments are largely common to both simulation and physical robot. Howev
||| `localization_mode` | Specifies the localization mode: <br/>- 'relative' `odometry/filtered` data is relative to the initial position and orientation. <br/>- 'enu' `odometry/filtered` data is relative to initial position and ENU (East North Up) orientation. <br/> ***string:*** `relative` (choices: `relative`, `enu`) |
||| `namespace` | Add namespace to all launched nodes. <br/> ***string:*** `env(ROBOT_NAMESPACE)` |
||| `publish_robot_state` | Whether to publish the default URDF of specified robot. <br/> ***bool:*** `True` |
||| `robot_model` | Specify robot model type. <br/> ***string:*** `env(ROBOT_MODEL)` (choices: `lynx`, `panther`) |
||| `robot_model` | Specify robot model type. <br/> ***string:*** `env(ROBOT_MODEL_NAME)` (choices: `lynx`, `panther`) |
||| `safety_bt_project_path` | Path to BehaviorTree project file, responsible for safety and shutdown management. <br/> ***string:*** [`SafetyBT.btproj`](./husarion_ugv_manager/behavior_trees/SafetyBT.btproj) |
||| `shutdown_hosts_config_path` | Path to file with list of hosts to request shutdown. <br/> ***string:*** [`shutdown_hosts.yaml`](./husarion_ugv_manager/config/shutdown_hosts.yaml) |
||| `use_ekf` | Enable or disable EKF. <br/> ***bool:*** `True` |
Expand Down
7 changes: 2 additions & 5 deletions husarion_ugv_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from husarion_ugv_utils.messages import welcome_msg
from launch import LaunchDescription
Expand Down Expand Up @@ -45,12 +44,10 @@ def generate_launch_description():
description="Add namespace to all launched nodes.",
)

robot_model_dict = {"LNX": "lynx", "PTH": "panther"}
robot_model_env = os.environ.get("ROBOT_MODEL", default="PTH")
robot_model = robot_model_dict[robot_model_env]
robot_model_name = EnvironmentVariable(name="ROBOT_MODEL_NAME", default_value="panther")
robot_serial_no = EnvironmentVariable(name="ROBOT_SERIAL_NO", default_value="----")
robot_version = EnvironmentVariable(name="ROBOT_VERSION", default_value="1.0")
welcome_info = welcome_msg(robot_model, robot_serial_no, robot_version)
welcome_info = welcome_msg(robot_model_name, robot_serial_no, robot_version)

controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
5 changes: 1 addition & 4 deletions husarion_ugv_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ def generate_launch_description():
)

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],
default_value=EnvironmentVariable(name="ROBOT_MODEL_NAME", default_value="panther"),
description="Specify robot model",
choices=["lynx", "panther"],
)
Expand Down
5 changes: 1 addition & 4 deletions husarion_ugv_gazebo/launch/simulate_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
Expand Down Expand Up @@ -94,11 +93,9 @@ def generate_launch_description():
description="Add namespace to all launched nodes.",
)

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],
default_value=EnvironmentVariable(name="ROBOT_MODEL_NAME", default_value="panther"),
description="Specify robot model",
choices=["lynx", "panther"],
)
Expand Down
5 changes: 1 addition & 4 deletions husarion_ugv_gazebo/launch/spawn_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from husarion_ugv_utils.messages import welcome_msg
from launch import LaunchDescription
Expand All @@ -40,11 +39,9 @@ def generate_launch_description():
)

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],
default_value=EnvironmentVariable(name="ROBOT_MODEL_NAME", default_value="panther"),
description="Specify robot model",
choices=["lynx", "panther"],
)
Expand Down
5 changes: 1 addition & 4 deletions husarion_ugv_lights/launch/lights.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, Shutdown
Expand Down Expand Up @@ -51,11 +50,9 @@ def generate_launch_description():
description="Add namespace to all launched nodes.",
)

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],
default_value=EnvironmentVariable(name="ROBOT_MODEL_NAME", default_value="panther"),
description="Specify robot model",
choices=["lynx", "panther"],
)
Expand Down

0 comments on commit 450e189

Please sign in to comment.