diff --git a/README.md b/README.md index 1b7dee1e..63c8c9ab 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Launch arguments are largely common to both simulation and physical robot. Howev | ✅ | ✅ | `localization_mode` | Specifies the localization mode:
- 'relative' `odometry/filtered` data is relative to the initial position and orientation.
- 'enu' `odometry/filtered` data is relative to initial position and ENU (East North Up) orientation.
***string:*** `relative` (choices: `relative`, `enu`) | | ✅ | ✅ | `namespace` | Add namespace to all launched nodes.
***string:*** `env(ROBOT_NAMESPACE)` | | ✅ | ✅ | `publish_robot_state` | Whether to publish the default URDF of specified robot.
***bool:*** `True` | -| ❌ | ✅ | `robot_model` | Specify robot model type.
***string:*** `env(ROBOT_MODEL)` (choices: `lynx`, `panther`) | +| ❌ | ✅ | `robot_model` | Specify robot model type.
***string:*** `env(ROBOT_MODEL_NAME)` (choices: `lynx`, `panther`) | | ✅ | ✅ | `safety_bt_project_path` | Path to BehaviorTree project file, responsible for safety and shutdown management.
***string:*** [`SafetyBT.btproj`](./husarion_ugv_manager/behavior_trees/SafetyBT.btproj) | | ✅ | ✅ | `shutdown_hosts_config_path` | Path to file with list of hosts to request shutdown.
***string:*** [`shutdown_hosts.yaml`](./husarion_ugv_manager/config/shutdown_hosts.yaml) | | ✅ | ✅ | `use_ekf` | Enable or disable EKF.
***bool:*** `True` | diff --git a/husarion_ugv_bringup/launch/bringup.launch.py b/husarion_ugv_bringup/launch/bringup.launch.py index 78e52927..1e542143 100644 --- a/husarion_ugv_bringup/launch/bringup.launch.py +++ b/husarion_ugv_bringup/launch/bringup.launch.py @@ -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 @@ -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( diff --git a/husarion_ugv_controller/launch/controller.launch.py b/husarion_ugv_controller/launch/controller.launch.py index 661f67cd..843bbbc6 100644 --- a/husarion_ugv_controller/launch/controller.launch.py +++ b/husarion_ugv_controller/launch/controller.launch.py @@ -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"], ) diff --git a/husarion_ugv_gazebo/launch/simulate_robot.launch.py b/husarion_ugv_gazebo/launch/simulate_robot.launch.py index db367687..a13a0115 100644 --- a/husarion_ugv_gazebo/launch/simulate_robot.launch.py +++ b/husarion_ugv_gazebo/launch/simulate_robot.launch.py @@ -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 @@ -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"], ) diff --git a/husarion_ugv_gazebo/launch/spawn_robot.launch.py b/husarion_ugv_gazebo/launch/spawn_robot.launch.py index 39a47a2c..f3013e13 100644 --- a/husarion_ugv_gazebo/launch/spawn_robot.launch.py +++ b/husarion_ugv_gazebo/launch/spawn_robot.launch.py @@ -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 @@ -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"], ) diff --git a/husarion_ugv_lights/config/user_animations.yaml b/husarion_ugv_lights/config/user_animations.yaml index 01771347..0d31ca44 100644 --- a/husarion_ugv_lights/config/user_animations.yaml +++ b/husarion_ugv_lights/config/user_animations.yaml @@ -4,7 +4,9 @@ # # For more examples and detailed documentation, please visit: # https://github.com/husarion/panther_ros/blob/ros2/panther_lights/CONFIGURATION.md#defining-animations -# + +user_animations: [] + # Example including a simple custom animation: # # user_animations: diff --git a/husarion_ugv_lights/launch/lights.launch.py b/husarion_ugv_lights/launch/lights.launch.py index 8fd1f466..27023d82 100644 --- a/husarion_ugv_lights/launch/lights.launch.py +++ b/husarion_ugv_lights/launch/lights.launch.py @@ -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 @@ -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"], ) diff --git a/husarion_ugv_manager/src/lights_manager_node.cpp b/husarion_ugv_manager/src/lights_manager_node.cpp index 289a2f54..2238ded1 100644 --- a/husarion_ugv_manager/src/lights_manager_node.cpp +++ b/husarion_ugv_manager/src/lights_manager_node.cpp @@ -22,7 +22,6 @@ #include #include -#include "ament_index_cpp/get_package_share_directory.hpp" #include "behaviortree_ros2/ros_node_params.hpp" #include "rclcpp/rclcpp.hpp" diff --git a/husarion_ugv_manager/src/safety_manager_node.cpp b/husarion_ugv_manager/src/safety_manager_node.cpp index 63965f4f..33ede2c0 100644 --- a/husarion_ugv_manager/src/safety_manager_node.cpp +++ b/husarion_ugv_manager/src/safety_manager_node.cpp @@ -24,7 +24,6 @@ #include #include -#include "ament_index_cpp/get_package_share_directory.hpp" #include "behaviortree_ros2/ros_node_params.hpp" #include "rclcpp/rclcpp.hpp" @@ -138,7 +137,7 @@ std::map SafetyManagerNode::CreateSafetyInitialBlackboard const double cpu_fan_off_temp = this->params_.cpu.temp.fan_off; const double driver_fan_on_temp = this->params_.driver.temp.fan_on; const double driver_fan_off_temp = this->params_.driver.temp.fan_off; - const double fan_turn_off_timeout = this->params_.fan_turn_off_timeout; + const float fan_turn_off_timeout = static_cast(this->params_.fan_turn_off_timeout); const std::map safety_initial_bb = { {"CPU_FAN_OFF_TEMP", cpu_fan_off_temp}, diff --git a/husarion_ugv_manager/test/test_lights_behavior_tree.cpp b/husarion_ugv_manager/test/test_lights_behavior_tree.cpp index 4a9f342d..e44285a6 100644 --- a/husarion_ugv_manager/test/test_lights_behavior_tree.cpp +++ b/husarion_ugv_manager/test/test_lights_behavior_tree.cpp @@ -22,6 +22,7 @@ #include "gtest/gtest.h" +#include "ament_index_cpp/get_package_share_directory.hpp" #include "behaviortree_cpp/basic_types.h" #include "rclcpp/rclcpp.hpp" @@ -107,6 +108,10 @@ TestLightsBehaviorTree::TestLightsBehaviorTree() std::vector TestLightsBehaviorTree::CreateTestParameters() const { + const auto panther_manager_pkg_path = + ament_index_cpp::get_package_share_directory("husarion_ugv_manager"); + const std::string bt_project_path = panther_manager_pkg_path + "/behavior_trees/LightsBT.btproj"; + std::vector plugin_libs; plugin_libs.push_back("tick_after_timeout_bt_node"); @@ -114,11 +119,11 @@ std::vector TestLightsBehaviorTree::CreateTestParameters() co ros_plugin_libs.push_back("call_set_led_animation_service_bt_node"); std::vector params; + params.push_back(rclcpp::Parameter("bt_project_path", bt_project_path)); params.push_back(rclcpp::Parameter("plugin_libs", plugin_libs)); params.push_back(rclcpp::Parameter("ros_plugin_libs", ros_plugin_libs)); - params.push_back(rclcpp::Parameter("battery.animation_period.low", kLowBatteryAnimPeriod)); - params.push_back( - rclcpp::Parameter("battery.animation_period.critical", kCriticalBatteryAnimPeriod)); + params.push_back(rclcpp::Parameter("battery.anim_period.low", kLowBatteryAnimPeriod)); + params.push_back(rclcpp::Parameter("battery.anim_period.critical", kCriticalBatteryAnimPeriod)); return params; } diff --git a/husarion_ugv_manager/test/test_safety_behavior_tree.cpp b/husarion_ugv_manager/test/test_safety_behavior_tree.cpp index 6f9540bf..9e7dc51d 100644 --- a/husarion_ugv_manager/test/test_safety_behavior_tree.cpp +++ b/husarion_ugv_manager/test/test_safety_behavior_tree.cpp @@ -22,6 +22,7 @@ #include "gtest/gtest.h" +#include "ament_index_cpp/get_package_share_directory.hpp" #include "behaviortree_cpp/basic_types.h" #include "rclcpp/rclcpp.hpp" @@ -126,6 +127,10 @@ TestSafetyBehaviorTree::~TestSafetyBehaviorTree() { rclcpp::shutdown(); } std::vector TestSafetyBehaviorTree::CreateTestParameters() const { + const auto panther_manager_pkg_path = + ament_index_cpp::get_package_share_directory("husarion_ugv_manager"); + const std::string bt_project_path = panther_manager_pkg_path + "/behavior_trees/SafetyBT.btproj"; + std::vector plugin_libs; plugin_libs.push_back("tick_after_timeout_bt_node"); plugin_libs.push_back("shutdown_single_host_bt_node"); @@ -137,6 +142,7 @@ std::vector TestSafetyBehaviorTree::CreateTestParameters() co ros_plugin_libs.push_back("call_trigger_service_bt_node"); std::vector params; + params.push_back(rclcpp::Parameter("bt_project_path", bt_project_path)); params.push_back(rclcpp::Parameter("plugin_libs", plugin_libs)); params.push_back(rclcpp::Parameter("ros_plugin_libs", ros_plugin_libs)); params.push_back(rclcpp::Parameter("fan_turn_off_timeout", kFanTurnOffTimeout));