From bf3c289cdce93870893585fc6b308b0a5db16289 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Tue, 24 Sep 2024 16:14:11 +0200 Subject: [PATCH] Reaname all the pkgs and most of the files --- .docs/panther_ros2_api.drawio.svg | 4 - .docs/ros2_system_design.drawio.svg | 4 + .github/workflows/release-project.yaml | 2 +- .github/workflows/run-unit-tests.yaml | 12 +- .pre-commit-config.yaml | 2 +- README.md | 38 ++--- ROS_API.md | 34 ++-- {panther => husarion_ugv}/CHANGELOG.rst | 0 {panther => husarion_ugv}/CMakeLists.txt | 2 +- husarion_ugv/README.md | 3 + .../hardware_deps.repos | 0 {panther => husarion_ugv}/package.xml | 8 +- .../simulation_deps.repos | 0 .../CHANGELOG.rst | 0 .../CMakeLists.txt | 6 +- .../README.md | 18 +- .../husarion_ugv_battery}/adc_data_reader.hpp | 10 +- .../battery/adc_battery.hpp | 22 +-- .../husarion_ugv_battery}/battery/battery.hpp | 10 +- .../battery/roboteq_battery.hpp | 18 +- .../battery_driver_node.hpp | 16 +- .../battery_publisher/battery_publisher.hpp | 10 +- .../dual_battery_publisher.hpp | 14 +- .../single_battery_publisher.hpp | 14 +- .../launch/battery.launch.py | 2 +- .../package.xml | 4 +- .../src/battery/adc_battery.cpp | 16 +- .../src/battery/roboteq_battery.cpp | 12 +- .../src/battery_driver_node.cpp | 20 +-- .../battery_publisher/battery_publisher.cpp | 6 +- .../dual_battery_publisher.cpp | 16 +- .../single_battery_publisher.cpp | 10 +- .../src/main.cpp | 5 +- .../test/battery/test_adc_battery.cpp | 20 ++- .../test/battery/test_battery.cpp | 11 +- .../test/battery/test_roboteq_battery.cpp | 18 +- .../test_battery_publisher.cpp | 6 +- .../test_dual_battery_publisher.cpp | 32 ++-- .../test_single_battery_publisher.cpp | 24 +-- .../test/test_adc_data_reader.cpp | 6 +- .../test_battery_driver_node_adc_dual.cpp | 18 +- .../test_battery_driver_node_adc_single.cpp | 16 +- .../test/test_battery_driver_node_roboteq.cpp | 12 +- .../test/utils/test_battery_driver_node.hpp | 12 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 2 +- .../README.md | 4 +- .../launch/bringup.launch.py | 14 +- .../package.xml | 18 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 2 +- husarion_ugv_controller/CONFIGURATION.md | 9 + .../README.md | 4 +- .../config/WH01_controller.yaml | 0 .../config/WH02_controller.yaml | 0 .../config/WH04_controller.yaml | 2 +- .../config/WH05_controller.yaml | 0 .../launch/controller.launch.py | 8 +- .../package.xml | 6 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 4 +- .../README.md | 4 +- .../cmake/SuperBuild.cmake | 2 +- .../config/system_monitor.yaml | 0 .../husarion_ugv_diagnostics}/filesystem.hpp | 10 +- .../system_monitor_node.hpp | 14 +- .../husarion_ugv_diagnostics}/types.hpp | 10 +- .../launch/system_monitor.launch.py | 2 +- .../package.xml | 6 +- .../src/main.cpp | 8 +- .../src/system_monitor_node.cpp | 24 +-- .../integration/system_monitor_node.test.py | 2 +- .../test/unit/test_filesystem.cpp | 7 +- .../test/unit/test_system_monitor_node.cpp | 26 +-- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 15 +- .../CONFIGURATION.md | 12 +- .../README.md | 4 +- .../config/battery_plugin.yaml | 4 +- .../config/gz_bridge.yaml | 0 .../config/teleop_with_estop.config | 0 .../hooks/husarion_ugv_gazebo.sh.in | 0 .../husarion_ugv_gazebo/estop_system.hpp | 12 +- .../husarion_ugv_gazebo}/gui/e_stop.hpp | 10 +- .../husarion_ugv_gazebo}/led_strip.hpp | 10 +- .../launch/simulate_robot.launch.py | 20 +-- .../launch/simulation.launch.py | 4 +- .../launch/spawn_robot.launch.py | 2 +- .../package.xml | 12 +- .../plugins.xml | 6 +- .../src/estop_system.cpp | 30 ++-- .../src/gui/EStop.qml | 0 .../src/gui/EStop.qrc | 0 .../src/gui/e_stop.cpp | 8 +- .../src/led_strip.cpp | 10 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 40 ++--- .../CODE_STRUCTURE.md | 0 .../README.md | 6 +- .../cmake/SuperBuild.cmake | 2 +- .../config/canopen_configuration.yaml | 0 .../config/master.dcf | 0 .../config/phidgets_spatial_parameters.yaml | 0 .../roboteq_motor_controllers_v80_21a.eds | 0 .../husarion_ugv_hardware_interfaces.xml | 14 +- .../panther_imu_sensor/panther_imu_sensor.hpp | 10 +- .../panther_system/gpio/gpio_controller.hpp | 18 +- .../panther_system/gpio/gpio_driver.hpp | 12 +- .../panther_system/gpio/types.hpp | 10 +- .../panther_system/lynx_system.hpp | 12 +- .../panther_system/panther_system.hpp | 12 +- .../robot_driver/canopen_manager.hpp | 10 +- .../panther_system/robot_driver/driver.hpp | 10 +- .../robot_driver/lynx_robot_driver.hpp | 16 +- .../robot_driver/panther_robot_driver.hpp | 16 +- .../robot_driver/robot_driver.hpp | 12 +- .../robot_driver/roboteq_data_converters.hpp | 14 +- .../robot_driver/roboteq_driver.hpp | 12 +- .../robot_driver/roboteq_error_filter.hpp | 10 +- .../robot_driver/roboteq_robot_driver.hpp | 18 +- .../panther_system/system_e_stop.hpp | 16 +- .../panther_system/system_ros_interface.hpp | 14 +- .../panther_system/ugv_system.hpp | 22 +-- .../utils.hpp | 10 +- .../package.xml | 4 +- .../panther_imu_sensor/panther_imu_sensor.cpp | 8 +- .../panther_system/gpio/gpio_controller.cpp | 10 +- .../src/panther_system/gpio/gpio_driver.cpp | 12 +- .../src/panther_system/lynx_system.cpp | 17 +- .../src/panther_system/panther_system.cpp | 18 +- .../robot_driver/canopen_manager.cpp | 12 +- .../robot_driver/lynx_robot_driver.cpp | 10 +- .../robot_driver/panther_robot_driver.cpp | 10 +- .../robot_driver/roboteq_data_converters.cpp | 14 +- .../robot_driver/roboteq_driver.cpp | 10 +- .../robot_driver/roboteq_error_filter.cpp | 6 +- .../robot_driver/roboteq_robot_driver.cpp | 14 +- .../src/panther_system/system_e_stop.cpp | 6 +- .../panther_system/system_ros_interface.cpp | 8 +- .../src/panther_system/ugv_system.cpp | 16 +- .../src/utils.cpp | 6 +- .../test/config/canopen_configuration.yaml | 0 .../test/config/slave_1.bin | Bin .../test_panther_imu_sensor.cpp | 14 +- .../gpio/test_gpio_controller.cpp | 12 +- .../panther_system/gpio/test_gpio_driver.cpp | 26 +-- .../test/test_utils.cpp | 14 +- .../robot_driver/test_canopen_manager.cpp | 20 +-- .../robot_driver/test_lynx_robot_driver.cpp | 57 ++++--- .../test_panther_robot_driver.cpp | 78 ++++----- .../test_roboteq_data_converters.cpp | 49 +++--- .../robot_driver/test_roboteq_driver.cpp | 68 ++++---- .../test_roboteq_error_filter.cpp | 34 ++-- .../test_roboteq_robot_driver.cpp | 108 ++++++------ .../unit/panther_system/test_lynx_system.cpp | 112 ++++++------ .../panther_system/test_panther_system.cpp | 159 ++++++++++-------- .../test_system_ros_interface.cpp | 27 +-- .../unit/panther_system/test_ugv_system.cpp | 31 ++-- .../test/utils/fake_can_socket.hpp | 10 +- .../test/utils/mock_driver.hpp | 26 +-- .../test/utils/mock_roboteq.hpp | 14 +- .../test/utils/panther_system_test_utils.hpp | 10 +- .../test/utils/system_test_utils.hpp | 41 ++--- .../test/utils/test_constants.hpp | 20 +-- .../.docs/AUTONOMOUS_ACTION.webp | Bin .../.docs/BATTERY_STATE.webp | Bin .../.docs/CHARGING_BATTERY.webp | Bin .../.docs/CRITICAL_BATTERY.webp | Bin .../.docs/ERROR.webp | Bin .../.docs/E_STOP.webp | Bin .../.docs/GOAL_ACHIEVED.webp | Bin .../.docs/LOW_BATTERY.webp | Bin .../.docs/MANUAL_ACTION.webp | Bin .../.docs/READY.webp | Bin .../CHANGELOG.rst | 0 .../CMakeLists.txt | 43 +++-- .../CONFIGURATION.md | 22 +-- .../LIGHTS_API.md | 4 +- .../README.md | 12 +- .../animations/lynx/battery_critical.png | Bin .../animations/lynx/battery_low.png | Bin .../animations/lynx/strip01_purple.png | Bin .../animations/lynx/strip01_red.png | Bin .../animations/lynx/triangle01_blue.png | Bin .../animations/lynx/triangle01_cyan.png | Bin .../animations/lynx/triangle01_green.png | Bin .../animations/lynx/triangle01_orange.png | Bin .../animations/lynx/triangle01_purple.png | Bin .../animations/lynx/triangle01_red.png | Bin .../animations/lynx/triangle01_yellow.png | Bin .../animations/panther/battery_critical.png | Bin .../animations/panther/battery_low.png | Bin .../animations/panther/strip01_purple.png | Bin .../animations/panther/strip01_red.png | Bin .../animations/panther/triangle01_blue.png | Bin .../animations/panther/triangle01_cyan.png | Bin .../animations/panther/triangle01_green.png | Bin .../animations/panther/triangle01_orange.png | Bin .../animations/panther/triangle01_purple.png | Bin .../animations/panther/triangle01_red.png | Bin .../animations/panther/triangle01_yellow.png | Bin .../config/lynx_animations.yaml | 34 ++-- .../config/lynx_driver.yaml | 0 .../config/panther_animations.yaml | 34 ++-- .../config/panther_driver.yaml | 0 .../animation/animation.hpp | 16 +- .../animation/charging_animation.hpp | 12 +- .../animation/image_animation.hpp | 12 +- .../include/husarion_ugv_lights}/apa102.hpp | 10 +- .../led_components/led_animations_queue.hpp | 12 +- .../led_components/led_panel.hpp | 10 +- .../led_components/led_segment.hpp | 18 +- .../led_components/segment_converter.hpp | 14 +- .../lights_controller_node.hpp | 18 +- .../lights_driver_node.hpp | 12 +- .../launch/lights.launch.py | 10 +- .../package.xml | 6 +- husarion_ugv_lights/plugins.xml | 8 + .../src/animation/charging_animation.cpp | 8 +- .../src/animation/image_animation.cpp | 14 +- .../src/apa102.cpp | 6 +- .../led_components/led_animations_queue.cpp | 6 +- .../src/led_components/led_panel.cpp | 6 +- .../src/led_components/led_segment.cpp | 22 +-- .../src/led_components/segment_converter.cpp | 10 +- .../src/lights_controller_node.cpp | 51 +++--- .../src/lights_driver_node.cpp | 10 +- .../test/files/animation.png | Bin .../test/integration/panther_lights.test.py | 10 +- .../test/unit/animation/test_animation.cpp | 4 +- .../animation/test_charging_animation.cpp | 4 +- .../unit/animation/test_image_animation.cpp | 12 +- .../led_components/test_led_animation.cpp | 30 ++-- .../test_led_animations_queue.cpp | 82 ++++----- .../unit/led_components/test_led_panel.cpp | 8 +- .../unit/led_components/test_led_segment.cpp | 106 ++++++------ .../led_components/test_segment_converter.cpp | 54 +++--- .../test/unit/test_apa102.cpp | 6 +- .../test/unit/test_lights_controller_node.cpp | 29 ++-- .../test/unit/test_lights_driver_node.cpp | 14 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 2 +- .../README.md | 2 +- .../config/enu_localization.yaml | 2 +- .../config/enu_localization_with_gps.yaml | 2 +- .../config/nmea_navsat_params.yaml | 0 .../config/relative_localization.yaml | 2 +- .../relative_localization_with_gps.yaml | 2 +- .../launch/localization.launch.py | 4 +- .../launch/nmea_navsat.launch.py | 2 +- .../package.xml | 4 +- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 23 +-- .../CONFIGURATION.md | 6 +- .../README.md | 8 +- .../behavior_trees/PantherLightsBT.btproj | 0 .../behavior_trees/PantherSafetyBT.btproj | 0 .../behavior_trees/lights.xml | 0 .../behavior_trees/safety.xml | 0 .../behavior_trees/shutdown.xml | 0 .../config/lights_manager.yaml | 0 .../config/safety_manager.yaml | 0 .../config/shutdown_hosts.yaml | 0 .../behavior_tree_manager.hpp | 10 +- .../behavior_tree_utils.hpp | 14 +- .../lights_manager_node.hpp | 16 +- .../action/call_set_bool_service_node.hpp | 10 +- .../call_set_led_animation_service_node.hpp | 10 +- .../action/call_trigger_service_node.hpp | 10 +- .../action/shutdown_hosts_from_file_node.hpp | 16 +- .../action/shutdown_single_host_node.hpp | 14 +- .../plugins/action/signal_shutdown_node.hpp | 10 +- .../decorator/tick_after_timeout_node.hpp | 10 +- .../plugins/shutdown_host.hpp | 10 +- .../plugins/shutdown_hosts_node.hpp | 14 +- .../safety_manager_node.hpp | 20 +-- .../launch/manager.launch.py | 16 +- .../package.xml | 6 +- .../src/behavior_tree_manager.cpp | 6 +- .../src/lights_manager_node.cpp | 20 +-- .../src/lights_manager_node_main.cpp | 5 +- .../action/call_set_bool_service_node.cpp | 10 +- .../call_set_led_animation_service_node.cpp | 10 +- .../action/call_trigger_service_node.cpp | 10 +- .../action/shutdown_hosts_from_file_node.cpp | 24 +-- .../action/shutdown_single_host_node.cpp | 12 +- .../plugins/action/signal_shutdown_node.cpp | 8 +- .../decorator/tick_after_timeout_node.cpp | 8 +- .../src/safety_manager_node.cpp | 24 +-- .../src/safety_manager_node_main.cpp | 5 +- .../test_call_set_bool_service_node.cpp | 16 +- ...st_call_set_led_animation_service_node.cpp | 26 ++- .../action/test_call_trigger_service_node.cpp | 14 +- .../test_shutdown_hosts_from_file_node.cpp | 21 +-- .../action/test_shutdown_single_host_node.cpp | 16 +- .../action/test_signal_shutdown_node.cpp | 8 +- .../test_tick_after_timeout_node.cpp | 6 +- .../test/plugins/test_shutdown_host.cpp | 36 ++-- .../test/plugins/test_shutdown_hosts_node.cpp | 50 +++--- .../test/test_behavior_tree_manager.cpp | 10 +- .../test/test_behavior_tree_utils.cpp | 10 +- .../test/test_lights_behavior_tree.cpp | 4 +- .../test/test_lights_manager_node.cpp | 10 +- .../test/test_safety_behavior_tree.cpp | 4 +- .../test/test_safety_manager_node.cpp | 16 +- .../test/utils/behavior_tree_test_utils.hpp | 6 +- .../test/utils/plugin_test_utils.hpp | 26 +-- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 2 +- .../README.md | 4 +- .../husarion_ugv_utils}/__init__.py | 0 .../integration_test_utils.py | 0 .../husarion_ugv_utils}/messages.py | 0 .../husarion_ugv_utils}/common_utilities.hpp | 10 +- .../husarion_ugv_utils}/configure_rt.hpp | 10 +- .../husarion_ugv_utils}/diagnostics.hpp | 10 +- .../husarion_ugv_utils}/moving_average.hpp | 10 +- .../include/husarion_ugv_utils}/ros_utils.hpp | 10 +- .../test/ros_test_utils.hpp | 10 +- .../husarion_ugv_utils}/test/test_utils.hpp | 10 +- .../husarion_ugv_utils}/yaml_utils.hpp | 10 +- .../package.xml | 2 +- .../test/test_common_utilities.cpp | 41 ++--- .../test/test_diagnostics.cpp | 12 +- .../test/test_moving_average.cpp | 20 +-- .../test/test_ros_test_utils.cpp | 8 +- .../test/test_ros_utils.cpp | 27 +-- .../test/test_test_utils.cpp | 28 +-- .../test/test_yaml_utils.cpp | 36 ++-- lynx_description/launch/load_urdf.launch.py | 4 +- lynx_description/urdf/lynx.urdf.xacro | 2 +- lynx_description/urdf/lynx_macro.urdf.xacro | 6 +- panther/README.md | 3 - panther_controller/CONFIGURATION.md | 9 - .../launch/load_urdf.launch.py | 4 +- panther_description/urdf/gazebo.urdf.xacro | 2 +- panther_description/urdf/panther.urdf.xacro | 2 +- .../urdf/panther_macro.urdf.xacro | 6 +- panther_lights/plugins.xml | 8 - 339 files changed, 2069 insertions(+), 1989 deletions(-) delete mode 100644 .docs/panther_ros2_api.drawio.svg create mode 100644 .docs/ros2_system_design.drawio.svg rename {panther => husarion_ugv}/CHANGELOG.rst (100%) rename {panther => husarion_ugv}/CMakeLists.txt (80%) create mode 100644 husarion_ugv/README.md rename panther/panther_hardware.repos => husarion_ugv/hardware_deps.repos (100%) rename {panther => husarion_ugv}/package.xml (71%) rename panther/panther_simulation.repos => husarion_ugv/simulation_deps.repos (100%) rename {panther_battery => husarion_ugv_battery}/CHANGELOG.rst (100%) rename {panther_battery => husarion_ugv_battery}/CMakeLists.txt (97%) rename {panther_battery => husarion_ugv_battery}/README.md (75%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/adc_data_reader.hpp (90%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery/adc_battery.hpp (83%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery/battery.hpp (95%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery/roboteq_battery.hpp (81%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery_driver_node.hpp (80%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery_publisher/battery_publisher.hpp (88%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery_publisher/dual_battery_publisher.hpp (84%) rename {panther_battery/include/panther_battery => husarion_ugv_battery/include/husarion_ugv_battery}/battery_publisher/single_battery_publisher.hpp (78%) rename {panther_battery => husarion_ugv_battery}/launch/battery.launch.py (97%) rename {panther_battery => husarion_ugv_battery}/package.xml (93%) rename {panther_battery => husarion_ugv_battery}/src/battery/adc_battery.cpp (93%) rename {panther_battery => husarion_ugv_battery}/src/battery/roboteq_battery.cpp (94%) rename {panther_battery => husarion_ugv_battery}/src/battery_driver_node.cpp (91%) rename {panther_battery => husarion_ugv_battery}/src/battery_publisher/battery_publisher.cpp (96%) rename {panther_battery => husarion_ugv_battery}/src/battery_publisher/dual_battery_publisher.cpp (96%) rename {panther_battery => husarion_ugv_battery}/src/battery_publisher/single_battery_publisher.cpp (92%) rename {panther_battery => husarion_ugv_battery}/src/main.cpp (86%) rename {panther_battery => husarion_ugv_battery}/test/battery/test_adc_battery.cpp (93%) rename {panther_battery => husarion_ugv_battery}/test/battery/test_battery.cpp (93%) rename {panther_battery => husarion_ugv_battery}/test/battery/test_roboteq_battery.cpp (92%) rename {panther_battery => husarion_ugv_battery}/test/battery_publisher/test_battery_publisher.cpp (94%) rename {panther_battery => husarion_ugv_battery}/test/battery_publisher/test_dual_battery_publisher.cpp (93%) rename {panther_battery => husarion_ugv_battery}/test/battery_publisher/test_single_battery_publisher.cpp (75%) rename {panther_battery => husarion_ugv_battery}/test/test_adc_data_reader.cpp (92%) rename {panther_battery => husarion_ugv_battery}/test/test_battery_driver_node_adc_dual.cpp (91%) rename {panther_battery => husarion_ugv_battery}/test/test_battery_driver_node_adc_single.cpp (91%) rename {panther_battery => husarion_ugv_battery}/test/test_battery_driver_node_roboteq.cpp (93%) rename {panther_battery => husarion_ugv_battery}/test/utils/test_battery_driver_node.hpp (93%) rename {panther_bringup => husarion_ugv_bringup}/CHANGELOG.rst (100%) rename {panther_bringup => husarion_ugv_bringup}/CMakeLists.txt (83%) rename {panther_bringup => husarion_ugv_bringup}/README.md (87%) rename {panther_bringup => husarion_ugv_bringup}/launch/bringup.launch.py (87%) rename {panther_bringup => husarion_ugv_bringup}/package.xml (80%) rename {panther_controller => husarion_ugv_controller}/CHANGELOG.rst (100%) rename {panther_localization => husarion_ugv_controller}/CMakeLists.txt (82%) create mode 100644 husarion_ugv_controller/CONFIGURATION.md rename {panther_controller => husarion_ugv_controller}/README.md (95%) rename {panther_controller => husarion_ugv_controller}/config/WH01_controller.yaml (100%) rename {panther_controller => husarion_ugv_controller}/config/WH02_controller.yaml (100%) rename {panther_controller => husarion_ugv_controller}/config/WH04_controller.yaml (98%) rename {panther_controller => husarion_ugv_controller}/config/WH05_controller.yaml (100%) rename {panther_controller => husarion_ugv_controller}/launch/controller.launch.py (97%) rename {panther_controller => husarion_ugv_controller}/package.xml (88%) rename {panther_diagnostics => husarion_ugv_diagnostics}/CHANGELOG.rst (100%) rename {panther_diagnostics => husarion_ugv_diagnostics}/CMakeLists.txt (97%) rename {panther_diagnostics => husarion_ugv_diagnostics}/README.md (95%) rename {panther_diagnostics => husarion_ugv_diagnostics}/cmake/SuperBuild.cmake (97%) rename {panther_diagnostics => husarion_ugv_diagnostics}/config/system_monitor.yaml (100%) rename {panther_diagnostics/include/panther_diagnostics => husarion_ugv_diagnostics/include/husarion_ugv_diagnostics}/filesystem.hpp (93%) rename {panther_diagnostics/include/panther_diagnostics => husarion_ugv_diagnostics/include/husarion_ugv_diagnostics}/system_monitor_node.hpp (87%) rename {panther_diagnostics/include/panther_diagnostics => husarion_ugv_diagnostics/include/husarion_ugv_diagnostics}/types.hpp (82%) rename {panther_diagnostics => husarion_ugv_diagnostics}/launch/system_monitor.launch.py (97%) rename {panther_diagnostics => husarion_ugv_diagnostics}/package.xml (87%) rename {panther_diagnostics => husarion_ugv_diagnostics}/src/main.cpp (80%) rename {panther_diagnostics => husarion_ugv_diagnostics}/src/system_monitor_node.cpp (89%) rename {panther_diagnostics => husarion_ugv_diagnostics}/test/integration/system_monitor_node.test.py (97%) rename {panther_diagnostics => husarion_ugv_diagnostics}/test/unit/test_filesystem.cpp (91%) rename {panther_diagnostics => husarion_ugv_diagnostics}/test/unit/test_system_monitor_node.cpp (83%) rename {panther_gazebo => husarion_ugv_gazebo}/CHANGELOG.rst (100%) rename {panther_gazebo => husarion_ugv_gazebo}/CMakeLists.txt (82%) rename {panther_gazebo => husarion_ugv_gazebo}/CONFIGURATION.md (71%) rename {panther_gazebo => husarion_ugv_gazebo}/README.md (98%) rename {panther_gazebo => husarion_ugv_gazebo}/config/battery_plugin.yaml (82%) rename {panther_gazebo => husarion_ugv_gazebo}/config/gz_bridge.yaml (100%) rename {panther_gazebo => husarion_ugv_gazebo}/config/teleop_with_estop.config (100%) rename panther_gazebo/hooks/panther_gazebo.sh.in => husarion_ugv_gazebo/hooks/husarion_ugv_gazebo.sh.in (100%) rename panther_gazebo/include/panther_gazebo/gz_panther_system.hpp => husarion_ugv_gazebo/include/husarion_ugv_gazebo/estop_system.hpp (90%) rename {panther_gazebo/include/panther_gazebo => husarion_ugv_gazebo/include/husarion_ugv_gazebo}/gui/e_stop.hpp (89%) rename {panther_gazebo/include/panther_gazebo => husarion_ugv_gazebo/include/husarion_ugv_gazebo}/led_strip.hpp (96%) rename {panther_gazebo => husarion_ugv_gazebo}/launch/simulate_robot.launch.py (91%) rename {panther_gazebo => husarion_ugv_gazebo}/launch/simulation.launch.py (94%) rename {panther_gazebo => husarion_ugv_gazebo}/launch/spawn_robot.launch.py (98%) rename {panther_gazebo => husarion_ugv_gazebo}/package.xml (93%) rename panther_gazebo/panther_simulation_plugins.xml => husarion_ugv_gazebo/plugins.xml (62%) rename panther_gazebo/src/gz_panther_system.cpp => husarion_ugv_gazebo/src/estop_system.cpp (82%) rename {panther_gazebo => husarion_ugv_gazebo}/src/gui/EStop.qml (100%) rename {panther_gazebo => husarion_ugv_gazebo}/src/gui/EStop.qrc (100%) rename {panther_gazebo => husarion_ugv_gazebo}/src/gui/e_stop.cpp (94%) rename {panther_gazebo => husarion_ugv_gazebo}/src/led_strip.cpp (97%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/CHANGELOG.rst (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/CMakeLists.txt (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/CODE_STRUCTURE.md (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/README.md (98%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/cmake/SuperBuild.cmake (98%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/config/canopen_configuration.yaml (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/config/master.dcf (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/config/phidgets_spatial_parameters.yaml (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/config/roboteq_motor_controllers_v80_21a.eds (100%) rename panther_hardware_interfaces/panther_hardware_interfaces.xml => husarion_ugv_hardware_interfaces/husarion_ugv_hardware_interfaces.xml (57%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_imu_sensor/panther_imu_sensor.hpp (94%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/gpio/gpio_controller.hpp (95%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/gpio/gpio_driver.hpp (95%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/gpio/types.hpp (87%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/lynx_system.hpp (79%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/panther_system.hpp (79%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/canopen_manager.hpp (91%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/driver.hpp (91%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/lynx_robot_driver.hpp (75%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/panther_robot_driver.hpp (75%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/robot_driver.hpp (86%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/roboteq_data_converters.hpp (93%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/roboteq_driver.hpp (92%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/roboteq_error_filter.hpp (89%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/robot_driver/roboteq_robot_driver.hpp (86%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/system_e_stop.hpp (86%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/system_ros_interface.hpp (95%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/panther_system/ugv_system.hpp (88%) rename {panther_hardware_interfaces/include/panther_hardware_interfaces => husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces}/utils.hpp (89%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/package.xml (95%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_imu_sensor/panther_imu_sensor.cpp (98%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/gpio/gpio_controller.cpp (96%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/gpio/gpio_driver.cpp (95%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/lynx_system.cpp (92%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/panther_system.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/canopen_manager.cpp (92%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/lynx_robot_driver.cpp (85%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/panther_robot_driver.cpp (90%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/roboteq_data_converters.cpp (95%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/roboteq_driver.cpp (96%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/roboteq_error_filter.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/robot_driver/roboteq_robot_driver.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/system_e_stop.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/system_ros_interface.cpp (97%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/panther_system/ugv_system.cpp (97%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/src/utils.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/config/canopen_configuration.yaml (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/config/slave_1.bin (100%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/panther_imu_sensor/test_panther_imu_sensor.cpp (97%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/panther_system/gpio/test_gpio_controller.cpp (93%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/panther_system/gpio/test_gpio_driver.cpp (84%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/test_utils.cpp (86%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_canopen_manager.cpp (74%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp (58%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp (55%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp (86%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp (80%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp (87%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp (81%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/test_lynx_system.cpp (64%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/test_panther_system.cpp (59%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/test_system_ros_interface.cpp (87%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/unit/panther_system/test_ugv_system.cpp (90%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/fake_can_socket.hpp (86%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/mock_driver.hpp (63%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/mock_roboteq.hpp (95%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/panther_system_test_utils.hpp (92%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/system_test_utils.hpp (75%) rename {panther_hardware_interfaces => husarion_ugv_hardware_interfaces}/test/utils/test_constants.hpp (78%) rename {panther_lights => husarion_ugv_lights}/.docs/AUTONOMOUS_ACTION.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/BATTERY_STATE.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/CHARGING_BATTERY.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/CRITICAL_BATTERY.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/ERROR.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/E_STOP.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/GOAL_ACHIEVED.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/LOW_BATTERY.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/MANUAL_ACTION.webp (100%) rename {panther_lights => husarion_ugv_lights}/.docs/READY.webp (100%) rename {panther_lights => husarion_ugv_lights}/CHANGELOG.rst (100%) rename {panther_lights => husarion_ugv_lights}/CMakeLists.txt (86%) rename {panther_lights => husarion_ugv_lights}/CONFIGURATION.md (88%) rename {panther_lights => husarion_ugv_lights}/LIGHTS_API.md (92%) rename {panther_lights => husarion_ugv_lights}/README.md (81%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/battery_critical.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/battery_low.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/strip01_purple.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/strip01_red.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_blue.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_cyan.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_green.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_orange.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_purple.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_red.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/lynx/triangle01_yellow.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/battery_critical.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/battery_low.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/strip01_purple.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/strip01_red.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_blue.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_cyan.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_green.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_orange.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_purple.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_red.png (100%) rename {panther_lights => husarion_ugv_lights}/animations/panther/triangle01_yellow.png (100%) rename {panther_lights => husarion_ugv_lights}/config/lynx_animations.yaml (61%) rename {panther_lights => husarion_ugv_lights}/config/lynx_driver.yaml (100%) rename {panther_lights => husarion_ugv_lights}/config/panther_animations.yaml (60%) rename {panther_lights => husarion_ugv_lights}/config/panther_driver.yaml (100%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/animation/animation.hpp (91%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/animation/charging_animation.hpp (83%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/animation/image_animation.hpp (88%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/apa102.hpp (96%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/led_components/led_animations_queue.hpp (94%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/led_components/led_panel.hpp (85%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/led_components/led_segment.hpp (87%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/led_components/segment_converter.hpp (70%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/lights_controller_node.hpp (91%) rename {panther_lights/include/panther_lights => husarion_ugv_lights/include/husarion_ugv_lights}/lights_driver_node.hpp (94%) rename {panther_lights => husarion_ugv_lights}/launch/lights.launch.py (93%) rename {panther_lights => husarion_ugv_lights}/package.xml (88%) create mode 100644 husarion_ugv_lights/plugins.xml rename {panther_lights => husarion_ugv_lights}/src/animation/charging_animation.cpp (95%) rename {panther_lights => husarion_ugv_lights}/src/animation/image_animation.cpp (93%) rename {panther_lights => husarion_ugv_lights}/src/apa102.cpp (97%) rename {panther_lights => husarion_ugv_lights}/src/led_components/led_animations_queue.cpp (96%) rename {panther_lights => husarion_ugv_lights}/src/led_components/led_panel.cpp (93%) rename {panther_lights => husarion_ugv_lights}/src/led_components/led_segment.cpp (86%) rename {panther_lights => husarion_ugv_lights}/src/led_components/segment_converter.cpp (85%) rename {panther_lights => husarion_ugv_lights}/src/lights_controller_node.cpp (86%) rename {panther_lights => husarion_ugv_lights}/src/lights_driver_node.cpp (97%) rename {panther_lights => husarion_ugv_lights}/test/files/animation.png (100%) rename {panther_lights => husarion_ugv_lights}/test/integration/panther_lights.test.py (94%) rename {panther_lights => husarion_ugv_lights}/test/unit/animation/test_animation.cpp (98%) rename {panther_lights => husarion_ugv_lights}/test/unit/animation/test_charging_animation.cpp (97%) rename {panther_lights => husarion_ugv_lights}/test/unit/animation/test_image_animation.cpp (94%) rename {panther_lights => husarion_ugv_lights}/test/unit/led_components/test_led_animation.cpp (79%) rename {panther_lights => husarion_ugv_lights}/test/unit/led_components/test_led_animations_queue.cpp (66%) rename {panther_lights => husarion_ugv_lights}/test/unit/led_components/test_led_panel.cpp (93%) rename {panther_lights => husarion_ugv_lights}/test/unit/led_components/test_led_segment.cpp (57%) rename {panther_lights => husarion_ugv_lights}/test/unit/led_components/test_segment_converter.cpp (69%) rename {panther_lights => husarion_ugv_lights}/test/unit/test_apa102.cpp (97%) rename {panther_lights => husarion_ugv_lights}/test/unit/test_lights_controller_node.cpp (87%) rename {panther_lights => husarion_ugv_lights}/test/unit/test_lights_driver_node.cpp (95%) rename {panther_localization => husarion_ugv_localization}/CHANGELOG.rst (100%) rename {panther_controller => husarion_ugv_localization}/CMakeLists.txt (82%) rename {panther_localization => husarion_ugv_localization}/README.md (98%) rename {panther_localization => husarion_ugv_localization}/config/enu_localization.yaml (99%) rename {panther_localization => husarion_ugv_localization}/config/enu_localization_with_gps.yaml (99%) rename {panther_localization => husarion_ugv_localization}/config/nmea_navsat_params.yaml (100%) rename {panther_localization => husarion_ugv_localization}/config/relative_localization.yaml (99%) rename {panther_localization => husarion_ugv_localization}/config/relative_localization_with_gps.yaml (99%) rename {panther_localization => husarion_ugv_localization}/launch/localization.launch.py (96%) rename {panther_localization => husarion_ugv_localization}/launch/nmea_navsat.launch.py (96%) rename {panther_localization => husarion_ugv_localization}/package.xml (87%) rename {panther_manager => husarion_ugv_manager}/CHANGELOG.rst (100%) rename {panther_manager => husarion_ugv_manager}/CMakeLists.txt (95%) rename {panther_manager => husarion_ugv_manager}/CONFIGURATION.md (96%) rename {panther_manager => husarion_ugv_manager}/README.md (95%) rename {panther_manager => husarion_ugv_manager}/behavior_trees/PantherLightsBT.btproj (100%) rename {panther_manager => husarion_ugv_manager}/behavior_trees/PantherSafetyBT.btproj (100%) rename {panther_manager => husarion_ugv_manager}/behavior_trees/lights.xml (100%) rename {panther_manager => husarion_ugv_manager}/behavior_trees/safety.xml (100%) rename {panther_manager => husarion_ugv_manager}/behavior_trees/shutdown.xml (100%) rename {panther_manager => husarion_ugv_manager}/config/lights_manager.yaml (100%) rename {panther_manager => husarion_ugv_manager}/config/safety_manager.yaml (100%) rename {panther_manager => husarion_ugv_manager}/config/shutdown_hosts.yaml (100%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/behavior_tree_manager.hpp (92%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/behavior_tree_utils.hpp (89%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/lights_manager_node.hpp (84%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/call_set_bool_service_node.hpp (81%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/call_set_led_animation_service_node.hpp (82%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/call_trigger_service_node.hpp (81%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/shutdown_hosts_from_file_node.hpp (71%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/shutdown_single_host_node.hpp (78%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/action/signal_shutdown_node.hpp (79%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/decorator/tick_after_timeout_node.hpp (80%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/shutdown_host.hpp (96%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/plugins/shutdown_hosts_node.hpp (93%) rename {panther_manager/include/panther_manager => husarion_ugv_manager/include/husarion_ugv_manager}/safety_manager_node.hpp (84%) rename {panther_manager => husarion_ugv_manager}/launch/manager.launch.py (86%) rename {panther_manager => husarion_ugv_manager}/package.xml (92%) rename {panther_manager => husarion_ugv_manager}/src/behavior_tree_manager.cpp (94%) rename {panther_manager => husarion_ugv_manager}/src/lights_manager_node.cpp (94%) rename {panther_manager => husarion_ugv_manager}/src/lights_manager_node_main.cpp (86%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/call_set_bool_service_node.cpp (84%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/call_set_led_animation_service_node.cpp (86%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/call_trigger_service_node.cpp (83%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/shutdown_hosts_from_file_node.cpp (71%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/shutdown_single_host_node.cpp (86%) rename {panther_manager => husarion_ugv_manager}/src/plugins/action/signal_shutdown_node.cpp (83%) rename {panther_manager => husarion_ugv_manager}/src/plugins/decorator/tick_after_timeout_node.cpp (87%) rename {panther_manager => husarion_ugv_manager}/src/safety_manager_node.cpp (94%) rename {panther_manager => husarion_ugv_manager}/src/safety_manager_node_main.cpp (86%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_call_set_bool_service_node.cpp (85%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_call_set_led_animation_service_node.cpp (86%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_call_trigger_service_node.cpp (84%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_shutdown_hosts_from_file_node.cpp (77%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_shutdown_single_host_node.cpp (81%) rename {panther_manager => husarion_ugv_manager}/test/plugins/action/test_signal_shutdown_node.cpp (85%) rename {panther_manager => husarion_ugv_manager}/test/plugins/decorator/test_tick_after_timeout_node.cpp (89%) rename {panther_manager => husarion_ugv_manager}/test/plugins/test_shutdown_host.cpp (64%) rename {panther_manager => husarion_ugv_manager}/test/plugins/test_shutdown_hosts_node.cpp (63%) rename {panther_manager => husarion_ugv_manager}/test/test_behavior_tree_manager.cpp (91%) rename {panther_manager => husarion_ugv_manager}/test/test_behavior_tree_utils.cpp (90%) rename {panther_manager => husarion_ugv_manager}/test/test_lights_behavior_tree.cpp (98%) rename {panther_manager => husarion_ugv_manager}/test/test_lights_manager_node.cpp (94%) rename {panther_manager => husarion_ugv_manager}/test/test_safety_behavior_tree.cpp (98%) rename {panther_manager => husarion_ugv_manager}/test/test_safety_manager_node.cpp (94%) rename {panther_manager => husarion_ugv_manager}/test/utils/behavior_tree_test_utils.hpp (88%) rename {panther_manager => husarion_ugv_manager}/test/utils/plugin_test_utils.hpp (80%) rename {panther_utils => husarion_ugv_utils}/CHANGELOG.rst (100%) rename {panther_utils => husarion_ugv_utils}/CMakeLists.txt (99%) rename {panther_utils => husarion_ugv_utils}/README.md (52%) rename {panther_utils/panther_utils => husarion_ugv_utils/husarion_ugv_utils}/__init__.py (100%) rename {panther_utils/panther_utils => husarion_ugv_utils/husarion_ugv_utils}/integration_test_utils.py (100%) rename {panther_utils/panther_utils => husarion_ugv_utils/husarion_ugv_utils}/messages.py (100%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/common_utilities.hpp (93%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/configure_rt.hpp (87%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/diagnostics.hpp (88%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/moving_average.hpp (86%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/ros_utils.hpp (94%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/test/ros_test_utils.hpp (93%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/test/test_utils.hpp (90%) rename {panther_utils/include/panther_utils => husarion_ugv_utils/include/husarion_ugv_utils}/yaml_utils.hpp (91%) rename {panther_utils => husarion_ugv_utils}/package.xml (97%) rename {panther_utils => husarion_ugv_utils}/test/test_common_utilities.cpp (67%) rename {panther_utils => husarion_ugv_utils}/test/test_diagnostics.cpp (84%) rename {panther_utils => husarion_ugv_utils}/test/test_moving_average.cpp (80%) rename {panther_utils => husarion_ugv_utils}/test/test_ros_test_utils.cpp (84%) rename {panther_utils => husarion_ugv_utils}/test/test_ros_utils.cpp (76%) rename {panther_utils => husarion_ugv_utils}/test/test_test_utils.cpp (66%) rename {panther_utils => husarion_ugv_utils}/test/test_yaml_utils.cpp (53%) delete mode 100644 panther/README.md delete mode 100644 panther_controller/CONFIGURATION.md delete mode 100644 panther_lights/plugins.xml diff --git a/.docs/panther_ros2_api.drawio.svg b/.docs/panther_ros2_api.drawio.svg deleted file mode 100644 index 19f5bf61..00000000 --- a/.docs/panther_ros2_api.drawio.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
panther_localization
panther_localization
panther_controller
panther_controller
panther_lights
panther_lights
panther_hardware_interfaces
panther_hardware_interfaces
panther_battery
panther_battery
panther_manager
panther_manager
panther_diagnostics
panther_diagnostics
PantherSystem
PantherSystem
hardware_controller
hardware_controller
GPIOController
GPIOController
MotorsController
MotorsController
CANopenController
CANopenController
RoboteqDriver
RoboteqDriver
CAN
CAN
EStopManager
EStopManager
battery_driver
battery_driver
RPi GPIO
RPi GPIO
ADC
ADC
imu_broadcaster
imu_broadcaster
joint_state_broadcaster
joint_state_broadcaster
drive_controller
drive_controller
controller_manager
controller_manager
PantherImuSensor

PantherImuSensor
IMU
IMU
ekf_filter
ekf_filter
ImuFilter
ImuFilter
Spatial
Spatial
imu/data
imu/data
odometry/wheels
odometry/wheels
odometry/filtered
odometry/filtered
joint_states
joint_states
cmd_vel
cmd_vel
dynamic_joint_states
dynamic_joint_states
 hardware/e_stop
 hardware/e_stop
hardware/robot_driver_state
hardware/robot_driver_state
 hardware/io_state
 hardware/io_state
hardware/e_stop_trigger
hardware/e_stop_trigger
hardware/e_stop_reset
hardware/e_stop_reset
hardware/<hw_component>_enable
hardware/<hw_component>_enable
robot_state_publisher
robot_state_publisher
robot_description
robot_description
/tf
/tf
/tf_static
/tf_static
/tf
/tf
battery/battery_status
battery/battery_status
Bumper Lights
Bumper Lights
lights_driver
lights_driver
lights_controller
lights_controller
lights/channel_1_frame
lights/channel_1_frame
lights/channel_2_frame
lights/channel_2_frame
lights/set_animation
lights/set_animation
lights/set_brightness
lights/set_brightness
safety_manager
safety_manager
system_monitor
system_monitor
system_status
system_status
lights_manager
lights_manager
hardware/led_control_enable
hardware/led_control_enable
/tf
/tf
battery/charging_status
battery/charging_status
GPIODriver
GPIODriver
diagnostics
diagnostics
diagnostics
diagnostics
diagnostics
diagnostics

diagnostics
diagnostics
Legend:
Legend:
Nodes
Nodes
Plugin
Plugin
Objects
Objects
Topics
Topics
Services
Services
Data Transfer
Data Trans...
Text is not SVG - cannot display
diff --git a/.docs/ros2_system_design.drawio.svg b/.docs/ros2_system_design.drawio.svg new file mode 100644 index 00000000..ee8bfd80 --- /dev/null +++ b/.docs/ros2_system_design.drawio.svg @@ -0,0 +1,4 @@ + + + +
husarion_ugv_localization
husarion_ugv_localization
husarion_ugv_controller
husarion_ugv_controller
husarion_ugv_lights
husarion_ugv_lights
husarion_ugv_hardware_interfaces
husarion_ugv_hardware_interfaces
husarion_ugv_battery
husarion_ugv_battery
husarion_ugv_manager
husarion_ugv_manager
husarion_ugv_diagnostics
husarion_ugv_diagnostics
HusarionUGVSystem
HusarionUGVSystem
hardware_controller
hardware_controller
GPIOController
GPIOController
MotorsController
MotorsController
CANopenController
CANopenController
RoboteqDriver
RoboteqDriver
CAN
CAN
EStopManager
EStopManager
battery_driver
battery_driver
RPi GPIO
RPi GPIO
ADC
ADC
imu_broadcaster
imu_broadcaster
joint_state_broadcaster
joint_state_broadcaster
drive_controller
drive_controller
controller_manager
controller_manager
HusarionUGVImuSensor

HusarionUGVImuSensor
IMU
IMU
ekf_filter
ekf_filter
ImuFilter
ImuFilter
Spatial
Spatial
imu/data
imu/data
odometry/wheels
odometry/wheels
odometry/filtered
odometry/filtered
joint_states
joint_states
cmd_vel
cmd_vel
dynamic_joint_states
dynamic_joint_states
 hardware/e_stop
 hardware/e_stop
hardware/robot_driver_state
hardware/robot_driver_state
 hardware/io_state
 hardware/io_state
hardware/e_stop_trigger
hardware/e_stop_trigger
hardware/e_stop_reset
hardware/e_stop_reset
hardware/<hw_component>_enable
hardware/<hw_component>_enable
robot_state_publisher
robot_state_publisher
robot_description
robot_description
/tf
/tf
/tf_static
/tf_static
/tf
/tf
battery/battery_status
battery/battery_status
Bumper Lights
Bumper Lights
lights_driver
lights_driver
lights_controller
lights_controller
lights/channel_1_frame
lights/channel_1_frame
lights/channel_2_frame
lights/channel_2_frame
lights/set_animation
lights/set_animation
lights/set_brightness
lights/set_brightness
safety_manager
safety_manager
system_monitor
system_monitor
system_status
system_status
lights_manager
lights_manager
hardware/led_control_enable
hardware/led_control_enable
/tf
/tf
battery/charging_status
battery/charging_status
GPIODriver
GPIODriver
diagnostics
diagnostics
diagnostics
diagnostics
diagnostics
diagnostics

diagnostics
diagnostics
Legend:
Legend:
Nodes
Nodes
Plugin
Plugin
Objects
Objects
Topics
Topics
Services
Services
Data Transfer
Data Trans...
Text is not SVG - cannot display
diff --git a/.github/workflows/release-project.yaml b/.github/workflows/release-project.yaml index 47800b4f..8bdbcade 100644 --- a/.github/workflows/release-project.yaml +++ b/.github/workflows/release-project.yaml @@ -1,5 +1,5 @@ --- -name: Release Panther project +name: Release project on: workflow_dispatch: diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/run-unit-tests.yaml index 6d7d4878..48c1ebf6 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/run-unit-tests.yaml @@ -1,5 +1,5 @@ --- -name: Run panther unit tests +name: Run unit tests on: workflow_dispatch: @@ -28,12 +28,12 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.ref }} - path: ros2_ws/src/panther_ros + path: ros2_ws/src/husarion_ugv - name: Resolve dependencies working-directory: ros2_ws run: | - vcs import < src/panther_ros/panther/panther_hardware.repos src + vcs import < src/husarion_ugv/husarion_ugv/hardware_deps.repos src sudo apt update rosdep update --rosdistro $ROS_DISTRO rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y @@ -43,15 +43,15 @@ jobs: run: | source /opt/ros/$ROS_DISTRO/setup.bash if [ -f install/setup.bash ]; then source install/setup.bash; fi - colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to panther --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' + colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to husarion_ugv --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' - name: Test working-directory: ros2_ws run: | source install/setup.bash - colcon test --packages-up-to panther --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure + colcon test --packages-up-to husarion_ugv --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure echo "result=$?" >> ${{ runner.temp }}/${{ env.TEST_RESULT_FILENAME }} - colcon lcov-result --packages-up-to panther --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} + colcon lcov-result --packages-up-to husarion_ugv --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} lines_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'lines' | head -1) functions_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'functions' | head -1) branches_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'branches' | head -1) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c426d210..a685e4f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: entry: codespell args: [ - "--exclude-file=panther_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds", + "--exclude-file=husarion_ugv_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds", "--ignore-words-list", "ned" # north, east, down (NED) ] diff --git a/README.md b/README.md index 2732851c..7abaf603 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# panther_ros +# husarion_ugv -ROS 2 packages for Panther autonomous mobile robot +ROS 2 packages for Husarion UGV (Unmanned Ground Vehicle). The repository is a collection of necessary packages enabling the launch of the Lynx and Panther robots. [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) @@ -16,7 +16,7 @@ ROS 2 packages for Panther autonomous mobile robot ```bash mkdir ~/husarion_ws cd ~/husarion_ws -git clone -b ros2 https://github.com/husarion/panther_ros.git src/panther_ros +git clone -b ros2 https://github.com/husarion/panther_ros.git src/husarion_ugv ``` ### Configure environment @@ -38,7 +38,7 @@ export HUSARION_ROS_BUILD_TYPE=simulation ### Build ``` bash -vcs import src < src/panther_ros/panther/panther_$HUSARION_ROS_BUILD_TYPE.repos +vcs import src < src/husarion_ugv/husarion_ugv/${HUSARION_ROS_BUILD_TYPE}_deps.repos cp -r src/ros2_controllers/diff_drive_controller src cp -r src/ros2_controllers/imu_sensor_broadcaster src @@ -49,26 +49,26 @@ rosdep update --rosdistro $ROS_DISTRO rosdep install --from-paths src -y -i source /opt/ros/$ROS_DISTRO/setup.bash -colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release +colcon build --symlink-install --packages-up-to husarion_ugv --cmake-args -DCMAKE_BUILD_TYPE=Release source install/setup.bash ``` >[!NOTE] -> To build code on a real robot you need to run above commands on the Panther Built-in Computer. +> To build code on a real robot you need to run above commands on the robot Built-in Computer. ### Running Real robot: ```bash -ros2 launch panther_bringup bringup.launch.py +ros2 launch husarion_ugv_bringup bringup.launch.py ``` Simulation: ```bash -ros2 launch panther_gazebo simulation.launch.py +ros2 launch husarion_ugv_gazebo simulation.launch.py ``` > [!IMPORTANT] @@ -87,26 +87,26 @@ Launch arguments are largely common to both simulation and physical robot. Howev | --- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 🖥️ | `add_wheel_joints` | Flag enabling joint_state_publisher to publish information about the wheel position. Should be false when there is a controller that sends this information.
***bool:*** `False` | | 🖥️ | `add_world_transform` | Adds a world frame that connects the tf trees of individual robots (useful when running multiple robots).
***bool:*** `False` | -| 🤖🖥️ | `animations_config_path` | Path to a YAML file with a description of led configuration. This file includes definition of robot panels, virtual segments and default animations.
***string:*** [`{robot_model}_animations.yaml`](./panther_lights/config) | +| 🤖🖥️ | `animations_config_path` | Path to a YAML file with a description of led configuration. This file includes definition of robot panels, virtual segments and default animations.
***string:*** [`{robot_model}_animations.yaml`](./husarion_ugv_lights/config) | | 🖥️ | `battery_config_path` | Path to the Ignition LinearBatteryPlugin configuration file. This configuration is intended for use in simulations only.
***string:*** `None` | -| 🤖🖥️ | `components_config_path` | Additional components configuration file. Components described in this file are dynamically included in Panther's urdf. Panther options are described in [the manual](https://husarion.com/manuals/panther/panther-options).
***string:*** [`components.yaml`](./panther_description/config/components.yaml) | -| 🤖🖥️ | `controller_config_path` | Path to controller configuration file. A path to custom configuration can be specified here.
***string:*** [`{wheel_type}_controller.yaml`](./panther_controller/config/) | +| 🤖🖥️ | `components_config_path` | Additional components configuration file. Components described in this file are dynamically included in robot's URDF. Available options are described in [the manual](https://husarion.com/manuals/panther/panther-options).
***string:*** [`components.yaml`](./panther_description/config/components.yaml) | +| 🤖🖥️ | `controller_config_path` | Path to controller configuration file. A path to custom configuration can be specified here.
***string:*** [`{wheel_type}_controller.yaml`](./husarion_ugv_controller/config/) | | 🤖 | `disable_manager` | Enable or disable manager_bt_node.
***bool:*** `False` | | 🤖🖥️ | `fuse_gps` | Include GPS for data fusion.
***bool:*** `False` | -| 🖥️ | `gz_bridge_config_path` | Path to the parameter_bridge configuration file.
***string:*** [`gz_bridge.yaml`](./panther_gazebo/config/gz_bridge.yaml) | +| 🖥️ | `gz_bridge_config_path` | Path to the parameter_bridge configuration file.
***string:*** [`gz_bridge.yaml`](./husarion_ugv_gazebo/config/gz_bridge.yaml) | | 🖥️ | `gz_gui` | Run simulation with specific GUI layout.
***string:*** [`teleop.config`](https://github.com/husarion/husarion_gz_worlds/blob/main/config/teleop.config) | | 🖥️ | `gz_headless_mode` | Run the simulation in headless mode. Useful when a GUI is not needed or to reduce the number of calculations.
***bool:*** `False` | | 🖥️ | `gz_log_level` | Adjust the level of console output.
***int:*** `1` (choices: `0`, `1`, `2`, `3`, `4`) | | 🖥️ | `gz_world` | Absolute path to SDF world file.
***string:*** [`husarion_world.sdf`](https://github.com/husarion/husarion_gz_worlds/blob/main/worlds/husarion_world.sdf) | | 🤖 | `launch_nmea_gps` | Whether to launch the NMEA NavSat driver node. Advisable when the robot is equipped with the [ANT02](https://husarion.com/manuals/panther/panther-options/#ant02---wi-fi--lte--gps).
***bool:*** `False` | -| 🤖🖥️ | `lights_bt_project_path` | Path to BehaviorTree project file, responsible for lights management.
***string:*** [`PantherLightsBT.btproj`](./panther_manager/behavior_trees/PantherLightsBT.btproj) | -| 🤖🖥️ | `localization_config_path` | Specify the path to the localization configuration file.
***string:*** [`relative_localization.yaml`](./panther_localization/config/relative_localization.yaml) | +| 🤖🖥️ | `lights_bt_project_path` | Path to BehaviorTree project file, responsible for lights management.
***string:*** [`PantherLightsBT.btproj`](./husarion_ugv_manager/behavior_trees/PantherLightsBT.btproj) | +| 🤖🖥️ | `localization_config_path` | Specify the path to the localization configuration file.
***string:*** [`relative_localization.yaml`](./husarion_ugv_localization/config/relative_localization.yaml) | | 🤖🖥️ | `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 Panther robot description.
***bool:*** `True` | -| 🖥️ | `robot_model` | Specify robot model type.
***string:*** `env(ROBOT_MODEL)` if not specified `panther` (choices: `lynx`, `panther`) | -| 🤖🖥️ | `safety_bt_project_path` | Path to BehaviorTree project file, responsible for safety and shutdown management.
***string:*** [`PantherSafetyBT.btproj`](./panther_manager/behavior_trees/PantherSafetyBT.btproj) | -| 🤖🖥️ | `shutdown_hosts_config_path` | Path to file with list of hosts to request shutdown.
***string:*** [`shutdown_hosts.yaml`](./panther_manager/config/shutdown_hosts.yaml) | +| 🤖🖥️ | `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`) | +| 🤖🖥️ | `safety_bt_project_path` | Path to BehaviorTree project file, responsible for safety and shutdown management.
***string:*** [`PantherSafetyBT.btproj`](./husarion_ugv_manager/behavior_trees/PantherSafetyBT.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` | | 🤖🖥️ | `use_sim` | Whether simulation is used.
***bool:*** `False` | | 🤖🖥️ | `user_led_animations_path` | Path to a YAML file with a description of the user-defined animations.
***string:*** `''` | @@ -121,7 +121,7 @@ Launch arguments are largely common to both simulation and physical robot. Howev > [!TIP] > -> To read the arguments for individual packages, add the `-s` flag to the `ros2 launch` command (e.g. `ros2 launch panther_bringup bringup.launch.py ​​-s`) +> To read the arguments for individual packages, add the `-s` flag to the `ros2 launch` command (e.g. `ros2 launch husarion_ugv_bringup bringup.launch.py ​​-s`) ## Developer Info diff --git a/ROS_API.md b/ROS_API.md index e7fb79a6..322e025d 100644 --- a/ROS_API.md +++ b/ROS_API.md @@ -3,7 +3,7 @@ > [!IMPORTANT] > **Beta Release** > -> Please be advised that the software you are about to use is a Beta version of the ROS 2 Driver for Panther. It is functional, and the architecture will not change significantly. Although it has been tested by the Husarion team, some stability issues and bugs may still occur. +> Please be advised that the software you are about to use is a Beta version of the ROS 2 Driver for Lynx and Panther. It is functional, and the architecture will not change significantly. Although it has been tested by the Husarion team, some stability issues and bugs may still occur. > > We would greatly appreciate your feedback regarding the Panther ROS 2 driver. You can reach us in the following ways: > @@ -13,20 +13,20 @@ ## ROS 2 System Design -This section describes the ROS packages in the Panther ROS system. These packages are located in the [panther_ros](https://github.com/husarion/panther_ros) GitHub repository. +This section describes the ROS packages used in Husarion UGV robots. These packages are located in the [panther_ros](https://github.com/husarion/panther_ros) GitHub repository. > [!NOTE] -> **Differences in ROS System** +> **Hardware Compatibility** > -> ROS 2 nodes differs slightly between **Panther v1.06** and **Panther v1.2+**. This is caused by internal hardware differences. Despite that, the ROS API was kept as closely matched between those revisions as possible and should be transparent in most of the use cases. +> This package supports **Lynx v0.2**, **Panther v1.2+**. This is caused by internal hardware differences. Despite that, the ROS API was kept as closely matched between those revisions as possible and should be transparent in most of the use cases. -The default way to communicate with Panther's hardware is via the Robot Operating System (ROS). All the drivers were written in ROS 2 framework. The ROS API is provided by ROS packages found in the GitHub repository [husarion/panther_ros](https://github.com/husarion/panther_ros). These packages are responsible for accessing the hardware components of the robot. +The default way to communicate with our robots is via the Robot Operating System (ROS). All the drivers were written in ROS 2 framework. The ROS API is provided by ROS packages found in the GitHub repository [husarion/panther_ros](https://github.com/husarion/panther_ros). These packages are responsible for accessing the hardware components of the robot. -The graph below represents Panther's ROS system. Some topics and services have been excluded from the graph for the sake of clarity. +The graph below represents Husarion UVG ROS system. Some topics and services have been excluded from the graph for the sake of clarity. -![Panther ROS 2 API Diagram](.docs/panther_ros2_api.drawio.svg) +![Husarion UVG ROS 2 System Design Diagram](.docs/ros2_system_design.drawio.svg) ## ROS Interfaces @@ -42,31 +42,31 @@ Below is information about the physical robot API. For the simulation, topics an | | Node name | Description | | --- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 🤖 | `battery_driver` | Publishes battery state read from ADC unit for Panther version 1.2 and above, or based on Roboteq motor controllers' data for earlier versions of the robot.
[*panther_batter/battery_driver_node*](./panther_battery/include/panther_battery/battery_driver_node.hpp) | +| 🤖 | `battery_driver` | Publishes battery state read from ADC unit.
[*panther_batter/battery_driver_node*](./husarion_ugv_battery/include/husarion_ugv_battery/battery_driver_node.hpp) | | 🤖🖥️ | `controller_manager` | The Controller Manager performs two main functions. First, it manages controllers and their required interfaces, handling tasks like loading, activating, deactivating, and unloading. Second, it interacts with hardware components, ensuring access to their interfaces. This node manages the: `imu_broadcaster`, `joint_state_broadcaster`, `drive_controller`.
*[controller_manager/controller_manager](https://github.com/ros-controls/ros2_control/blob/master/controller_manager)* | | 🤖🖥️ | `drive_controller` | Manages mobile robots with a differential or mecanum drive depending on the configuration. It converts velocity commands for the robot body into wheel commands for the base. It also calculates odometry from hardware feedback and shares it.
*[diff_drive_controller/diff_drive_controller](https://github.com/ros-controls/ros2_controllers/tree/master/diff_drive_controller) or [mecanum_drive_controller/mecanum_drive_controller](https://github.com/husarion/husarion_controllers/tree/main/mecanum_drive_controller)* | | 🤖🖥️ | `ekf_filter` | The Extended Kalman Filter node is designed to fuse odometry data from various sources, including wheel encoders, IMU, and GPS.
*[robot_localization/ekf_filter](https://github.com/cra-ros-pkg/robot_localization)* | -| 🤖 | `hardware_controller` | Plugin responsible for communicating with engine controllers via the CAN bus and providing E-Stop functionalities.
*[panther_hardware_interfaces/PantherSystem](./panther_hardware_interfaces/src/panther_system/)* | +| 🤖 | `hardware_controller` | Plugin responsible for communicating with engine controllers via the CAN bus and providing E-Stop functionalities.
*[husarion_ugv_hardware_interfaces/{robot_model}System](./husarion_ugv_hardware_interfaces/src/panther_system/)* | | 🤖 | `gps` | Node responsible for parsing NMEA strings and publishing standard ROS NavSat message types.
*[nmea_navsat_driver/nmea_navsat_driver](https://github.com/ros-drivers/nmea_navsat_driver/tree/ros2/src/libnmea_navsat_driver)* | | 🖥️ | `gz_ros2_control` | Responsible for integrating the ros2_control controller architecture with the Gazebo simulator.
[gz_ros2_control/gz_ros2_control](https://github.com/ros-controls/gz_ros2_control/tree/master/gz_ros2_control/src) | -| 🖥️ | `gz_estop_gui` | The node is part of the Gazebo GUI plugin, enabling easy E-stop state modifications directly within the simulation.
[panther_gazebo/EStop](./panther_gazebo/src/gui/e_stop.cpp) | +| 🖥️ | `gz_estop_gui` | The node is part of the Gazebo GUI plugin, enabling easy E-stop state modifications directly within the simulation.
[husarion_ugv_gazebo/EStop](./husarion_ugv_gazebo/src/gui/e_stop.cpp) | | 🤖🖥️ | `imu_broadcaster` | Publishes readings of IMU sensors.
*[imu_sensor_broadcaster/imu_sensor_broadcaster](https://github.com/ros-controls/ros2_controllers/tree/master/imu_sensor_broadcaster)* | | 🤖🖥️ | `joint_state_broadcaster` | Reads all state interfaces and reports them on specific topics.
*[joint_state_broadcaster/joint_state_broadcaster](https://github.com/ros-controls/ros2_controllers/tree/master/joint_state_broadcaster)* | | 🤖🖥️ | `lights_container` | Node for managing ROS components. This node manages: `lights_controller`, `lights_driver`.
[*rclcpp_components/component_container*](https://github.com/ros2/rclcpp/tree/rolling/rclcpp_components) | -| 🤖🖥️ | `lights_controller` | This node is responsible for processing animations and publishing frames to be displayed on the Husarion Panther robot Bumper Lights.
[*panther_lights/LightsControllerNode*](./panther_lights/include/panther_lights/lights_controller_node.hpp) | -| 🤖 | `lights_driver` | This node is responsible for displaying frames on the Husarion Panther robot's Bumper Lights.
[*panther_lights/LightsDriverNode*](./panther_lights/include/panther_lights/lights_driver_node.hpp) | -| 🤖🖥️ | `lights_manager` | Node responsible for managing Bumper Lights animation scheduling.
[panther_manager/lights_manager](./panther_manager/include/panther_manager/lights_manager_node.hpp) | +| 🤖🖥️ | `lights_controller` | This node is responsible for processing animations and publishing frames to `light_driver` node.
[*husarion_ugv_lights/LightsControllerNode*](./husarion_ugv_lights/include/husarion_ugv_lights/lights_controller_node.hpp) | +| 🤖 | `lights_driver` | This node is responsible for displaying frames on the robot's lights.
[*husarion_ugv_lights/LightsDriverNode*](./husarion_ugv_lights/include/husarion_ugv_lights/lights_driver_node.hpp) | +| 🤖🖥️ | `lights_manager` | Node responsible for managing lights animation scheduling.
[husarion_ugv_manager/lights_manager](./husarion_ugv_manager/include/husarion_ugv_manager/lights_manager_node.hpp) | | 🤖🖥️⚙️ | `navsat_transform` | It converts raw GPS data into odometry data and publishes corrected GPS positions based on sensor data at a higher frequency.
*[robot_localization/navsat_transform](https://github.com/cra-ros-pkg/robot_localization)* | -| 🖥️ | `panther_base_gz_bridge` | Convert and transmit data between ROS and Gazebo
*[ros_gz_bridge/parameter_bridge](https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_bridge)* | +| 🖥️ | `base_gz_bridge` | Convert and transmit data between ROS and Gazebo
*[ros_gz_bridge/parameter_bridge](https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_bridge)* | | 🤖🖥️ | `robot_state_publisher` | Broadcasts a robot's state to tf2 using a provided URDF model and joint states. It updates the model and broadcasts poses for fixed and movable joints to tf2 topics.
*[robot_state_publisher/robot_state_publisher](https://github.com/ros/robot_state_publisher)* | -| 🤖 | `safety_manager` | Node responsible for managing safety features, and software shutdown of components.
*[panther_manager/safety_manager_node](./panther_manager/include/panther_manager/safety_manager_node.hpp)* | -| 🤖 | `system_monitor` | Publishes system state of the Built-in Computer such as CPU usage, RAM memory usage, disk usage and CPU temperature.
*[panther_diagnostic/system_monitor_node](./panther_diagnostics/include/panther_diagnostics/system_monitor_node.hpp)* | +| 🤖 | `safety_manager` | Node responsible for managing safety features, and software shutdown of components.
*[husarion_ugv_manager/safety_manager_node](./husarion_ugv_manager/include/husarion_ugv_manager/safety_manager_node.hpp)* | +| 🤖 | `system_monitor` | Publishes system state of the Built-in Computer such as CPU usage, RAM memory usage, disk usage and CPU temperature.
*[husarion_ugv_diagnostics/system_monitor_node](./husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/system_monitor_node.hpp)* | ### Topics | | Topic | Description | | --- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 🤖🖥️ | `battery/battery_status` | Mean values of both batteries if Panther has two batteries. Otherwise, the state of the single battery will be published.
[*sensor_msgs/BatteryState*](https://docs.ros2.org/latest/api/sensor_msgs/msg/BatteryState.html) | +| 🤖🖥️ | `battery/battery_status` | Mean values of both batteries will be published if the robot has two batteries. Otherwise, the state of the single battery will be published.
[*sensor_msgs/BatteryState*](https://docs.ros2.org/latest/api/sensor_msgs/msg/BatteryState.html) | | 🤖 | `battery/charging_status` | Battery charging status value.
[*panther_msgs/ChargingStatus*](https://github.com/husarion/panther_msgs) | | 🤖🖥️ | `cmd_vel` | Command velocity value.
[*geometry_msgs/Twist*](https://docs.ros2.org/latest/api/geometry_msgs/msg/Twist.html) | | 🤖🖥️ | `diagnostics` | Diagnostic data.
[*diagnostic_msgs/DiagnosticArray*](https://docs.ros2.org/latest/api/diagnostic_msgs/msg/DiagnosticArray.html) | diff --git a/panther/CHANGELOG.rst b/husarion_ugv/CHANGELOG.rst similarity index 100% rename from panther/CHANGELOG.rst rename to husarion_ugv/CHANGELOG.rst diff --git a/panther/CMakeLists.txt b/husarion_ugv/CMakeLists.txt similarity index 80% rename from panther/CMakeLists.txt rename to husarion_ugv/CMakeLists.txt index 626fc36a..2c2d0e25 100644 --- a/panther/CMakeLists.txt +++ b/husarion_ugv/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther) +project(husarion_ugv) find_package(ament_cmake REQUIRED) diff --git a/husarion_ugv/README.md b/husarion_ugv/README.md new file mode 100644 index 00000000..bc079c16 --- /dev/null +++ b/husarion_ugv/README.md @@ -0,0 +1,3 @@ +# husarion_ugv + +ROS 2 Metapackage composing basic functionalities of the Husarion UGV robot with VCS Tool yaml files directing to external robot dependencies. diff --git a/panther/panther_hardware.repos b/husarion_ugv/hardware_deps.repos similarity index 100% rename from panther/panther_hardware.repos rename to husarion_ugv/hardware_deps.repos diff --git a/panther/package.xml b/husarion_ugv/package.xml similarity index 71% rename from panther/package.xml rename to husarion_ugv/package.xml index f849f567..e426e387 100644 --- a/panther/package.xml +++ b/husarion_ugv/package.xml @@ -1,9 +1,9 @@ - panther + husarion_ugv 2.1.1 - Meta package that contains all packages of Panther + Meta package that contains all packages of Husarion UGV (Unmanned Ground Vehicle) Husarion Apache License 2.0 @@ -15,8 +15,8 @@ ament_cmake - panther_bringup - panther_gazebo + husarion_ugv_bringup + husarion_ugv_gazebo ament_cmake diff --git a/panther/panther_simulation.repos b/husarion_ugv/simulation_deps.repos similarity index 100% rename from panther/panther_simulation.repos rename to husarion_ugv/simulation_deps.repos diff --git a/panther_battery/CHANGELOG.rst b/husarion_ugv_battery/CHANGELOG.rst similarity index 100% rename from panther_battery/CHANGELOG.rst rename to husarion_ugv_battery/CHANGELOG.rst diff --git a/panther_battery/CMakeLists.txt b/husarion_ugv_battery/CMakeLists.txt similarity index 97% rename from panther_battery/CMakeLists.txt rename to husarion_ugv_battery/CMakeLists.txt index 4e12bab8..d928de57 100644 --- a/panther_battery/CMakeLists.txt +++ b/husarion_ugv_battery/CMakeLists.txt @@ -1,18 +1,18 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_battery) +project(husarion_ugv_battery) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() set(PACKAGE_DEPENDENCIES ament_cmake diagnostic_updater panther_msgs - panther_utils rclcpp sensor_msgs) + husarion_ugv_utils rclcpp sensor_msgs) foreach(PACKAGE IN ITEMS ${PACKAGE_DEPENDENCIES}) find_package(${PACKAGE} REQUIRED) endforeach() -include_directories(include ${panther_utils_INCLUDE_DIRS}) +include_directories(include ${husarion_ugv_utils_INCLUDE_DIRS}) add_executable( battery_driver_node diff --git a/panther_battery/README.md b/husarion_ugv_battery/README.md similarity index 75% rename from panther_battery/README.md rename to husarion_ugv_battery/README.md index d591938d..1e2e0b84 100644 --- a/panther_battery/README.md +++ b/husarion_ugv_battery/README.md @@ -1,6 +1,6 @@ -# panther_battery +# husarion_ugv_battery -The package containing nodes monitoring and publishing the internal battery state of the Husarion Panther robot. +The package containing nodes monitoring and publishing the internal battery state of the Husarion UGV robots. ## Launch Files @@ -12,13 +12,13 @@ This package contains: ### battery_driver_node -Publishes battery state read from ADC unit for Panther version 1.2 and above, or based on Roboteq motor controllers' data for earlier.versions of the robot. +Publishes battery state read from ADC unit. #### Publishes - `_battery/battery_1_status_raw` [*sensor_msgs/BatteryState*]: First battery raw state. - `_battery/battery_2_status_raw` [*sensor_msgs/BatteryState*]: Second battery raw state. Published if second battery detected. -- `battery/battery_status` [*sensor_msgs/BatteryState*]: Mean values of both batteries if Panther has two batteries. Otherwise, the state of the single battery will be published. +- `battery/battery_status` [*sensor_msgs/BatteryState*]: Mean values of both batteries if robot has two batteries. Otherwise, the state of the single battery will be published. - `battery/charging_status` [*panther_msgs/ChargingStatus*]: Battery charging status. - `diagnostics` [*diagnostic_msgs/DiagnosticArray*]: Battery diagnostic messages. @@ -29,11 +29,11 @@ Publishes battery state read from ADC unit for Panther version 1.2 and above, or #### Parameters -- `~/adc/device0` [*string*, default: **/sys/bus/iio/devices/iio:device0**]: ADC nr 0 IIO device. Used with Panther version 1.2 and above. -- `~/adc/device1` [*string*, default: **/sys/bus/iio/devices/iio:device1**]: ADC nr 1 IIO device. Used with Panther version 1.2 and above. -- `~/adc/ma_window_len/charge` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery charge readings. Used with Panther version 1.2 and above. -- `~/adc/ma_window_len/temp` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery temperature readings. Used with Panther version 1.2 and above. +- `~/adc/device0` [*string*, default: **/sys/bus/iio/devices/iio:device0**]: ADC number 0 IIO device. +- `~/adc/device1` [*string*, default: **/sys/bus/iio/devices/iio:device1**]: ADC number 1 IIO device. +- `~/adc/ma_window_len/charge` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery charge readings. +- `~/adc/ma_window_len/temp` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery temperature readings. - `~/battery_timeout` [*float*, default: **1.0**]: Specifies the timeout in seconds. If the node fails to read battery data exceeding this duration, the node will publish an unknown battery state. - `~/ma_window_len/voltage` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery voltage readings. - `~/ma_window_len/current` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery current readings. -- `~/roboteq/driver_state_timeout` [*float*, default: **0.2**]: Specifies timeout in seconds after which driver state messages will be considered old. Used with Panther version 1.06 and earlier. +- `~/roboteq/driver_state_timeout` [*float*, default: **0.2**]: Specifies timeout in seconds after which driver state messages will be considered old (deprecated). diff --git a/panther_battery/include/panther_battery/adc_data_reader.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/adc_data_reader.hpp similarity index 90% rename from panther_battery/include/panther_battery/adc_data_reader.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/adc_data_reader.hpp index 08dca0d0..59e1fb57 100644 --- a/panther_battery/include/panther_battery/adc_data_reader.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/adc_data_reader.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_ADC_DATA_READER_HPP_ -#define PANTHER_BATTERY_ADC_DATA_READER_HPP_ +#ifndef HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_ +#define HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_ #include #include #include #include -namespace panther_battery +namespace husarion_ugv_battery { class ADCDataReader @@ -75,6 +75,6 @@ class ADCDataReader const std::filesystem::path device_path_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_ADC_DATA_READER_HPP_ +#endif // HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_ diff --git a/panther_battery/include/panther_battery/battery/adc_battery.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery/adc_battery.hpp similarity index 83% rename from panther_battery/include/panther_battery/battery/adc_battery.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery/adc_battery.hpp index 6aebfa09..94dd428d 100644 --- a/panther_battery/include/panther_battery/battery/adc_battery.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery/adc_battery.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_ -#define PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_ #include #include @@ -21,10 +21,10 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -namespace panther_battery +namespace husarion_ugv_battery { using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -89,12 +89,12 @@ class ADCBattery : public Battery const std::function ReadTemp; const std::function ReadCharge; - std::unique_ptr> voltage_ma_; - std::unique_ptr> current_ma_; - std::unique_ptr> temp_ma_; - std::unique_ptr> charge_ma_; + std::unique_ptr> voltage_ma_; + std::unique_ptr> current_ma_; + std::unique_ptr> temp_ma_; + std::unique_ptr> charge_ma_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_ diff --git a/panther_battery/include/panther_battery/battery/battery.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery/battery.hpp similarity index 95% rename from panther_battery/include/panther_battery/battery/battery.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery/battery.hpp index eb067aa6..7e461cfa 100644 --- a/panther_battery/include/panther_battery/battery/battery.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery/battery.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_BATTERY_HPP_ -#define PANTHER_BATTERY_BATTERY_BATTERY_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_ #include #include @@ -27,7 +27,7 @@ #include "panther_msgs/msg/charging_status.hpp" -namespace panther_battery +namespace husarion_ugv_battery { using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -127,6 +127,6 @@ class Battery ChargingStatusMsg charging_status_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_BATTERY_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_ diff --git a/panther_battery/include/panther_battery/battery/roboteq_battery.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery/roboteq_battery.hpp similarity index 81% rename from panther_battery/include/panther_battery/battery/roboteq_battery.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery/roboteq_battery.hpp index 34d1d3cd..0b785f79 100644 --- a/panther_battery/include/panther_battery/battery/roboteq_battery.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery/roboteq_battery.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ -#define PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ #include #include @@ -24,10 +24,10 @@ #include "panther_msgs/msg/driver_state_named.hpp" #include "panther_msgs/msg/robot_driver_state.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -namespace panther_battery +namespace husarion_ugv_battery { using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState; @@ -73,10 +73,10 @@ class RoboteqBattery : public Battery float current_raw_; RobotDriverStateMsg::SharedPtr driver_state_; - std::unique_ptr> voltage_ma_; - std::unique_ptr> current_ma_; + std::unique_ptr> voltage_ma_; + std::unique_ptr> current_ma_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_ diff --git a/panther_battery/include/panther_battery/battery_driver_node.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery_driver_node.hpp similarity index 80% rename from panther_battery/include/panther_battery/battery_driver_node.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery_driver_node.hpp index 0832bc03..1bba8b99 100644 --- a/panther_battery/include/panther_battery/battery_driver_node.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery_driver_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_ -#define PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_ #include #include @@ -23,11 +23,11 @@ #include "panther_msgs/msg/robot_driver_state.hpp" -#include "panther_battery/adc_data_reader.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/adc_data_reader.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" -namespace panther_battery +namespace husarion_ugv_battery { using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState; @@ -60,6 +60,6 @@ class BatteryDriverNode : public rclcpp::Node std::shared_ptr diagnostic_updater_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_ diff --git a/panther_battery/include/panther_battery/battery_publisher/battery_publisher.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/battery_publisher.hpp similarity index 88% rename from panther_battery/include/panther_battery/battery_publisher/battery_publisher.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/battery_publisher.hpp index 688f1899..9258b9a5 100644 --- a/panther_battery/include/panther_battery/battery_publisher/battery_publisher.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/battery_publisher.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ -#define PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ #include @@ -25,7 +25,7 @@ #include "panther_msgs/msg/charging_status.hpp" #include "panther_msgs/msg/io_state.hpp" -namespace panther_battery +namespace husarion_ugv_battery { using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -71,6 +71,6 @@ class BatteryPublisher rclcpp::Subscription::SharedPtr io_state_sub_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_ diff --git a/panther_battery/include/panther_battery/battery_publisher/dual_battery_publisher.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp similarity index 84% rename from panther_battery/include/panther_battery/battery_publisher/dual_battery_publisher.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp index 9890465f..738d7766 100644 --- a/panther_battery/include/panther_battery/battery_publisher/dual_battery_publisher.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ -#define PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ #include #include #include "rclcpp/rclcpp.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" -namespace panther_battery +namespace husarion_ugv_battery { class DualBatteryPublisher : public BatteryPublisher @@ -66,6 +66,6 @@ class DualBatteryPublisher : public BatteryPublisher rclcpp::Publisher::SharedPtr charging_status_pub_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_ diff --git a/panther_battery/include/panther_battery/battery_publisher/single_battery_publisher.hpp b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp similarity index 78% rename from panther_battery/include/panther_battery/battery_publisher/single_battery_publisher.hpp rename to husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp index 29be9bc5..f1e65ecf 100644 --- a/panther_battery/include/panther_battery/battery_publisher/single_battery_publisher.hpp +++ b/husarion_ugv_battery/include/husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ -#define PANTHER_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ +#ifndef HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ +#define HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ #include #include "rclcpp/rclcpp.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" -namespace panther_battery +namespace husarion_ugv_battery { class SingleBatteryPublisher : public BatteryPublisher @@ -51,6 +51,6 @@ class SingleBatteryPublisher : public BatteryPublisher rclcpp::Publisher::SharedPtr charging_status_pub_; }; -} // namespace panther_battery +} // namespace husarion_ugv_battery -#endif // PANTHER_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ +#endif // HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_SINGLE_BATTERY_PUBLISHER_HPP_ diff --git a/panther_battery/launch/battery.launch.py b/husarion_ugv_battery/launch/battery.launch.py similarity index 97% rename from panther_battery/launch/battery.launch.py rename to husarion_ugv_battery/launch/battery.launch.py index 51139e50..d8327e33 100644 --- a/panther_battery/launch/battery.launch.py +++ b/husarion_ugv_battery/launch/battery.launch.py @@ -29,7 +29,7 @@ def generate_launch_description(): ) battery_driver_node = Node( - package="panther_battery", + package="husarion_ugv_battery", executable="battery_driver_node", name="battery_driver", namespace=namespace, diff --git a/panther_battery/package.xml b/husarion_ugv_battery/package.xml similarity index 93% rename from panther_battery/package.xml rename to husarion_ugv_battery/package.xml index 8e67a1b9..70f025d7 100644 --- a/panther_battery/package.xml +++ b/husarion_ugv_battery/package.xml @@ -1,7 +1,7 @@ - panther_battery + husarion_ugv_battery 2.1.1 Nodes monitoring the battery state of Husarion Panhter robot Husarion @@ -17,8 +17,8 @@ ament_cmake diagnostic_updater + husarion_ugv_utils panther_msgs - panther_utils rclcpp sensor_msgs diff --git a/panther_battery/src/battery/adc_battery.cpp b/husarion_ugv_battery/src/battery/adc_battery.cpp similarity index 93% rename from panther_battery/src/battery/adc_battery.cpp rename to husarion_ugv_battery/src/battery/adc_battery.cpp index 968f4823..cd13f25a 100644 --- a/panther_battery/src/battery/adc_battery.cpp +++ b/husarion_ugv_battery/src/battery/adc_battery.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery/adc_battery.hpp" +#include "husarion_ugv_battery/battery/adc_battery.hpp" #include #include @@ -24,9 +24,9 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -namespace panther_battery +namespace husarion_ugv_battery { ADCBattery::ADCBattery( @@ -35,13 +35,13 @@ ADCBattery::ADCBattery( const ADCBatteryParams & params) : ReadVoltage(read_voltage), ReadCurrent(read_current), ReadTemp(read_temp), ReadCharge(read_charge) { - voltage_ma_ = std::make_unique>( + voltage_ma_ = std::make_unique>( params.voltage_window_len, std::numeric_limits::quiet_NaN()); - current_ma_ = std::make_unique>( + current_ma_ = std::make_unique>( params.current_window_len, std::numeric_limits::quiet_NaN()); - temp_ma_ = std::make_unique>( + temp_ma_ = std::make_unique>( params.temp_window_len, std::numeric_limits::quiet_NaN()); - charge_ma_ = std::make_unique>( + charge_ma_ = std::make_unique>( params.charge_window_len, std::numeric_limits::quiet_NaN()); } @@ -197,4 +197,4 @@ std::uint8_t ADCBattery::GetBatteryHealth(const float voltage, const float temp) } } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/battery/roboteq_battery.cpp b/husarion_ugv_battery/src/battery/roboteq_battery.cpp similarity index 94% rename from panther_battery/src/battery/roboteq_battery.cpp rename to husarion_ugv_battery/src/battery/roboteq_battery.cpp index 6cd0f3fd..7d2d870d 100644 --- a/panther_battery/src/battery/roboteq_battery.cpp +++ b/husarion_ugv_battery/src/battery/roboteq_battery.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery/roboteq_battery.hpp" +#include "husarion_ugv_battery/battery/roboteq_battery.hpp" #include #include @@ -23,9 +23,9 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -namespace panther_battery +namespace husarion_ugv_battery { RoboteqBattery::RoboteqBattery( @@ -33,9 +33,9 @@ RoboteqBattery::RoboteqBattery( const RoboteqBatteryParams & params) : GetRobotDriverState(get_driver_state), driver_state_timeout_(params.driver_state_timeout) { - voltage_ma_ = std::make_unique>( + voltage_ma_ = std::make_unique>( params.voltage_window_len, std::numeric_limits::quiet_NaN()); - current_ma_ = std::make_unique>( + current_ma_ = std::make_unique>( params.current_window_len, std::numeric_limits::quiet_NaN()); } @@ -157,4 +157,4 @@ bool RoboteqBattery::DriverStateHeartbeatTimeout() [](const DriverStateNamedMsg & driver) { return driver.state.heartbeat_timeout; }); } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/battery_driver_node.cpp b/husarion_ugv_battery/src/battery_driver_node.cpp similarity index 91% rename from panther_battery/src/battery_driver_node.cpp rename to husarion_ugv_battery/src/battery_driver_node.cpp index f3603b87..9ec16665 100644 --- a/panther_battery/src/battery_driver_node.cpp +++ b/husarion_ugv_battery/src/battery_driver_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery_driver_node.hpp" +#include "husarion_ugv_battery/battery_driver_node.hpp" #include #include @@ -24,15 +24,15 @@ #include "diagnostic_updater/diagnostic_updater.hpp" #include "rclcpp/rclcpp.hpp" -#include "panther_battery/adc_data_reader.hpp" -#include "panther_battery/battery/adc_battery.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery/roboteq_battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" -#include "panther_battery/battery_publisher/dual_battery_publisher.hpp" -#include "panther_battery/battery_publisher/single_battery_publisher.hpp" +#include "husarion_ugv_battery/adc_data_reader.hpp" +#include "husarion_ugv_battery/battery/adc_battery.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery/roboteq_battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp" -namespace panther_battery +namespace husarion_ugv_battery { BatteryDriverNode::BatteryDriverNode( @@ -157,4 +157,4 @@ void BatteryDriverNode::BatteryPubTimerCB() battery_publisher_->Publish(); } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/battery_publisher/battery_publisher.cpp b/husarion_ugv_battery/src/battery_publisher/battery_publisher.cpp similarity index 96% rename from panther_battery/src/battery_publisher/battery_publisher.cpp rename to husarion_ugv_battery/src/battery_publisher/battery_publisher.cpp index e3ccb14b..e37fcbfe 100644 --- a/panther_battery/src/battery_publisher/battery_publisher.cpp +++ b/husarion_ugv_battery/src/battery_publisher/battery_publisher.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" #include #include @@ -21,7 +21,7 @@ #include "diagnostic_updater/diagnostic_updater.hpp" #include "rclcpp/rclcpp.hpp" -namespace panther_battery +namespace husarion_ugv_battery { BatteryPublisher::BatteryPublisher( @@ -140,4 +140,4 @@ rclcpp::Clock::SharedPtr BatteryPublisher::GetClock() return std::make_shared(RCL_ROS_TIME); } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/battery_publisher/dual_battery_publisher.cpp b/husarion_ugv_battery/src/battery_publisher/dual_battery_publisher.cpp similarity index 96% rename from panther_battery/src/battery_publisher/dual_battery_publisher.cpp rename to husarion_ugv_battery/src/battery_publisher/dual_battery_publisher.cpp index fba8198d..f474b1fe 100644 --- a/panther_battery/src/battery_publisher/dual_battery_publisher.cpp +++ b/husarion_ugv_battery/src/battery_publisher/dual_battery_publisher.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery_publisher/dual_battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp" #include #include @@ -24,11 +24,11 @@ #include "sensor_msgs/msg/battery_state.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" -#include "panther_utils/ros_utils.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_utils/ros_utils.hpp" -namespace panther_battery +namespace husarion_ugv_battery { DualBatteryPublisher::DualBatteryPublisher( @@ -172,10 +172,10 @@ ChargingStatusMsg DualBatteryPublisher::MergeChargingStatusMsgs( ChargingStatusMsg charging_status_msg; try { - panther_utils::ros::VerifyTimestampGap( + husarion_ugv_utils::ros::VerifyTimestampGap( charging_status_msg_1.header, charging_status_msg_2.header, std::chrono::seconds(1)); - charging_status_msg.header = panther_utils::ros::MergeHeaders( + charging_status_msg.header = husarion_ugv_utils::ros::MergeHeaders( charging_status_msg_1.header, charging_status_msg_2.header); } catch (const std::exception & e) { RCLCPP_ERROR_STREAM_THROTTLE( @@ -251,4 +251,4 @@ void DualBatteryPublisher::DiagnoseStatus(diagnostic_updater::DiagnosticStatusWr status.summary(diagnostic_updater::DiagnosticStatusWrapper::OK, "Battery status monitoring"); } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/battery_publisher/single_battery_publisher.cpp b/husarion_ugv_battery/src/battery_publisher/single_battery_publisher.cpp similarity index 92% rename from panther_battery/src/battery_publisher/single_battery_publisher.cpp rename to husarion_ugv_battery/src/battery_publisher/single_battery_publisher.cpp index 4916e647..92e4d003 100644 --- a/panther_battery/src/battery_publisher/single_battery_publisher.cpp +++ b/husarion_ugv_battery/src/battery_publisher/single_battery_publisher.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_battery/battery_publisher/single_battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp" #include #include @@ -23,10 +23,10 @@ #include "sensor_msgs/msg/battery_state.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" -namespace panther_battery +namespace husarion_ugv_battery { SingleBatteryPublisher::SingleBatteryPublisher( @@ -106,4 +106,4 @@ void SingleBatteryPublisher::DiagnoseStatus(diagnostic_updater::DiagnosticStatus status.summary(diagnostic_updater::DiagnosticStatusWrapper::OK, "Battery status monitoring"); } -} // namespace panther_battery +} // namespace husarion_ugv_battery diff --git a/panther_battery/src/main.cpp b/husarion_ugv_battery/src/main.cpp similarity index 86% rename from panther_battery/src/main.cpp rename to husarion_ugv_battery/src/main.cpp index b759fd33..9dc84ddf 100644 --- a/panther_battery/src/main.cpp +++ b/husarion_ugv_battery/src/main.cpp @@ -18,13 +18,14 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_battery/battery_driver_node.hpp" +#include "husarion_ugv_battery/battery_driver_node.hpp" int main(int argc, char ** argv) { rclcpp::init(argc, argv); - auto battery_driver_node = std::make_shared("battery_driver"); + auto battery_driver_node = + std::make_shared("battery_driver"); try { rclcpp::spin(battery_driver_node); diff --git a/panther_battery/test/battery/test_adc_battery.cpp b/husarion_ugv_battery/test/battery/test_adc_battery.cpp similarity index 93% rename from panther_battery/test/battery/test_adc_battery.cpp rename to husarion_ugv_battery/test/battery/test_adc_battery.cpp index 986f7cdb..9486c85e 100644 --- a/panther_battery/test/battery/test_adc_battery.cpp +++ b/husarion_ugv_battery/test/battery/test_adc_battery.cpp @@ -24,8 +24,8 @@ #include "panther_msgs/msg/charging_status.hpp" -#include "panther_battery/battery/adc_battery.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_battery/battery/adc_battery.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using ChargingStatusMsg = panther_msgs::msg::ChargingStatus; @@ -54,7 +54,7 @@ class TestADCBattery : public testing::Test float battery_temp_raw_; float battery_charge_raw_; - std::unique_ptr battery_; + std::unique_ptr battery_; BatteryStateMsg battery_state_; ChargingStatusMsg charging_status_; @@ -62,8 +62,8 @@ class TestADCBattery : public testing::Test TestADCBattery::TestADCBattery() { - panther_battery::ADCBatteryParams params = {10, 10, 10, 10}; - battery_ = std::make_unique( + husarion_ugv_battery::ADCBatteryParams params = {10, 10, 10, 10}; + battery_ = std::make_unique( [&]() { return battery_voltage_raw_; }, [&]() { return battery_current_raw_; }, [&]() { return battery_temp_raw_; }, [&]() { return battery_charge_raw_; }, params); } @@ -92,8 +92,9 @@ void TestADCBattery::TestDefaultBatteryStateMsg( EXPECT_TRUE(std::isnan(battery_state_.capacity)); EXPECT_FLOAT_EQ(20.0, battery_state_.design_capacity); EXPECT_EQ(BatteryStateMsg::POWER_SUPPLY_TECHNOLOGY_LION, battery_state_.power_supply_technology); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); + EXPECT_TRUE( + husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); EXPECT_TRUE(battery_state_.present); EXPECT_EQ("user_compartment", battery_state_.location); @@ -116,8 +117,9 @@ void TestADCBattery::TestBatteryStateMsg( EXPECT_TRUE(std::isnan(battery_state_.capacity)); EXPECT_FLOAT_EQ(20.0, battery_state_.design_capacity); EXPECT_FLOAT_EQ(expected_temp, battery_state_.temperature); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); + EXPECT_TRUE( + husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); EXPECT_EQ(BatteryStateMsg::POWER_SUPPLY_TECHNOLOGY_LION, battery_state_.power_supply_technology); EXPECT_EQ("user_compartment", battery_state_.location); diff --git a/panther_battery/test/battery/test_battery.cpp b/husarion_ugv_battery/test/battery/test_battery.cpp similarity index 93% rename from panther_battery/test/battery/test_battery.cpp rename to husarion_ugv_battery/test/battery/test_battery.cpp index cdbdf381..9b2d12c0 100644 --- a/panther_battery/test/battery/test_battery.cpp +++ b/husarion_ugv_battery/test/battery/test_battery.cpp @@ -24,13 +24,13 @@ #include "panther_msgs/msg/charging_status.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using ChargingStatusMsg = panther_msgs::msg::ChargingStatus; -class BatteryWrapper : public panther_battery::Battery +class BatteryWrapper : public husarion_ugv_battery::Battery { public: BatteryWrapper() {} @@ -80,8 +80,9 @@ void TestBattery::TestDefaultBatteryStateMsg( EXPECT_TRUE(std::isnan(battery_state_.capacity)); EXPECT_FLOAT_EQ(20.0, battery_state_.design_capacity); EXPECT_EQ(BatteryStateMsg::POWER_SUPPLY_TECHNOLOGY_LION, battery_state_.power_supply_technology); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); + EXPECT_TRUE( + husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); EXPECT_TRUE(battery_state_.present); EXPECT_EQ("user_compartment", battery_state_.location); diff --git a/panther_battery/test/battery/test_roboteq_battery.cpp b/husarion_ugv_battery/test/battery/test_roboteq_battery.cpp similarity index 92% rename from panther_battery/test/battery/test_roboteq_battery.cpp rename to husarion_ugv_battery/test/battery/test_roboteq_battery.cpp index 8ca850f1..26674df8 100644 --- a/panther_battery/test/battery/test_roboteq_battery.cpp +++ b/husarion_ugv_battery/test/battery/test_roboteq_battery.cpp @@ -27,18 +27,18 @@ #include "panther_msgs/msg/driver_state_named.hpp" #include "panther_msgs/msg/robot_driver_state.hpp" -#include "panther_battery/battery/roboteq_battery.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_battery/battery/roboteq_battery.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState; -class RoboteqBatteryWrapper : public panther_battery::RoboteqBattery +class RoboteqBatteryWrapper : public husarion_ugv_battery::RoboteqBattery { public: RoboteqBatteryWrapper( const std::function & get_driver_state, - const panther_battery::RoboteqBatteryParams & params) + const husarion_ugv_battery::RoboteqBatteryParams & params) : RoboteqBattery(get_driver_state, params) { } @@ -73,7 +73,7 @@ class TestRoboteqBattery : public testing::Test TestRoboteqBattery::TestRoboteqBattery() { - const panther_battery::RoboteqBatteryParams params = {kRobotDriverStateTimeout, 10, 10}; + const husarion_ugv_battery::RoboteqBatteryParams params = {kRobotDriverStateTimeout, 10, 10}; battery_ = std::make_unique([&]() { return driver_state_; }, params); } @@ -105,8 +105,8 @@ void TestRoboteqBattery::TestDefaultBatteryStateMsg( EXPECT_TRUE(std::isnan(battery_state_.capacity)); EXPECT_FLOAT_EQ(20.0, battery_state_.design_capacity); EXPECT_EQ(BatteryStateMsg::POWER_SUPPLY_TECHNOLOGY_LION, battery_state_.power_supply_technology); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); EXPECT_TRUE(battery_state_.present); EXPECT_EQ("user_compartment", battery_state_.location); @@ -128,8 +128,8 @@ void TestRoboteqBattery::TestBatteryStateMsg( EXPECT_TRUE(std::isnan(battery_state_.capacity)); EXPECT_TRUE(std::isnan(battery_state_.temperature)); EXPECT_FLOAT_EQ(20.0, battery_state_.design_capacity); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_voltage)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(battery_state_.cell_temperature)); EXPECT_EQ(BatteryStateMsg::POWER_SUPPLY_TECHNOLOGY_LION, battery_state_.power_supply_technology); EXPECT_EQ("user_compartment", battery_state_.location); diff --git a/panther_battery/test/battery_publisher/test_battery_publisher.cpp b/husarion_ugv_battery/test/battery_publisher/test_battery_publisher.cpp similarity index 94% rename from panther_battery/test/battery_publisher/test_battery_publisher.cpp rename to husarion_ugv_battery/test/battery_publisher/test_battery_publisher.cpp index 4ed567b1..f5924c73 100644 --- a/panther_battery/test/battery_publisher/test_battery_publisher.cpp +++ b/husarion_ugv_battery/test/battery_publisher/test_battery_publisher.cpp @@ -24,18 +24,18 @@ #include "panther_msgs/msg/io_state.hpp" -#include "panther_battery/battery_publisher/battery_publisher.hpp" +#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using IOStateMsg = panther_msgs::msg::IOState; -class BatteryPublisherWrapper : public panther_battery::BatteryPublisher +class BatteryPublisherWrapper : public husarion_ugv_battery::BatteryPublisher { public: BatteryPublisherWrapper( const rclcpp::Node::SharedPtr & node, std::shared_ptr diagnostic_updater) - : panther_battery::BatteryPublisher(node, diagnostic_updater) + : husarion_ugv_battery::BatteryPublisher(node, diagnostic_updater) { } diff --git a/panther_battery/test/battery_publisher/test_dual_battery_publisher.cpp b/husarion_ugv_battery/test/battery_publisher/test_dual_battery_publisher.cpp similarity index 93% rename from panther_battery/test/battery_publisher/test_dual_battery_publisher.cpp rename to husarion_ugv_battery/test/battery_publisher/test_dual_battery_publisher.cpp index 0740b7fa..74bcb358 100644 --- a/panther_battery/test/battery_publisher/test_dual_battery_publisher.cpp +++ b/husarion_ugv_battery/test/battery_publisher/test_dual_battery_publisher.cpp @@ -24,22 +24,22 @@ #include "panther_msgs/msg/charging_status.hpp" -#include "panther_battery/battery/adc_battery.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/dual_battery_publisher.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_battery/battery/adc_battery.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/dual_battery_publisher.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using ChargingStatusMsg = panther_msgs::msg::ChargingStatus; -class DualBatteryPublisherWrapper : public panther_battery::DualBatteryPublisher +class DualBatteryPublisherWrapper : public husarion_ugv_battery::DualBatteryPublisher { public: DualBatteryPublisherWrapper( const rclcpp::Node::SharedPtr & node, std::shared_ptr diagnostic_updater, - std::shared_ptr & battery_1, - std::shared_ptr & battery_2) + std::shared_ptr & battery_1, + std::shared_ptr & battery_2) : DualBatteryPublisher(node, diagnostic_updater, battery_1, battery_2) { } @@ -90,8 +90,8 @@ class TestDualBatteryPublisher : public testing::Test rclcpp::Subscription::SharedPtr battery_1_sub_; rclcpp::Subscription::SharedPtr battery_2_sub_; - std::shared_ptr battery_1_; - std::shared_ptr battery_2_; + std::shared_ptr battery_1_; + std::shared_ptr battery_2_; std::shared_ptr battery_publisher_; BatteryStateMsg::SharedPtr battery_state_; BatteryStateMsg::SharedPtr battery_1_state_; @@ -100,11 +100,11 @@ class TestDualBatteryPublisher : public testing::Test TestDualBatteryPublisher::TestDualBatteryPublisher() { - panther_battery::ADCBatteryParams params = {10, 10, 10, 10}; - battery_1_ = std::make_shared( + husarion_ugv_battery::ADCBatteryParams params = {10, 10, 10, 10}; + battery_1_ = std::make_shared( [&]() { return 1.6; }, [&]() { return 0.02; }, [&]() { return 1.6; }, [&]() { return 0.4; }, params); - battery_2_ = std::make_shared( + battery_2_ = std::make_shared( [&]() { return 1.6; }, [&]() { return 0.02; }, [&]() { return 1.6; }, [&]() { return 0.4; }, params); @@ -139,13 +139,13 @@ void TestDualBatteryPublisher::TestMergeBatteryPowerSupplyStatus( TEST_F(TestDualBatteryPublisher, CorrectTopicPublished) { battery_publisher_->Publish(); - ASSERT_TRUE( - panther_utils::test_utils::WaitForMsg(node_, battery_state_, std::chrono::milliseconds(1000))); + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( + node_, battery_state_, std::chrono::milliseconds(1000))); battery_publisher_->Publish(); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( node_, battery_1_state_, std::chrono::milliseconds(1000))); battery_publisher_->Publish(); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( node_, battery_2_state_, std::chrono::milliseconds(1000))); } diff --git a/panther_battery/test/battery_publisher/test_single_battery_publisher.cpp b/husarion_ugv_battery/test/battery_publisher/test_single_battery_publisher.cpp similarity index 75% rename from panther_battery/test/battery_publisher/test_single_battery_publisher.cpp rename to husarion_ugv_battery/test/battery_publisher/test_single_battery_publisher.cpp index f7a04c3f..3d98a9a7 100644 --- a/panther_battery/test/battery_publisher/test_single_battery_publisher.cpp +++ b/husarion_ugv_battery/test/battery_publisher/test_single_battery_publisher.cpp @@ -21,10 +21,10 @@ #include "sensor_msgs/msg/battery_state.hpp" -#include "panther_battery/battery/adc_battery.hpp" -#include "panther_battery/battery/battery.hpp" -#include "panther_battery/battery_publisher/single_battery_publisher.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_battery/battery/adc_battery.hpp" +#include "husarion_ugv_battery/battery/battery.hpp" +#include "husarion_ugv_battery/battery_publisher/single_battery_publisher.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -40,16 +40,16 @@ class TestSingleBatteryPublisher : public testing::Test rclcpp::Subscription::SharedPtr battery_sub_; rclcpp::Subscription::SharedPtr battery_1_sub_; - std::shared_ptr battery_; - std::shared_ptr battery_publisher_; + std::shared_ptr battery_; + std::shared_ptr battery_publisher_; BatteryStateMsg::SharedPtr battery_state_; BatteryStateMsg::SharedPtr battery_1_state_; }; TestSingleBatteryPublisher::TestSingleBatteryPublisher() { - panther_battery::ADCBatteryParams params = {10, 10, 10, 10}; - battery_ = std::make_shared( + husarion_ugv_battery::ADCBatteryParams params = {10, 10, 10, 10}; + battery_ = std::make_shared( [&]() { return 1.6; }, [&]() { return 0.02; }, [&]() { return 1.6; }, [&]() { return 0.4; }, params); @@ -61,17 +61,17 @@ TestSingleBatteryPublisher::TestSingleBatteryPublisher() battery_1_sub_ = node_->create_subscription( "/_battery/battery_1_status_raw", 10, [&](const BatteryStateMsg::SharedPtr msg) { battery_1_state_ = msg; }); - battery_publisher_ = std::make_shared( + battery_publisher_ = std::make_shared( node_, diagnostic_updater_, battery_); } TEST_F(TestSingleBatteryPublisher, CorrectTopicPublished) { battery_publisher_->Publish(); - ASSERT_TRUE( - panther_utils::test_utils::WaitForMsg(node_, battery_state_, std::chrono::milliseconds(1000))); + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( + node_, battery_state_, std::chrono::milliseconds(1000))); battery_publisher_->Publish(); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( node_, battery_1_state_, std::chrono::milliseconds(1000))); } diff --git a/panther_battery/test/test_adc_data_reader.cpp b/husarion_ugv_battery/test/test_adc_data_reader.cpp similarity index 92% rename from panther_battery/test/test_adc_data_reader.cpp rename to husarion_ugv_battery/test/test_adc_data_reader.cpp index c9fd3d94..bbb322bc 100644 --- a/panther_battery/test/test_adc_data_reader.cpp +++ b/husarion_ugv_battery/test/test_adc_data_reader.cpp @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -#include "panther_battery/adc_data_reader.hpp" +#include "husarion_ugv_battery/adc_data_reader.hpp" class TestADCDataReader : public testing::Test { @@ -27,7 +27,7 @@ class TestADCDataReader : public testing::Test ~TestADCDataReader(); protected: - std::shared_ptr data_reader_; + std::shared_ptr data_reader_; std::filesystem::path data_file_path_; std::filesystem::path scale_file_path_; std::ofstream file_; @@ -44,7 +44,7 @@ TestADCDataReader::TestADCDataReader() WriteNumberToFile(1.0, scale_file_path_); - data_reader_ = std::make_shared(current_path); + data_reader_ = std::make_shared(current_path); } TestADCDataReader::~TestADCDataReader() diff --git a/panther_battery/test/test_battery_driver_node_adc_dual.cpp b/husarion_ugv_battery/test/test_battery_driver_node_adc_dual.cpp similarity index 91% rename from panther_battery/test/test_battery_driver_node_adc_dual.cpp rename to husarion_ugv_battery/test/test_battery_driver_node_adc_dual.cpp index 740ba838..2718407a 100644 --- a/panther_battery/test/test_battery_driver_node_adc_dual.cpp +++ b/husarion_ugv_battery/test/test_battery_driver_node_adc_dual.cpp @@ -20,7 +20,7 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" class TestBatteryNodeADCDual : public TestBatteryNode { @@ -30,7 +30,7 @@ class TestBatteryNodeADCDual : public TestBatteryNode TEST_F(TestBatteryNodeADCDual, BatteryValues) { - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // This is done to check if channels of ADC readers were assigned correctly, not to verify @@ -51,7 +51,7 @@ TEST_F(TestBatteryNodeADCDual, BatteryValues) // Change value of battery 2 reading one by one and check if corresponding values in battery 1 // stops matching WriteNumberToFile(1600, std::filesystem::path(device1_path_ / "in_voltage3_raw")); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_2_state_, std::chrono::milliseconds(1000))); EXPECT_FALSE( fabs(battery_1_state_->voltage - battery_2_state_->voltage) < @@ -67,7 +67,7 @@ TEST_F(TestBatteryNodeADCDual, BatteryValues) WriteNumberToFile(900, std::filesystem::path(device1_path_ / "in_voltage1_raw")); WriteNumberToFile(100, std::filesystem::path(device0_path_ / "in_voltage2_raw")); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_2_state_, std::chrono::milliseconds(1000))); EXPECT_FALSE( fabs(battery_1_state_->current - battery_2_state_->current) < @@ -75,7 +75,7 @@ TEST_F(TestBatteryNodeADCDual, BatteryValues) EXPECT_FLOAT_EQ(battery_1_state_->temperature, battery_2_state_->temperature); WriteNumberToFile(1000, std::filesystem::path(device0_path_ / "in_voltage0_raw")); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_2_state_, std::chrono::milliseconds(1000))); EXPECT_FALSE( fabs(battery_1_state_->temperature - battery_2_state_->temperature) < @@ -84,7 +84,7 @@ TEST_F(TestBatteryNodeADCDual, BatteryValues) TEST_F(TestBatteryNodeADCDual, BatteryTimeout) { - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Battery state msg should have some values @@ -98,7 +98,7 @@ TEST_F(TestBatteryNodeADCDual, BatteryTimeout) std::filesystem::remove(std::filesystem::path(device0_path_ / "in_voltage2_raw")); std::filesystem::remove(std::filesystem::path(device1_path_ / "in_voltage2_raw")); std::this_thread::sleep_for(std::chrono::milliseconds(2500)); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // Battery state msg values should be NaN @@ -114,14 +114,14 @@ TEST_F(TestBatteryNodeADCDual, BatteryTimeout) TEST_F(TestBatteryNodeADCDual, BatteryCharging) { // Wait for node to initialize - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Publish charger connected state IOStateMsg io_state; io_state.charger_connected = true; io_state_pub_->publish(io_state); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); EXPECT_NE(battery_state_->power_supply_status, BatteryStateMsg::POWER_SUPPLY_STATUS_DISCHARGING); diff --git a/panther_battery/test/test_battery_driver_node_adc_single.cpp b/husarion_ugv_battery/test/test_battery_driver_node_adc_single.cpp similarity index 91% rename from panther_battery/test/test_battery_driver_node_adc_single.cpp rename to husarion_ugv_battery/test/test_battery_driver_node_adc_single.cpp index cc26bfe7..8c0ec498 100644 --- a/panther_battery/test/test_battery_driver_node_adc_single.cpp +++ b/husarion_ugv_battery/test/test_battery_driver_node_adc_single.cpp @@ -20,7 +20,7 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" class TestBatteryNodeADCSingle : public TestBatteryNode { @@ -35,7 +35,7 @@ TEST_F(TestBatteryNodeADCSingle, BatteryValues) WriteNumberToFile(1600, std::filesystem::path(device1_path_ / "in_voltage3_raw")); WriteNumberToFile(100, std::filesystem::path(device0_path_ / "in_voltage2_raw")); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // This is done to check if channels of ADC readers were assigned correctly, not to verify @@ -56,7 +56,7 @@ TEST_F(TestBatteryNodeADCSingle, BatteryValues) TEST_F(TestBatteryNodeADCSingle, BatteryTimeout) { - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Battery state msg should have some values @@ -70,7 +70,7 @@ TEST_F(TestBatteryNodeADCSingle, BatteryTimeout) std::filesystem::remove(std::filesystem::path(device0_path_ / "in_voltage2_raw")); std::filesystem::remove(std::filesystem::path(device1_path_ / "in_voltage2_raw")); std::this_thread::sleep_for(std::chrono::milliseconds(2500)); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // Battery state msg values should be NaN @@ -86,14 +86,14 @@ TEST_F(TestBatteryNodeADCSingle, BatteryTimeout) TEST_F(TestBatteryNodeADCSingle, BatteryCharging) { // Wait for node to initialize - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Publish charger connected state IOStateMsg io_state; io_state.charger_connected = true; io_state_pub_->publish(io_state); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); EXPECT_NE(battery_state_->power_supply_status, BatteryStateMsg::POWER_SUPPLY_STATUS_DISCHARGING); @@ -105,7 +105,7 @@ TEST_F(TestBatteryNodeADCSingle, RoboteqInitOnADCFail) std::filesystem::remove_all(device0_path_); // Wait for node to initialize - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Battery state status should be UNKNOWN @@ -116,7 +116,7 @@ TEST_F(TestBatteryNodeADCSingle, RoboteqInitOnADCFail) driver_state.header.stamp = battery_driver_node_->get_clock()->now(); driver_state_pub_->publish(driver_state); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // Battery state status should be different than UNKNOWN diff --git a/panther_battery/test/test_battery_driver_node_roboteq.cpp b/husarion_ugv_battery/test/test_battery_driver_node_roboteq.cpp similarity index 93% rename from panther_battery/test/test_battery_driver_node_roboteq.cpp rename to husarion_ugv_battery/test/test_battery_driver_node_roboteq.cpp index 84eb00b9..8393b1b9 100644 --- a/panther_battery/test/test_battery_driver_node_roboteq.cpp +++ b/husarion_ugv_battery/test/test_battery_driver_node_roboteq.cpp @@ -22,7 +22,7 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" class TestBatteryNodeRoboteq : public TestBatteryNode { @@ -33,7 +33,7 @@ class TestBatteryNodeRoboteq : public TestBatteryNode TEST_F(TestBatteryNodeRoboteq, BatteryValues) { // Wait for node to initialize - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Battery state msg values should be NaN @@ -54,7 +54,7 @@ TEST_F(TestBatteryNodeRoboteq, BatteryValues) driver_state.driver_states.push_back(motor_controller); driver_state_pub_->publish(driver_state); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // This is done to check if values were read correctly, not to verify calculations. @@ -72,7 +72,7 @@ TEST_F(TestBatteryNodeRoboteq, BatteryValues) TEST_F(TestBatteryNodeRoboteq, BatteryTimeout) { // Wait for node to initialize - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(5000))); // Battery state msg values should be NaN @@ -94,7 +94,7 @@ TEST_F(TestBatteryNodeRoboteq, BatteryTimeout) driver_state.driver_states.push_back(motor_controller); driver_state_pub_->publish(driver_state); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // Battery state msg should have some values @@ -105,7 +105,7 @@ TEST_F(TestBatteryNodeRoboteq, BatteryTimeout) // Wait for timeout std::this_thread::sleep_for(std::chrono::milliseconds(1500)); - ASSERT_TRUE(panther_utils::test_utils::WaitForMsg( + ASSERT_TRUE(husarion_ugv_utils::test_utils::WaitForMsg( battery_driver_node_, battery_state_, std::chrono::milliseconds(1000))); // Battery state msg values should be NaN diff --git a/panther_battery/test/utils/test_battery_driver_node.hpp b/husarion_ugv_battery/test/utils/test_battery_driver_node.hpp similarity index 93% rename from panther_battery/test/utils/test_battery_driver_node.hpp rename to husarion_ugv_battery/test/utils/test_battery_driver_node.hpp index bad9542c..319dfd6d 100644 --- a/panther_battery/test/utils/test_battery_driver_node.hpp +++ b/husarion_ugv_battery/test/utils/test_battery_driver_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ -#define PANTHER_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ +#ifndef HUSARION_UGV_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ +#define HUSARION_UGV_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ #include #include @@ -31,7 +31,7 @@ #include "panther_msgs/msg/io_state.hpp" #include "panther_msgs/msg/robot_driver_state.hpp" -#include "panther_battery/battery_driver_node.hpp" +#include "husarion_ugv_battery/battery_driver_node.hpp" using BatteryStateMsg = sensor_msgs::msg::BatteryState; using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState; @@ -55,7 +55,7 @@ class TestBatteryNode : public testing::Test BatteryStateMsg::SharedPtr battery_state_; BatteryStateMsg::SharedPtr battery_1_state_; BatteryStateMsg::SharedPtr battery_2_state_; - std::shared_ptr battery_driver_node_; + std::shared_ptr battery_driver_node_; rclcpp::Subscription::SharedPtr battery_sub_; rclcpp::Subscription::SharedPtr battery_1_sub_; rclcpp::Subscription::SharedPtr battery_2_sub_; @@ -103,7 +103,7 @@ TestBatteryNode::TestBatteryNode(const bool use_adc_battery, const bool dual_bat rclcpp::NodeOptions options; options.parameter_overrides(params); - battery_driver_node_ = std::make_shared( + battery_driver_node_ = std::make_shared( "battery_driver", options); battery_sub_ = battery_driver_node_->create_subscription( @@ -145,4 +145,4 @@ void TestBatteryNode::WriteNumberToFile(const T number, const std::string & file } } -#endif // PANTHER_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ +#endif // HUSARION_UGV_BATTERY_UTILS_TEST_BATTERY_DRIVER_NODE_HPP_ diff --git a/panther_bringup/CHANGELOG.rst b/husarion_ugv_bringup/CHANGELOG.rst similarity index 100% rename from panther_bringup/CHANGELOG.rst rename to husarion_ugv_bringup/CHANGELOG.rst diff --git a/panther_bringup/CMakeLists.txt b/husarion_ugv_bringup/CMakeLists.txt similarity index 83% rename from panther_bringup/CMakeLists.txt rename to husarion_ugv_bringup/CMakeLists.txt index 79305750..6fb4694d 100644 --- a/panther_bringup/CMakeLists.txt +++ b/husarion_ugv_bringup/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_bringup) +project(husarion_ugv_bringup) find_package(ament_cmake REQUIRED) diff --git a/panther_bringup/README.md b/husarion_ugv_bringup/README.md similarity index 87% rename from panther_bringup/README.md rename to husarion_ugv_bringup/README.md index b12b4218..caafb8c8 100644 --- a/panther_bringup/README.md +++ b/husarion_ugv_bringup/README.md @@ -1,6 +1,6 @@ -# panther_bringup +# husarion_ugv_bringup -The package contains the default configuration and launch files necessary to start all the basic functionalities of the Husarion Panther robot. +The package contains the default configuration and launch files necessary to start all the basic functionalities of the Husarion UGV robots. ## Launch Files diff --git a/panther_bringup/launch/bringup.launch.py b/husarion_ugv_bringup/launch/bringup.launch.py similarity index 87% rename from panther_bringup/launch/bringup.launch.py rename to husarion_ugv_bringup/launch/bringup.launch.py index c291d92c..e27d7104 100644 --- a/panther_bringup/launch/bringup.launch.py +++ b/husarion_ugv_bringup/launch/bringup.launch.py @@ -16,6 +16,7 @@ import os +from husarion_ugv_utils.messages import welcome_msg from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction from launch.conditions import IfCondition, UnlessCondition @@ -26,7 +27,6 @@ PathJoinSubstitution, ) from launch_ros.substitutions import FindPackageShare -from panther_utils.messages import welcome_msg def generate_launch_description(): @@ -63,7 +63,7 @@ def generate_launch_description(): controller_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_controller"), "launch", "controller.launch.py"] + [FindPackageShare("husarion_ugv_controller"), "launch", "controller.launch.py"] ) ), launch_arguments={"namespace": namespace}.items(), @@ -73,7 +73,7 @@ def generate_launch_description(): PythonLaunchDescriptionSource( PathJoinSubstitution( [ - FindPackageShare("panther_diagnostics"), + FindPackageShare("husarion_ugv_diagnostics"), "launch", "system_monitor.launch.py", ] @@ -85,7 +85,7 @@ def generate_launch_description(): lights_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_lights"), "launch", "lights.launch.py"] + [FindPackageShare("husarion_ugv_lights"), "launch", "lights.launch.py"] ) ), launch_arguments={"namespace": namespace}.items(), @@ -94,7 +94,7 @@ def generate_launch_description(): battery_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_battery"), "launch", "battery.launch.py"] + [FindPackageShare("husarion_ugv_battery"), "launch", "battery.launch.py"] ), ), launch_arguments={"namespace": namespace}.items(), @@ -103,7 +103,7 @@ def generate_launch_description(): ekf_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_localization"), "launch", "localization.launch.py"] + [FindPackageShare("husarion_ugv_localization"), "launch", "localization.launch.py"] ) ), launch_arguments={"namespace": namespace}.items(), @@ -113,7 +113,7 @@ def generate_launch_description(): manager_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_manager"), "launch", "manager.launch.py"] + [FindPackageShare("husarion_ugv_manager"), "launch", "manager.launch.py"] ) ), condition=UnlessCondition(disable_manager), diff --git a/panther_bringup/package.xml b/husarion_ugv_bringup/package.xml similarity index 80% rename from panther_bringup/package.xml rename to husarion_ugv_bringup/package.xml index a5fe44b4..4639b078 100644 --- a/panther_bringup/package.xml +++ b/husarion_ugv_bringup/package.xml @@ -1,9 +1,9 @@ - panther_bringup + husarion_ugv_bringup 2.1.1 - Default launch files and configuration used to start Husarion Panther robot + Default launch files and configuration used to start Husarion UGV robots Husarion Apache License 2.0 @@ -15,15 +15,15 @@ ament_cmake + husarion_ugv_battery + husarion_ugv_controller + husarion_ugv_diagnostics + husarion_ugv_lights + husarion_ugv_localization + husarion_ugv_manager + husarion_ugv_utils launch launch_ros - panther_battery - panther_controller - panther_diagnostics - panther_lights - panther_localization - panther_manager - panther_utils ament_cmake diff --git a/panther_controller/CHANGELOG.rst b/husarion_ugv_controller/CHANGELOG.rst similarity index 100% rename from panther_controller/CHANGELOG.rst rename to husarion_ugv_controller/CHANGELOG.rst diff --git a/panther_localization/CMakeLists.txt b/husarion_ugv_controller/CMakeLists.txt similarity index 82% rename from panther_localization/CMakeLists.txt rename to husarion_ugv_controller/CMakeLists.txt index 33da28a6..9cf8423a 100644 --- a/panther_localization/CMakeLists.txt +++ b/husarion_ugv_controller/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_localization) +project(husarion_ugv_controller) find_package(ament_cmake REQUIRED) diff --git a/husarion_ugv_controller/CONFIGURATION.md b/husarion_ugv_controller/CONFIGURATION.md new file mode 100644 index 00000000..01a40d15 --- /dev/null +++ b/husarion_ugv_controller/CONFIGURATION.md @@ -0,0 +1,9 @@ +# husarion_ugv_controller + +## Changing Velocity Smoothing Parameters + +The default drive controller is based on [diff_drive_controller](https://control.ros.org/master/doc/ros2_controllers/diff_drive_controller/doc/userdoc.html) from [ros2 control](https://control.ros.org/master/index.html) or [mecanum_drive_controller](https://github.com/husarion/husarion_controllers/tree/main/mecanum_drive_controller). This controller can be customized, among others: by modifying the robot's dynamic parameters (e.g. smooth the speed or limit the robot's speed and acceleration). Its parameters can be found in the [husarion_ugv_controller](https://github.com/husarion/panther_ros/tree/ros2-devel/husarion_ugv_controller/config). By default, these values correspond to the upper limits of the robot's velocities and accelerations. + +## Changing Wheel Type + +Changing wheel types is possible and can be done for both the real robot and the simulation. By default, three types of wheels are supported using the launch argument `wheel_type`. If you want to use custom wheels, all you need to do is point to the new wheel and controller configuration files using the `wheel_config_path` and `controller_config_path` parameters. These files should be based on the default files, i.e. [WH01_controller.yaml](./config/WH01_controller.yaml) and [WH01.yaml](../panther_description/config/WH01.yaml). diff --git a/panther_controller/README.md b/husarion_ugv_controller/README.md similarity index 95% rename from panther_controller/README.md rename to husarion_ugv_controller/README.md index ac600dc7..f2deb065 100644 --- a/panther_controller/README.md +++ b/husarion_ugv_controller/README.md @@ -1,6 +1,6 @@ -# panther_controller +# husarion_ugv_controller -The package contains the default configuration and launch files necessary to start all the basic functionalities of the Husarion Panther robot. +The package contains the default configuration and launch files necessary to start all the basic functionalities of the Husarion UGV robots. ## Launch Files diff --git a/panther_controller/config/WH01_controller.yaml b/husarion_ugv_controller/config/WH01_controller.yaml similarity index 100% rename from panther_controller/config/WH01_controller.yaml rename to husarion_ugv_controller/config/WH01_controller.yaml diff --git a/panther_controller/config/WH02_controller.yaml b/husarion_ugv_controller/config/WH02_controller.yaml similarity index 100% rename from panther_controller/config/WH02_controller.yaml rename to husarion_ugv_controller/config/WH02_controller.yaml diff --git a/panther_controller/config/WH04_controller.yaml b/husarion_ugv_controller/config/WH04_controller.yaml similarity index 98% rename from panther_controller/config/WH04_controller.yaml rename to husarion_ugv_controller/config/WH04_controller.yaml index 25987350..b13bbd11 100644 --- a/panther_controller/config/WH04_controller.yaml +++ b/husarion_ugv_controller/config/WH04_controller.yaml @@ -32,7 +32,7 @@ wheel_separation: 0.616 wheel_radius: 0.1016 - # todo: check it for panther + # TODO: check it # For skid drive kinematics it will act as ICR coefficient, kinematic model with ICR # coefficient isn't totally accurate and this coefficient can differ for various ground types wheel_separation_multiplier: 1.0 diff --git a/panther_controller/config/WH05_controller.yaml b/husarion_ugv_controller/config/WH05_controller.yaml similarity index 100% rename from panther_controller/config/WH05_controller.yaml rename to husarion_ugv_controller/config/WH05_controller.yaml diff --git a/panther_controller/launch/controller.launch.py b/husarion_ugv_controller/launch/controller.launch.py similarity index 97% rename from panther_controller/launch/controller.launch.py rename to husarion_ugv_controller/launch/controller.launch.py index adf83965..2e61a370 100644 --- a/panther_controller/launch/controller.launch.py +++ b/husarion_ugv_controller/launch/controller.launch.py @@ -52,8 +52,8 @@ def generate_launch_description(): ), description=( "Additional components configuration file. Components described in this file " - "are dynamically included in Panther's urdf." - "Panther options are described here " + "are dynamically included in robot's URDF." + "Available options are described in the manual: " "https://husarion.com/manuals/panther/panther-options/" ), ) @@ -64,14 +64,14 @@ def generate_launch_description(): "controller_config_path", default_value=PathJoinSubstitution( [ - FindPackageShare("panther_controller"), + FindPackageShare("husarion_ugv_controller"), "config", PythonExpression(["'", wheel_type, "_controller.yaml'"]), ] ), description=( "Path to controller configuration file. By default, it is located in" - " 'panther_controller/config/{wheel_type}_controller.yaml'. You can also specify" + " 'husarion_ugv_controller/config/{wheel_type}_controller.yaml'. You can also specify" " the path to your custom controller configuration file here. " ), ) diff --git a/panther_controller/package.xml b/husarion_ugv_controller/package.xml similarity index 88% rename from panther_controller/package.xml rename to husarion_ugv_controller/package.xml index 6dea3a07..ec8101f4 100644 --- a/panther_controller/package.xml +++ b/husarion_ugv_controller/package.xml @@ -1,9 +1,9 @@ - panther_controller + husarion_ugv_controller 2.1.1 - ros2 controllers configuration for Panther + ros2 controllers configuration for Husarion UGV robots Husarion Apache License 2.0 @@ -18,6 +18,7 @@ controller_manager diff_drive_controller + husarion_ugv_hardware_interfaces imu_sensor_broadcaster joint_state_broadcaster launch @@ -25,7 +26,6 @@ lynx_description mecanum_drive_controller panther_description - panther_hardware_interfaces robot_state_publisher xacro diff --git a/panther_diagnostics/CHANGELOG.rst b/husarion_ugv_diagnostics/CHANGELOG.rst similarity index 100% rename from panther_diagnostics/CHANGELOG.rst rename to husarion_ugv_diagnostics/CHANGELOG.rst diff --git a/panther_diagnostics/CMakeLists.txt b/husarion_ugv_diagnostics/CMakeLists.txt similarity index 97% rename from panther_diagnostics/CMakeLists.txt rename to husarion_ugv_diagnostics/CMakeLists.txt index 8794efbe..64b9751d 100644 --- a/panther_diagnostics/CMakeLists.txt +++ b/husarion_ugv_diagnostics/CMakeLists.txt @@ -8,7 +8,7 @@ if(USE_SUPERBUILD) include(cmake/SuperBuild.cmake) return() else() - project(panther_diagnostics) + project(husarion_ugv_diagnostics) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -21,7 +21,7 @@ set(PACKAGE_DEPENDENCIES diagnostic_updater generate_parameter_library panther_msgs - panther_utils + husarion_ugv_utils PkgConfig rclcpp std_msgs) diff --git a/panther_diagnostics/README.md b/husarion_ugv_diagnostics/README.md similarity index 95% rename from panther_diagnostics/README.md rename to husarion_ugv_diagnostics/README.md index d3e213bb..542a05ad 100644 --- a/panther_diagnostics/README.md +++ b/husarion_ugv_diagnostics/README.md @@ -1,6 +1,6 @@ -# panther_diagnostics +# husarion_ugv_diagnostics -Package containing nodes monitoring and publishing the Built-in Computer status of Husarion Panther robot. +Package containing nodes monitoring and publishing the Built-in Computer status of Husarion UGV robots. ## Launch Files diff --git a/panther_diagnostics/cmake/SuperBuild.cmake b/husarion_ugv_diagnostics/cmake/SuperBuild.cmake similarity index 97% rename from panther_diagnostics/cmake/SuperBuild.cmake rename to husarion_ugv_diagnostics/cmake/SuperBuild.cmake index 4370b4cd..83fdadbb 100644 --- a/panther_diagnostics/cmake/SuperBuild.cmake +++ b/husarion_ugv_diagnostics/cmake/SuperBuild.cmake @@ -30,7 +30,7 @@ ExternalProject_Add( BUILD_IN_SOURCE 1) ExternalProject_Add( - ep_panther_diagnostics + ep_husarion_ugv_diagnostics DEPENDS ${DEPENDENCIES} SOURCE_DIR ${PROJECT_SOURCE_DIR} CMAKE_ARGS -DUSE_SUPERBUILD=OFF diff --git a/panther_diagnostics/config/system_monitor.yaml b/husarion_ugv_diagnostics/config/system_monitor.yaml similarity index 100% rename from panther_diagnostics/config/system_monitor.yaml rename to husarion_ugv_diagnostics/config/system_monitor.yaml diff --git a/panther_diagnostics/include/panther_diagnostics/filesystem.hpp b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/filesystem.hpp similarity index 93% rename from panther_diagnostics/include/panther_diagnostics/filesystem.hpp rename to husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/filesystem.hpp index fa2291d6..17825312 100644 --- a/panther_diagnostics/include/panther_diagnostics/filesystem.hpp +++ b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/filesystem.hpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_DIAGNOSTICS_FILESYSTEM_HPP_ -#define PANTHER_DIAGNOSTICS_FILESYSTEM_HPP_ +#ifndef HUSARION_UGV_DIAGNOSTICS_FILESYSTEM_HPP_ +#define HUSARION_UGV_DIAGNOSTICS_FILESYSTEM_HPP_ #include #include -namespace panther_diagnostics +namespace husarion_ugv_diagnostics { /** @@ -110,6 +110,6 @@ class Filesystem : public FilesystemInterface } }; -} // namespace panther_diagnostics +} // namespace husarion_ugv_diagnostics -#endif // PANTHER_DIAGNOSTICS_FILESYSTEM_HPP_ +#endif // HUSARION_UGV_DIAGNOSTICS_FILESYSTEM_HPP_ diff --git a/panther_diagnostics/include/panther_diagnostics/system_monitor_node.hpp b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/system_monitor_node.hpp similarity index 87% rename from panther_diagnostics/include/panther_diagnostics/system_monitor_node.hpp rename to husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/system_monitor_node.hpp index c840a246..0532822f 100644 --- a/panther_diagnostics/include/panther_diagnostics/system_monitor_node.hpp +++ b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/system_monitor_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ -#define PANTHER_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ +#ifndef HUSARION_UGV_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ +#define HUSARION_UGV_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ #include @@ -24,12 +24,12 @@ #include "system_monitor_parameters.hpp" -#include "panther_diagnostics/filesystem.hpp" -#include "panther_diagnostics/types.hpp" +#include "husarion_ugv_diagnostics/filesystem.hpp" +#include "husarion_ugv_diagnostics/types.hpp" using namespace std::chrono_literals; -namespace panther_diagnostics +namespace husarion_ugv_diagnostics { class SystemMonitorNode : public rclcpp::Node @@ -81,5 +81,5 @@ class SystemMonitorNode : public rclcpp::Node static constexpr char kTemperatureInfoFilename[] = "/sys/class/thermal/thermal_zone0/temp"; static constexpr char kRootDirectory[] = "/"; }; -} // namespace panther_diagnostics -#endif // PANTHER_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ +} // namespace husarion_ugv_diagnostics +#endif // HUSARION_UGV_DIAGNOSTICS_SYSTEM_MONITOR_NODE_HPP_ diff --git a/panther_diagnostics/include/panther_diagnostics/types.hpp b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/types.hpp similarity index 82% rename from panther_diagnostics/include/panther_diagnostics/types.hpp rename to husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/types.hpp index 1ed2c88c..4108b56d 100644 --- a/panther_diagnostics/include/panther_diagnostics/types.hpp +++ b/husarion_ugv_diagnostics/include/husarion_ugv_diagnostics/types.hpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_DIAGNOSTICS_TYPES_HPP_ -#define PANTHER_DIAGNOSTICS_TYPES_HPP_ +#ifndef HUSARION_UGV_DIAGNOSTICS_TYPES_HPP_ +#define HUSARION_UGV_DIAGNOSTICS_TYPES_HPP_ #include -namespace panther_diagnostics +namespace husarion_ugv_diagnostics { /** @@ -35,6 +35,6 @@ struct SystemStatus float disk_usage; }; -} // namespace panther_diagnostics +} // namespace husarion_ugv_diagnostics -#endif // PANTHER_DIAGNOSTICS_TYPES_HPP_ +#endif // HUSARION_UGV_DIAGNOSTICS_TYPES_HPP_ diff --git a/panther_diagnostics/launch/system_monitor.launch.py b/husarion_ugv_diagnostics/launch/system_monitor.launch.py similarity index 97% rename from panther_diagnostics/launch/system_monitor.launch.py rename to husarion_ugv_diagnostics/launch/system_monitor.launch.py index e2d2ab70..34a82815 100644 --- a/panther_diagnostics/launch/system_monitor.launch.py +++ b/husarion_ugv_diagnostics/launch/system_monitor.launch.py @@ -29,7 +29,7 @@ def generate_launch_description(): ) system_monitor_node = Node( - package="panther_diagnostics", + package="husarion_ugv_diagnostics", executable="system_monitor_node", name="system_monitor", namespace=namespace, diff --git a/panther_diagnostics/package.xml b/husarion_ugv_diagnostics/package.xml similarity index 87% rename from panther_diagnostics/package.xml rename to husarion_ugv_diagnostics/package.xml index 9f827b6d..fe6258e0 100644 --- a/panther_diagnostics/package.xml +++ b/husarion_ugv_diagnostics/package.xml @@ -1,9 +1,9 @@ - panther_diagnostics + husarion_ugv_diagnostics 2.1.1 - Package for diagnosting usage of OS on the Panther Robot + Package for diagnosting usage of OS on the Husarion UGV robot Husarion Apache License 2.0 @@ -20,8 +20,8 @@ diagnostic_msgs diagnostic_updater generate_parameter_library + husarion_ugv_utils panther_msgs - panther_utils rclcpp std_msgs diff --git a/panther_diagnostics/src/main.cpp b/husarion_ugv_diagnostics/src/main.cpp similarity index 80% rename from panther_diagnostics/src/main.cpp rename to husarion_ugv_diagnostics/src/main.cpp index 8d09517f..61cb38cc 100644 --- a/panther_diagnostics/src/main.cpp +++ b/husarion_ugv_diagnostics/src/main.cpp @@ -18,15 +18,15 @@ #include -#include "panther_diagnostics/filesystem.hpp" -#include "panther_diagnostics/system_monitor_node.hpp" +#include "husarion_ugv_diagnostics/filesystem.hpp" +#include "husarion_ugv_diagnostics/system_monitor_node.hpp" int main(int argc, char ** argv) { rclcpp::init(argc, argv); - auto filesystem = std::make_shared(); - auto system_monitor_node = std::make_shared( + auto filesystem = std::make_shared(); + auto system_monitor_node = std::make_shared( "system_monitor", filesystem); try { diff --git a/panther_diagnostics/src/system_monitor_node.cpp b/husarion_ugv_diagnostics/src/system_monitor_node.cpp similarity index 89% rename from panther_diagnostics/src/system_monitor_node.cpp rename to husarion_ugv_diagnostics/src/system_monitor_node.cpp index bc921a75..f25bcbe3 100644 --- a/panther_diagnostics/src/system_monitor_node.cpp +++ b/husarion_ugv_diagnostics/src/system_monitor_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_diagnostics/system_monitor_node.hpp" +#include "husarion_ugv_diagnostics/system_monitor_node.hpp" #include #include @@ -24,13 +24,13 @@ #include "panther_msgs/msg/system_status.hpp" -#include "panther_utils/common_utilities.hpp" -#include "panther_utils/ros_utils.hpp" +#include "husarion_ugv_utils/common_utilities.hpp" +#include "husarion_ugv_utils/ros_utils.hpp" -#include "panther_diagnostics/filesystem.hpp" -#include "panther_diagnostics/types.hpp" +#include "husarion_ugv_diagnostics/filesystem.hpp" +#include "husarion_ugv_diagnostics/types.hpp" -namespace panther_diagnostics +namespace husarion_ugv_diagnostics { SystemMonitorNode::SystemMonitorNode( @@ -101,7 +101,7 @@ float SystemMonitorNode::GetCPUMeanUsage(const std::vector & usages) cons }); auto sum = std::accumulate(usages.begin(), usages.end(), 0.0); - auto mean_usage = panther_utils::common_utilities::SetPrecision(sum / usages.size(), 2); + auto mean_usage = husarion_ugv_utils::common_utilities::SetPrecision(sum / usages.size(), 2); return mean_usage; } @@ -112,7 +112,7 @@ float SystemMonitorNode::GetCPUTemperature() const try { const auto temperature_str = filesystem_->ReadFile(kTemperatureInfoFilename); - temperature = panther_utils::common_utilities::SetPrecision( + temperature = husarion_ugv_utils::common_utilities::SetPrecision( std::stof(temperature_str) / 1000.0, 2); } catch (const std::exception & e) { RCLCPP_ERROR_STREAM( @@ -127,7 +127,8 @@ float SystemMonitorNode::GetRAMUsage() const int total = 0, free = 0, available = 0; uprofile::getSystemMemory(total, available, free); - const auto ram_usage = panther_utils::common_utilities::CountPercentage(total - available, total); + const auto ram_usage = husarion_ugv_utils::common_utilities::CountPercentage( + total - available, total); return ram_usage; } @@ -138,7 +139,8 @@ float SystemMonitorNode::GetDiskUsage() const try { const auto capacity = filesystem_->GetSpaceCapacity(kRootDirectory); const auto available = filesystem_->GetSpaceAvailable(kRootDirectory); - disk_usage = panther_utils::common_utilities::CountPercentage(capacity - available, capacity); + disk_usage = husarion_ugv_utils::common_utilities::CountPercentage( + capacity - available, capacity); } catch (const std::exception & e) { RCLCPP_ERROR_STREAM( this->get_logger(), "An exception occurred while reading disk usage: " << e.what()); @@ -196,4 +198,4 @@ void SystemMonitorNode::DiagnoseSystem(diagnostic_updater::DiagnosticStatusWrapp status.summary(error_level, message); } -} // namespace panther_diagnostics +} // namespace husarion_ugv_diagnostics diff --git a/panther_diagnostics/test/integration/system_monitor_node.test.py b/husarion_ugv_diagnostics/test/integration/system_monitor_node.test.py similarity index 97% rename from panther_diagnostics/test/integration/system_monitor_node.test.py rename to husarion_ugv_diagnostics/test/integration/system_monitor_node.test.py index dc895713..53b34bd4 100644 --- a/panther_diagnostics/test/integration/system_monitor_node.test.py +++ b/husarion_ugv_diagnostics/test/integration/system_monitor_node.test.py @@ -30,7 +30,7 @@ def generate_test_description(): system_monitor_node = Node( - package="panther_diagnostics", + package="husarion_ugv_diagnostics", executable="system_monitor_node", ) diff --git a/panther_diagnostics/test/unit/test_filesystem.cpp b/husarion_ugv_diagnostics/test/unit/test_filesystem.cpp similarity index 91% rename from panther_diagnostics/test/unit/test_filesystem.cpp rename to husarion_ugv_diagnostics/test/unit/test_filesystem.cpp index 3e9c8755..24f7a654 100644 --- a/panther_diagnostics/test/unit/test_filesystem.cpp +++ b/husarion_ugv_diagnostics/test/unit/test_filesystem.cpp @@ -18,7 +18,7 @@ #include #include -#include "panther_diagnostics/filesystem.hpp" +#include "husarion_ugv_diagnostics/filesystem.hpp" class TestFilesystem : public testing::Test { @@ -29,12 +29,13 @@ class TestFilesystem : public testing::Test void RemoveTestFile(const std::string & file_path); protected: - std::shared_ptr filesystem_; + std::shared_ptr filesystem_; static constexpr char kDummyString[] = "Hello World!"; }; -TestFilesystem::TestFilesystem() : filesystem_(std::make_shared()) +TestFilesystem::TestFilesystem() +: filesystem_(std::make_shared()) { } diff --git a/panther_diagnostics/test/unit/test_system_monitor_node.cpp b/husarion_ugv_diagnostics/test/unit/test_system_monitor_node.cpp similarity index 83% rename from panther_diagnostics/test/unit/test_system_monitor_node.cpp rename to husarion_ugv_diagnostics/test/unit/test_system_monitor_node.cpp index 8c93ff24..dd6ad053 100644 --- a/panther_diagnostics/test/unit/test_system_monitor_node.cpp +++ b/husarion_ugv_diagnostics/test/unit/test_system_monitor_node.cpp @@ -20,10 +20,10 @@ #include #include -#include "panther_diagnostics/filesystem.hpp" -#include "panther_diagnostics/system_monitor_node.hpp" +#include "husarion_ugv_diagnostics/filesystem.hpp" +#include "husarion_ugv_diagnostics/system_monitor_node.hpp" -class MockFilesystem : public panther_diagnostics::FilesystemInterface +class MockFilesystem : public husarion_ugv_diagnostics::FilesystemInterface { public: MOCK_METHOD( @@ -35,38 +35,38 @@ class MockFilesystem : public panther_diagnostics::FilesystemInterface MOCK_METHOD(std::string, ReadFile, (const std::string & file_path), (const, override)); }; -class SystemMonitorNodeWrapper : public panther_diagnostics::SystemMonitorNode +class SystemMonitorNodeWrapper : public husarion_ugv_diagnostics::SystemMonitorNode { public: SystemMonitorNodeWrapper(std::shared_ptr filesystem) - : panther_diagnostics::SystemMonitorNode("test_system_statics", filesystem) + : husarion_ugv_diagnostics::SystemMonitorNode("test_system_statics", filesystem) { } std::vector GetCoresUsages() const { - return panther_diagnostics::SystemMonitorNode::GetCoresUsages(); + return husarion_ugv_diagnostics::SystemMonitorNode::GetCoresUsages(); } float GetCPUMeanUsage(const std::vector & usages) const { - return panther_diagnostics::SystemMonitorNode::GetCPUMeanUsage(usages); + return husarion_ugv_diagnostics::SystemMonitorNode::GetCPUMeanUsage(usages); } float GetCPUTemperature() const { - return panther_diagnostics::SystemMonitorNode::GetCPUTemperature(); + return husarion_ugv_diagnostics::SystemMonitorNode::GetCPUTemperature(); } - float GetRAMUsage() const { return panther_diagnostics::SystemMonitorNode::GetRAMUsage(); } + float GetRAMUsage() const { return husarion_ugv_diagnostics::SystemMonitorNode::GetRAMUsage(); } - float GetDiskUsage() const { return panther_diagnostics::SystemMonitorNode::GetDiskUsage(); } + float GetDiskUsage() const { return husarion_ugv_diagnostics::SystemMonitorNode::GetDiskUsage(); } panther_msgs::msg::SystemStatus SystemStatusToMessage( - const panther_diagnostics::SystemStatus & status) + const husarion_ugv_diagnostics::SystemStatus & status) { - return panther_diagnostics::SystemMonitorNode::SystemStatusToMessage(status); + return husarion_ugv_diagnostics::SystemMonitorNode::SystemStatusToMessage(status); } }; @@ -160,7 +160,7 @@ TEST_F(TestSystemMonitorNode, GetDiskUsageInvalidFilesystem) TEST_F(TestSystemMonitorNode, SystemStatusToMessage) { - panther_diagnostics::SystemStatus test_status; + husarion_ugv_diagnostics::SystemStatus test_status; test_status.core_usages = {50.0, 50.0, 50.0}; test_status.cpu_mean_usage = 50.0; test_status.cpu_temperature = 36.6; diff --git a/panther_gazebo/CHANGELOG.rst b/husarion_ugv_gazebo/CHANGELOG.rst similarity index 100% rename from panther_gazebo/CHANGELOG.rst rename to husarion_ugv_gazebo/CHANGELOG.rst diff --git a/panther_gazebo/CMakeLists.txt b/husarion_ugv_gazebo/CMakeLists.txt similarity index 82% rename from panther_gazebo/CMakeLists.txt rename to husarion_ugv_gazebo/CMakeLists.txt index cae0aaa3..ae06fd9c 100644 --- a/panther_gazebo/CMakeLists.txt +++ b/husarion_ugv_gazebo/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_gazebo) +project(husarion_ugv_gazebo) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) @@ -28,21 +28,21 @@ find_package(Qt5 REQUIRED COMPONENTS Core Quick QuickControls2) include_directories(include ${Qt5Core_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${Qt5Quick_INCLUDE_DIRS} ${Qt5QuickControls2_INCLUDE_DIRS}) -add_library(panther_simulation_plugins SHARED src/gz_panther_system.cpp) +add_library(estop_system_plugins SHARED src/estop_system.cpp) ament_target_dependencies( - panther_simulation_plugins + estop_system_plugins hardware_interface ign_ros2_control rclcpp rclcpp_lifecycle std_msgs std_srvs) -target_link_libraries(panther_simulation_plugins ignition-gazebo6) +target_link_libraries(estop_system_plugins ignition-gazebo6) set(CMAKE_AUTOMOC ON) qt5_add_resources(resources_rcc src/gui/EStop.qrc) -add_library(EStop SHARED include/panther_gazebo/gui/e_stop.hpp +add_library(EStop SHARED include/husarion_ugv_gazebo/gui/e_stop.hpp src/gui/e_stop.cpp ${resources_rcc}) ament_target_dependencies(EStop rclcpp std_srvs) target_link_libraries( @@ -60,7 +60,7 @@ target_link_libraries(LEDStrip ignition-gazebo6 ignition-msgs8 ignition-plugin1 ignition-transport11) install( - TARGETS panther_simulation_plugins + TARGETS estop_system_plugins RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) @@ -86,8 +86,7 @@ endif() ament_export_include_directories(include) -pluginlib_export_plugin_description_file(ign_ros2_control - panther_simulation_plugins.xml) +pluginlib_export_plugin_description_file(ign_ros2_control plugins.xml) ament_environment_hooks( "${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.sh.in") diff --git a/panther_gazebo/CONFIGURATION.md b/husarion_ugv_gazebo/CONFIGURATION.md similarity index 71% rename from panther_gazebo/CONFIGURATION.md rename to husarion_ugv_gazebo/CONFIGURATION.md index d83baf52..3ad174b3 100644 --- a/panther_gazebo/CONFIGURATION.md +++ b/husarion_ugv_gazebo/CONFIGURATION.md @@ -1,8 +1,8 @@ -# panther_gazebo +# husarion_ugv_gazebo ## Use of GPS in Simulation -The NavSat system is utilized to publish the Panther robot's position within the Gazebo world. It manages navigation satellite sensors, such as GPS, which report position and velocity in spherical coordinates (latitude/longitude) through Ignition Transport. +The NavSat system is utilized to publish the robot's position within the Gazebo world. It manages navigation satellite sensors, such as GPS, which report position and velocity in spherical coordinates (latitude/longitude) through Ignition Transport. The NavSat sensors requires the spherical coordinates of the world origin to be configured. This configuration can be accomplished, for instance, by employing the `` tag within the world's SDF or by utilizing the Ignition `/world/world_name/set_spherical_coordinates` service. @@ -33,12 +33,12 @@ To obtain GPS data in Ignition, follow these steps: ## Linear Battery Plugin -It is possible to simulate the battery operation of the Panther robot. By default, this feature is disabled, but you can enable it by setting the `simulate_discharging` parameter to `true` in the `battery_plugin.yaml` file or in the file pointed to by the `battery_config_path` parameter. Below, you will find the plugin parameters that enable battery simulation. +It is possible to simulate the battery operation of the simulated robot. By default, this feature is disabled, but you can enable it by setting the `simulate_discharging` parameter to `true` in the `battery_plugin.yaml` file or in the file pointed to by the `battery_config_path` parameter. Below, you will find the plugin parameters that enable battery simulation. - `simulate_discharging` [*bool*, default: **false**]: Enables battery simulation. If set to `true`, the battery will discharge **at a constant rate** (regardless of joint torque), and if it depletes completely, the robot will stop moving. When set to `false`, the battery will not discharge, but the battery status information will still be published on the `battery/battery_status` topic. - `initial_charge_percentage` [*float*, default: **70.0**]: Sets the initial charge percentage of the battery. - `charging_time` [*float*, default: **6.0**]: Specifies the charging time for the battery in hours. -- `power_load` [*float*, default: **120.0**]: Represents the average power load during normal operation **[W]** and is initially set to 120.0 W. With the default power load of 120.0 W, the robot can operate for up to 8 hours. When the `simulate_discharging` parameter is set to `false`, this value defaults to 0.0 W. Users are encouraged to customize this value to match their specific requirements. For more information on Panther power consumption, please refer to [Panther Battery & Charging Documentation](https://husarion.com/manuals/panther/#battery--charging). +- `power_load` [*float*, default: **120.0**]: Represents the average power load during normal operation **[W]** and is initially set to 120.0 W. With the default power load of 120.0 W, the robot can operate for up to 8 hours. When the `simulate_discharging` parameter is set to `false`, this value defaults to 0.0 W. Users are encouraged to customize this value to match their specific requirements. For more information on robot power consumption, please refer to [Battery & Charging Documentation](https://husarion.com/manuals/panther/#battery--charging). > [!NOTE] > @@ -51,11 +51,11 @@ Unfortunately, there is no straightforward way to exchange `LinearBatteryPlugin` You can start the charging process by calling the Ignition service: ```bash -ign service --service /model/panther/battery/battery/recharge/start --reqtype ignition.msgs.Boolean --reptype ignition.msgs.Empty --req '' --timeout 0 +ign service --service /model/{robot_model}/battery/battery/recharge/start --reqtype ignition.msgs.Boolean --reptype ignition.msgs.Empty --req '' --timeout 0 ``` and stop it using: ```bash -ign service --service /model/panther/battery/battery/recharge/stop --reqtype ignition.msgs.Boolean --reptype ignition.msgs.Empty --req '' --timeout 0 +ign service --service /model/{robot_model}/battery/battery/recharge/stop --reqtype ignition.msgs.Boolean --reptype ignition.msgs.Empty --req '' --timeout 0 ``` diff --git a/panther_gazebo/README.md b/husarion_ugv_gazebo/README.md similarity index 98% rename from panther_gazebo/README.md rename to husarion_ugv_gazebo/README.md index 7a818915..3b573404 100644 --- a/panther_gazebo/README.md +++ b/husarion_ugv_gazebo/README.md @@ -1,4 +1,4 @@ -# panther_gazebo +# husarion_ugv_gazebo The package contains a launch file and source files used to run the robot simulation in Gazebo. The simulator tries to reproduce the behavior of a real robot as much as possible, including the provision of an analogous ROS_API. @@ -26,7 +26,7 @@ The package contains a launch file and source files used to run the robot simula - `hardware/e_stop_reset` [*std_srvs/Trigger*]: Resets E-stop. - `hardware/e_stop_trigger` [*std_srvs/Trigger*]: Triggers E-stop. -### GzPantherSystem +### EStopSystem Plugin based on `ign_system` is responsible for handling sensor interfaces (only IMU for now) and sending requests for joints compatible with `ros2_control`. Plugin also adds E-Stop support. diff --git a/panther_gazebo/config/battery_plugin.yaml b/husarion_ugv_gazebo/config/battery_plugin.yaml similarity index 82% rename from panther_gazebo/config/battery_plugin.yaml rename to husarion_ugv_gazebo/config/battery_plugin.yaml index 45eaac5e..2564ebc3 100644 --- a/panther_gazebo/config/battery_plugin.yaml +++ b/husarion_ugv_gazebo/config/battery_plugin.yaml @@ -1,6 +1,6 @@ # Parameters for the Gazebo LinearBatteryPlugin -# For more information on Panther power consumption, please refer to: -# https://husarion.com/manuals/panther/#battery--charging +# For more information on robots power consumption, please refer to: +# Panther: https://husarion.com/manuals/panther/#battery--charging # If set to true, the battery will discharge and if it depletes completely, the robot will stop moving. simulate_discharging: false diff --git a/panther_gazebo/config/gz_bridge.yaml b/husarion_ugv_gazebo/config/gz_bridge.yaml similarity index 100% rename from panther_gazebo/config/gz_bridge.yaml rename to husarion_ugv_gazebo/config/gz_bridge.yaml diff --git a/panther_gazebo/config/teleop_with_estop.config b/husarion_ugv_gazebo/config/teleop_with_estop.config similarity index 100% rename from panther_gazebo/config/teleop_with_estop.config rename to husarion_ugv_gazebo/config/teleop_with_estop.config diff --git a/panther_gazebo/hooks/panther_gazebo.sh.in b/husarion_ugv_gazebo/hooks/husarion_ugv_gazebo.sh.in similarity index 100% rename from panther_gazebo/hooks/panther_gazebo.sh.in rename to husarion_ugv_gazebo/hooks/husarion_ugv_gazebo.sh.in diff --git a/panther_gazebo/include/panther_gazebo/gz_panther_system.hpp b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/estop_system.hpp similarity index 90% rename from panther_gazebo/include/panther_gazebo/gz_panther_system.hpp rename to husarion_ugv_gazebo/include/husarion_ugv_gazebo/estop_system.hpp index 6978fa71..3cb4742b 100644 --- a/panther_gazebo/include/panther_gazebo/gz_panther_system.hpp +++ b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/estop_system.hpp @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_GAZEBO_GZ_PANTHER_SYSTEM -#define PANTHER_GAZEBO_GZ_PANTHER_SYSTEM +#ifndef HUSARION_UGV_GAZEBO_ESTOP_SYSTEM +#define HUSARION_UGV_GAZEBO_ESTOP_SYSTEM #include @@ -27,7 +27,7 @@ #include #include -namespace panther_gazebo +namespace husarion_ugv_gazebo { using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn; using BoolMsg = std_msgs::msg::Bool; @@ -38,7 +38,7 @@ using TriggerSrv = std_srvs::srv::Trigger; * `hardware_interface::SystemInterface`. This class inherits `ign_ros2_control::IgnitionSystem` * and implements additional functionalities like E-stop handling. */ -class GzPantherSystem : public ign_ros2_control::IgnitionSystem +class EStopSystem : public ign_ros2_control::IgnitionSystem { public: CallbackReturn on_init(const hardware_interface::HardwareInfo & system_info) override; @@ -69,6 +69,6 @@ class GzPantherSystem : public ign_ros2_control::IgnitionSystem rclcpp::Service::SharedPtr e_stop_trigger_service_; }; -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo -#endif // PANTHER_GAZEBO_GZ_PANTHER_SYSTEM +#endif // HUSARION_UGV_GAZEBO_ESTOP_SYSTEM diff --git a/panther_gazebo/include/panther_gazebo/gui/e_stop.hpp b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/gui/e_stop.hpp similarity index 89% rename from panther_gazebo/include/panther_gazebo/gui/e_stop.hpp rename to husarion_ugv_gazebo/include/husarion_ugv_gazebo/gui/e_stop.hpp index 055db7e1..962f5b20 100644 --- a/panther_gazebo/include/panther_gazebo/gui/e_stop.hpp +++ b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/gui/e_stop.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_GAZEBO_GUI_E_STOP_HPP_ -#define PANTHER_GAZEBO_GUI_E_STOP_HPP_ +#ifndef HUSARION_UGV_GAZEBO_GUI_E_STOP_HPP_ +#define HUSARION_UGV_GAZEBO_GUI_E_STOP_HPP_ #include @@ -23,7 +23,7 @@ #include -namespace panther_gazebo +namespace husarion_ugv_gazebo { class EStop : public ignition::gui::Plugin @@ -59,6 +59,6 @@ protected slots: rclcpp::Client::SharedPtr e_stop_reset_client_; rclcpp::Client::SharedPtr e_stop_trigger_client_; }; -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo -#endif // PANTHER_GAZEBO_GUI_E_STOP_HPP_ +#endif // HUSARION_UGV_GAZEBO_GUI_E_STOP_HPP_ diff --git a/panther_gazebo/include/panther_gazebo/led_strip.hpp b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/led_strip.hpp similarity index 96% rename from panther_gazebo/include/panther_gazebo/led_strip.hpp rename to husarion_ugv_gazebo/include/husarion_ugv_gazebo/led_strip.hpp index 0f0945ea..74d76444 100644 --- a/panther_gazebo/include/panther_gazebo/led_strip.hpp +++ b/husarion_ugv_gazebo/include/husarion_ugv_gazebo/led_strip.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_GAZEBO_LED_STRIP_HPP_ -#define PANTHER_GAZEBO_LED_STRIP_HPP_ +#ifndef HUSARION_UGV_GAZEBO_LED_STRIP_HPP_ +#define HUSARION_UGV_GAZEBO_LED_STRIP_HPP_ #include #include @@ -33,7 +33,7 @@ #include #include -namespace panther_gazebo +namespace husarion_ugv_gazebo { /** @@ -144,6 +144,6 @@ class LEDStrip : public gz::sim::System, 1)}; // Avoid initialization errors when the robot is not yet spawned on the scene. }; -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo -#endif // PANTHER_GAZEBO_LED_STRIP_HPP_ +#endif // HUSARION_UGV_GAZEBO_LED_STRIP_HPP_ diff --git a/panther_gazebo/launch/simulate_robot.launch.py b/husarion_ugv_gazebo/launch/simulate_robot.launch.py similarity index 91% rename from panther_gazebo/launch/simulate_robot.launch.py rename to husarion_ugv_gazebo/launch/simulate_robot.launch.py index 2bd4f822..22c84d2b 100644 --- a/panther_gazebo/launch/simulate_robot.launch.py +++ b/husarion_ugv_gazebo/launch/simulate_robot.launch.py @@ -51,7 +51,7 @@ def generate_launch_description(): "This configuration is intended for use in simulations only." ), default_value=PathJoinSubstitution( - [FindPackageShare("panther_gazebo"), "config", "battery_plugin.yaml"] + [FindPackageShare("husarion_ugv_gazebo"), "config", "battery_plugin.yaml"] ), ) @@ -65,8 +65,8 @@ def generate_launch_description(): ), description=( "Additional components configuration file. Components described in this file " - "are dynamically included in Panther's urdf." - "Panther options are described here " + "are dynamically included in robot's URDF." + "Available options are described in the manual: " "https://husarion.com/manuals/panther/panther-options/" ), ) @@ -75,7 +75,7 @@ def generate_launch_description(): declare_gz_bridge_config_path_arg = DeclareLaunchArgument( "gz_bridge_config_path", default_value=PathJoinSubstitution( - [FindPackageShare("panther_gazebo"), "config", "gz_bridge.yaml"] + [FindPackageShare("husarion_ugv_gazebo"), "config", "gz_bridge.yaml"] ), description="Path to the parameter_bridge configuration file.", ) @@ -107,7 +107,7 @@ def generate_launch_description(): spawn_robot_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_gazebo"), "launch", "spawn_robot.launch.py"] + [FindPackageShare("husarion_ugv_gazebo"), "launch", "spawn_robot.launch.py"] ) ), launch_arguments={ @@ -119,7 +119,7 @@ def generate_launch_description(): lights_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_lights"), "launch", "lights.launch.py"] + [FindPackageShare("husarion_ugv_lights"), "launch", "lights.launch.py"] ) ), launch_arguments={"namespace": namespace, "use_sim": "True"}.items(), @@ -128,7 +128,7 @@ def generate_launch_description(): manager_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_manager"), "launch", "manager.launch.py"] + [FindPackageShare("husarion_ugv_manager"), "launch", "manager.launch.py"] ) ), launch_arguments={"namespace": namespace, "use_sim": "True"}.items(), @@ -138,7 +138,7 @@ def generate_launch_description(): PythonLaunchDescriptionSource( PathJoinSubstitution( [ - FindPackageShare("panther_controller"), + FindPackageShare("husarion_ugv_controller"), "launch", "controller.launch.py", ] @@ -155,7 +155,7 @@ def generate_launch_description(): PythonLaunchDescriptionSource( PathJoinSubstitution( [ - FindPackageShare("panther_localization"), + FindPackageShare("husarion_ugv_localization"), "launch", "localization.launch.py", ] @@ -192,7 +192,7 @@ def generate_launch_description(): gz_bridge = Node( package="ros_gz_bridge", executable="parameter_bridge", - name="panther_base_gz_bridge", + name="base_gz_bridge", parameters=[{"config_file": namespaced_gz_bridge_config_path}], namespace=namespace, emulate_tty=True, diff --git a/panther_gazebo/launch/simulation.launch.py b/husarion_ugv_gazebo/launch/simulation.launch.py similarity index 94% rename from panther_gazebo/launch/simulation.launch.py rename to husarion_ugv_gazebo/launch/simulation.launch.py index 5ea18720..cf2e78de 100644 --- a/panther_gazebo/launch/simulation.launch.py +++ b/husarion_ugv_gazebo/launch/simulation.launch.py @@ -33,7 +33,7 @@ def generate_launch_description(): declare_gz_gui = DeclareLaunchArgument( "gz_gui", default_value=PathJoinSubstitution( - [FindPackageShare("panther_gazebo"), "config", "teleop_with_estop.config"] + [FindPackageShare("husarion_ugv_gazebo"), "config", "teleop_with_estop.config"] ), description="Run simulation with specific GUI layout.", ) @@ -63,7 +63,7 @@ def generate_launch_description(): PythonLaunchDescriptionSource( PathJoinSubstitution( [ - FindPackageShare("panther_gazebo"), + FindPackageShare("husarion_ugv_gazebo"), "launch", "simulate_robot.launch.py", ] diff --git a/panther_gazebo/launch/spawn_robot.launch.py b/husarion_ugv_gazebo/launch/spawn_robot.launch.py similarity index 98% rename from panther_gazebo/launch/spawn_robot.launch.py rename to husarion_ugv_gazebo/launch/spawn_robot.launch.py index 624586ba..39a47a2c 100644 --- a/panther_gazebo/launch/spawn_robot.launch.py +++ b/husarion_ugv_gazebo/launch/spawn_robot.launch.py @@ -16,6 +16,7 @@ import os +from husarion_ugv_utils.messages import welcome_msg from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource @@ -27,7 +28,6 @@ ) from launch_ros.actions import Node, SetUseSimTime from launch_ros.substitutions import FindPackageShare -from panther_utils.messages import welcome_msg def generate_launch_description(): diff --git a/panther_gazebo/package.xml b/husarion_ugv_gazebo/package.xml similarity index 93% rename from panther_gazebo/package.xml rename to husarion_ugv_gazebo/package.xml index faa23cdd..186f663b 100644 --- a/panther_gazebo/package.xml +++ b/husarion_ugv_gazebo/package.xml @@ -1,7 +1,7 @@ - panther_gazebo + husarion_ugv_gazebo 2.1.1 The panther_description package Husarion @@ -29,16 +29,16 @@ controller_manager husarion_gz_worlds + husarion_ugv_controller + husarion_ugv_lights + husarion_ugv_localization + husarion_ugv_manager + husarion_ugv_utils launch launch_ros lynx_description nav2_common - panther_controller panther_description - panther_lights - panther_localization - panther_manager - panther_utils robot_state_publisher ros_components_description ros_gz_bridge diff --git a/panther_gazebo/panther_simulation_plugins.xml b/husarion_ugv_gazebo/plugins.xml similarity index 62% rename from panther_gazebo/panther_simulation_plugins.xml rename to husarion_ugv_gazebo/plugins.xml index 7a0aef76..e25a8bce 100644 --- a/panther_gazebo/panther_simulation_plugins.xml +++ b/husarion_ugv_gazebo/plugins.xml @@ -1,7 +1,7 @@ - + Control joints position with E-Stop functionalities in Gazebo using ROS2. diff --git a/panther_gazebo/src/gz_panther_system.cpp b/husarion_ugv_gazebo/src/estop_system.cpp similarity index 82% rename from panther_gazebo/src/gz_panther_system.cpp rename to husarion_ugv_gazebo/src/estop_system.cpp index d705d716..4f37923f 100644 --- a/panther_gazebo/src/gz_panther_system.cpp +++ b/husarion_ugv_gazebo/src/estop_system.cpp @@ -28,7 +28,7 @@ #include #include -#include "panther_gazebo/gz_panther_system.hpp" +#include "husarion_ugv_gazebo/estop_system.hpp" struct jointData { @@ -94,10 +94,10 @@ class ign_ros2_control::IgnitionSystemPrivate double position_proportional_gain_; }; -namespace panther_gazebo +namespace husarion_ugv_gazebo { -CallbackReturn GzPantherSystem::on_init(const hardware_interface::HardwareInfo & system_info) +CallbackReturn EStopSystem::on_init(const hardware_interface::HardwareInfo & system_info) { if (hardware_interface::SystemInterface::on_init(system_info) != CallbackReturn::SUCCESS) { return CallbackReturn::ERROR; @@ -108,24 +108,24 @@ CallbackReturn GzPantherSystem::on_init(const hardware_interface::HardwareInfo & return CallbackReturn::SUCCESS; } -CallbackReturn GzPantherSystem::on_configure(const rclcpp_lifecycle::State & previous_state) +CallbackReturn EStopSystem::on_configure(const rclcpp_lifecycle::State & previous_state) { SetupEStop(); return hardware_interface::SystemInterface::on_configure(previous_state); } -CallbackReturn GzPantherSystem::on_activate(const rclcpp_lifecycle::State & previous_state) +CallbackReturn EStopSystem::on_activate(const rclcpp_lifecycle::State & previous_state) { PublishEStopStatus(); return hardware_interface::SystemInterface::on_activate(previous_state); } -CallbackReturn GzPantherSystem::on_deactivate(const rclcpp_lifecycle::State & previous_state) +CallbackReturn EStopSystem::on_deactivate(const rclcpp_lifecycle::State & previous_state) { return hardware_interface::SystemInterface::on_deactivate(previous_state); } -hardware_interface::return_type GzPantherSystem::write( +hardware_interface::return_type EStopSystem::write( const rclcpp::Time & time, const rclcpp::Duration & period) { if (e_stop_active_) { @@ -135,7 +135,7 @@ hardware_interface::return_type GzPantherSystem::write( return IgnitionSystem::write(time, period); } -void GzPantherSystem::SetupEStop() +void EStopSystem::SetupEStop() { e_stop_publisher_ = nh_->create_publisher( "~/e_stop", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable()); @@ -143,22 +143,22 @@ void GzPantherSystem::SetupEStop() e_stop_reset_service_ = nh_->create_service( "~/e_stop_reset", std::bind( - &GzPantherSystem::EStopResetCallback, this, std::placeholders::_1, std::placeholders::_2)); + &EStopSystem::EStopResetCallback, this, std::placeholders::_1, std::placeholders::_2)); e_stop_trigger_service_ = nh_->create_service( "~/e_stop_trigger", std::bind( - &GzPantherSystem::EStopTriggerCallback, this, std::placeholders::_1, std::placeholders::_2)); + &EStopSystem::EStopTriggerCallback, this, std::placeholders::_1, std::placeholders::_2)); } -void GzPantherSystem::PublishEStopStatus() +void EStopSystem::PublishEStopStatus() { std_msgs::msg::Bool e_stop_msg; e_stop_msg.data = e_stop_active_; e_stop_publisher_->publish(e_stop_msg); } -void GzPantherSystem::EStopResetCallback( +void EStopSystem::EStopResetCallback( const TriggerSrv::Request::SharedPtr & /*request*/, TriggerSrv::Response::SharedPtr response) { e_stop_active_ = false; @@ -167,7 +167,7 @@ void GzPantherSystem::EStopResetCallback( PublishEStopStatus(); } -void GzPantherSystem::EStopTriggerCallback( +void EStopSystem::EStopTriggerCallback( const TriggerSrv::Request::SharedPtr & /*request*/, TriggerSrv::Response::SharedPtr response) { e_stop_active_ = true; @@ -176,7 +176,7 @@ void GzPantherSystem::EStopTriggerCallback( PublishEStopStatus(); } -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo #include "pluginlib/class_list_macros.hpp" // NOLINT -PLUGINLIB_EXPORT_CLASS(panther_gazebo::GzPantherSystem, ign_ros2_control::IgnitionSystemInterface) +PLUGINLIB_EXPORT_CLASS(husarion_ugv_gazebo::EStopSystem, ign_ros2_control::IgnitionSystemInterface) diff --git a/panther_gazebo/src/gui/EStop.qml b/husarion_ugv_gazebo/src/gui/EStop.qml similarity index 100% rename from panther_gazebo/src/gui/EStop.qml rename to husarion_ugv_gazebo/src/gui/EStop.qml diff --git a/panther_gazebo/src/gui/EStop.qrc b/husarion_ugv_gazebo/src/gui/EStop.qrc similarity index 100% rename from panther_gazebo/src/gui/EStop.qrc rename to husarion_ugv_gazebo/src/gui/EStop.qrc diff --git a/panther_gazebo/src/gui/e_stop.cpp b/husarion_ugv_gazebo/src/gui/e_stop.cpp similarity index 94% rename from panther_gazebo/src/gui/e_stop.cpp rename to husarion_ugv_gazebo/src/gui/e_stop.cpp index ff4c3010..ffad684d 100644 --- a/panther_gazebo/src/gui/e_stop.cpp +++ b/husarion_ugv_gazebo/src/gui/e_stop.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_gazebo/gui/e_stop.hpp" +#include "husarion_ugv_gazebo/gui/e_stop.hpp" #include @@ -23,7 +23,7 @@ #include -namespace panther_gazebo +namespace husarion_ugv_gazebo { EStop::EStop() : ignition::gui::Plugin() { rclcpp::init(0, nullptr); } @@ -90,6 +90,6 @@ void EStop::SetNamespace(const QString & ns) ignmsg << "Changed namespace to: " << namespace_ << std::endl; } -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo -IGNITION_ADD_PLUGIN(panther_gazebo::EStop, ignition::gui::Plugin) +IGNITION_ADD_PLUGIN(husarion_ugv_gazebo::EStop, ignition::gui::Plugin) diff --git a/panther_gazebo/src/led_strip.cpp b/husarion_ugv_gazebo/src/led_strip.cpp similarity index 97% rename from panther_gazebo/src/led_strip.cpp rename to husarion_ugv_gazebo/src/led_strip.cpp index c7820bb1..c0984620 100644 --- a/panther_gazebo/src/led_strip.cpp +++ b/husarion_ugv_gazebo/src/led_strip.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_gazebo/led_strip.hpp" +#include "husarion_ugv_gazebo/led_strip.hpp" #include #include @@ -25,7 +25,7 @@ #include #include -namespace panther_gazebo +namespace husarion_ugv_gazebo { void LEDStrip::Configure( const gz::sim::Entity & entity, const std::shared_ptr & sdf, @@ -275,8 +275,8 @@ void LEDStrip::CreateMarker( node_.Request("/marker", marker_msg); } -} // namespace panther_gazebo +} // namespace husarion_ugv_gazebo IGNITION_ADD_PLUGIN( - panther_gazebo::LEDStrip, gz::sim::System, panther_gazebo::LEDStrip::ISystemConfigure, - panther_gazebo::LEDStrip::ISystemPreUpdate) + husarion_ugv_gazebo::LEDStrip, gz::sim::System, husarion_ugv_gazebo::LEDStrip::ISystemConfigure, + husarion_ugv_gazebo::LEDStrip::ISystemPreUpdate) diff --git a/panther_hardware_interfaces/CHANGELOG.rst b/husarion_ugv_hardware_interfaces/CHANGELOG.rst similarity index 100% rename from panther_hardware_interfaces/CHANGELOG.rst rename to husarion_ugv_hardware_interfaces/CHANGELOG.rst diff --git a/panther_hardware_interfaces/CMakeLists.txt b/husarion_ugv_hardware_interfaces/CMakeLists.txt similarity index 93% rename from panther_hardware_interfaces/CMakeLists.txt rename to husarion_ugv_hardware_interfaces/CMakeLists.txt index 1728bd37..2f0d65fa 100644 --- a/panther_hardware_interfaces/CMakeLists.txt +++ b/husarion_ugv_hardware_interfaces/CMakeLists.txt @@ -8,7 +8,7 @@ if(USE_SUPERBUILD) include(cmake/SuperBuild.cmake) return() else() - project(panther_hardware_interfaces) + project(husarion_ugv_hardware_interfaces) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -24,7 +24,7 @@ set(PACKAGE_DEPENDENCIES hardware_interface imu_filter_madgwick panther_msgs - panther_utils + husarion_ugv_utils phidgets_api PkgConfig pluginlib @@ -72,11 +72,11 @@ ament_target_dependencies(${PROJECT_NAME} ${PACKAGE_DEPENDENCIES}) target_link_libraries(${PROJECT_NAME} PkgConfig::LIBLELY_COAPP PkgConfig::LIBGPIOD phidgets_spatial_parameters) -target_compile_definitions(${PROJECT_NAME} - PRIVATE "PANTHER_HARDWARE_INTERFACES_BUILDING_DLL") +target_compile_definitions( + ${PROJECT_NAME} PRIVATE "HUSARION_UGV_HARDWARE_INTERFACES_BUILDING_DLL") pluginlib_export_plugin_description_file(hardware_interface - panther_hardware_interfaces.xml) + husarion_ugv_hardware_interfaces.xml) install( TARGETS ${PROJECT_NAME} @@ -90,7 +90,7 @@ if(BUILD_TESTING) find_package(ament_cmake_gtest REQUIRED) find_package(ament_cmake_gmock REQUIRED) find_package(ros_testing REQUIRED) - find_package(panther_utils REQUIRED) + find_package(husarion_ugv_utils REQUIRED) install(DIRECTORY test/config DESTINATION share/${PROJECT_NAME}/test) @@ -100,7 +100,7 @@ if(BUILD_TESTING) test/panther_imu_sensor/test_panther_imu_sensor.cpp) ament_target_dependencies( ${PROJECT_NAME}_test_panther_imu_sensor hardware_interface rclcpp - panther_utils panther_msgs phidgets_api) + husarion_ugv_utils panther_msgs phidgets_api) target_link_libraries(${PROJECT_NAME}_test_panther_imu_sensor ${PROJECT_NAME} phidgets_spatial_parameters) @@ -118,7 +118,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_roboteq_data_converters - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_roboteq_data_converters PkgConfig::LIBLELY_COAPP) @@ -131,7 +131,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_canopen_manager rclcpp - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_canopen_manager PkgConfig::LIBLELY_COAPP) @@ -146,7 +146,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_roboteq_driver rclcpp - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_roboteq_driver PkgConfig::LIBLELY_COAPP) @@ -163,7 +163,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_roboteq_robot_driver rclcpp - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_roboteq_robot_driver PkgConfig::LIBLELY_COAPP) @@ -181,7 +181,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_lynx_robot_driver rclcpp - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_lynx_robot_driver PkgConfig::LIBLELY_COAPP) @@ -199,7 +199,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_panther_robot_driver rclcpp - panther_msgs panther_utils) + panther_msgs husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_panther_robot_driver PkgConfig::LIBLELY_COAPP) @@ -208,7 +208,8 @@ if(BUILD_TESTING) test/panther_system/gpio/test_gpio_controller.cpp src/panther_system/gpio/gpio_controller.cpp src/panther_system/gpio/gpio_driver.cpp) - ament_target_dependencies(${PROJECT_NAME}_test_gpiod_controller panther_utils) + ament_target_dependencies(${PROJECT_NAME}_test_gpiod_controller + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_gpiod_controller PkgConfig::LIBGPIOD) @@ -228,7 +229,7 @@ if(BUILD_TESTING) diagnostic_updater rclcpp panther_msgs - panther_utils + husarion_ugv_utils realtime_tools std_srvs) target_link_libraries(${PROJECT_NAME}_test_system_ros_interface @@ -256,7 +257,7 @@ if(BUILD_TESTING) hardware_interface rclcpp panther_msgs - panther_utils + husarion_ugv_utils std_msgs std_srvs) target_link_libraries(${PROJECT_NAME}_test_ugv_system @@ -289,7 +290,7 @@ if(BUILD_TESTING) hardware_interface rclcpp panther_msgs - panther_utils + husarion_ugv_utils std_msgs std_srvs) target_link_libraries(${PROJECT_NAME}_test_lynx_system @@ -323,7 +324,7 @@ if(BUILD_TESTING) hardware_interface rclcpp panther_msgs - panther_utils + husarion_ugv_utils std_msgs std_srvs) target_link_libraries(${PROJECT_NAME}_test_panther_system @@ -333,7 +334,8 @@ if(BUILD_TESTING) if(TEST_INTEGRATION) # Hardware integration ament_add_gtest(${PROJECT_NAME}_test_gpiod_driver test/panther_system/gpio/test_gpio_driver.cpp) - ament_target_dependencies(${PROJECT_NAME}_test_gpiod_driver panther_utils) + ament_target_dependencies(${PROJECT_NAME}_test_gpiod_driver + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_gpiod_driver ${PROJECT_NAME} PkgConfig::LIBGPIOD) endif() diff --git a/panther_hardware_interfaces/CODE_STRUCTURE.md b/husarion_ugv_hardware_interfaces/CODE_STRUCTURE.md similarity index 100% rename from panther_hardware_interfaces/CODE_STRUCTURE.md rename to husarion_ugv_hardware_interfaces/CODE_STRUCTURE.md diff --git a/panther_hardware_interfaces/README.md b/husarion_ugv_hardware_interfaces/README.md similarity index 98% rename from panther_hardware_interfaces/README.md rename to husarion_ugv_hardware_interfaces/README.md index 545dd777..36fd8643 100644 --- a/panther_hardware_interfaces/README.md +++ b/husarion_ugv_hardware_interfaces/README.md @@ -1,4 +1,4 @@ -# panther_hardware_interfaces +# husarion_ugv_hardware_interfaces Package that implements SystemInterface from ros2_control for Panther. @@ -158,8 +158,8 @@ sudo apt install -y kmod iproute2 ### Running tests ```bash -colcon build --packages-select panther_hardware_interfaces --symlink-install -colcon test --event-handlers console_direct+ --packages-select panther_hardware_interfaces --parallel-workers 1 +colcon build --packages-select husarion_ugv_hardware_interfaces --symlink-install +colcon test --event-handlers console_direct+ --packages-select husarion_ugv_hardware_interfaces --parallel-workers 1 colcon test-result --verbose --all ``` diff --git a/panther_hardware_interfaces/cmake/SuperBuild.cmake b/husarion_ugv_hardware_interfaces/cmake/SuperBuild.cmake similarity index 98% rename from panther_hardware_interfaces/cmake/SuperBuild.cmake rename to husarion_ugv_hardware_interfaces/cmake/SuperBuild.cmake index c7fca72e..685b8d1b 100644 --- a/panther_hardware_interfaces/cmake/SuperBuild.cmake +++ b/husarion_ugv_hardware_interfaces/cmake/SuperBuild.cmake @@ -46,7 +46,7 @@ ExternalProject_Add( BUILD_IN_SOURCE 1) ExternalProject_Add( - ep_panther_hardware_interfaces + ep_husarion_ugv_hardware_interfaces DEPENDS ${DEPENDENCIES} SOURCE_DIR ${PROJECT_SOURCE_DIR} CMAKE_ARGS -DUSE_SUPERBUILD=OFF diff --git a/panther_hardware_interfaces/config/canopen_configuration.yaml b/husarion_ugv_hardware_interfaces/config/canopen_configuration.yaml similarity index 100% rename from panther_hardware_interfaces/config/canopen_configuration.yaml rename to husarion_ugv_hardware_interfaces/config/canopen_configuration.yaml diff --git a/panther_hardware_interfaces/config/master.dcf b/husarion_ugv_hardware_interfaces/config/master.dcf similarity index 100% rename from panther_hardware_interfaces/config/master.dcf rename to husarion_ugv_hardware_interfaces/config/master.dcf diff --git a/panther_hardware_interfaces/config/phidgets_spatial_parameters.yaml b/husarion_ugv_hardware_interfaces/config/phidgets_spatial_parameters.yaml similarity index 100% rename from panther_hardware_interfaces/config/phidgets_spatial_parameters.yaml rename to husarion_ugv_hardware_interfaces/config/phidgets_spatial_parameters.yaml diff --git a/panther_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds b/husarion_ugv_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds similarity index 100% rename from panther_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds rename to husarion_ugv_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds diff --git a/panther_hardware_interfaces/panther_hardware_interfaces.xml b/husarion_ugv_hardware_interfaces/husarion_ugv_hardware_interfaces.xml similarity index 57% rename from panther_hardware_interfaces/panther_hardware_interfaces.xml rename to husarion_ugv_hardware_interfaces/husarion_ugv_hardware_interfaces.xml index dbb3512e..b87b1505 100644 --- a/panther_hardware_interfaces/panther_hardware_interfaces.xml +++ b/husarion_ugv_hardware_interfaces/husarion_ugv_hardware_interfaces.xml @@ -1,22 +1,22 @@ - - + Hardware system controller for Panther's Roboteq motor controller - Hardware system controller for Panther's Roboteq motor controller - Hardware IMU sensor for Panther's Phidget Spatial Inertial Measurement Unit diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp similarity index 94% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp index 5ac14ee4..640106f1 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ #include #include @@ -43,7 +43,7 @@ using namespace std::placeholders; -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { using return_type = hardware_interface::return_type; @@ -180,6 +180,6 @@ class PantherImuSensor : public hardware_interface::SensorInterface rclcpp::Time last_spatial_data_timestamp_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_IMU_SENSOR_PANTHER_IMU_SENSOR_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp similarity index 95% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp index 53315d8f..071b8ff0 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp @@ -17,8 +17,8 @@ * @brief Header file containing a higher-level wrapper for the GPIO driver. */ -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ #include #include @@ -29,12 +29,12 @@ #include "gpiod.hpp" -#include "panther_utils/common_utilities.hpp" +#include "husarion_ugv_utils/common_utilities.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/types.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { class EStopResetInterrupted : public std::exception @@ -403,7 +403,7 @@ class GPIOControllerFactory { std::unique_ptr gpio_controller; - if (panther_utils::common_utilities::MeetsVersionRequirement(robot_version, 1.2)) { + if (husarion_ugv_utils::common_utilities::MeetsVersionRequirement(robot_version, 1.2)) { auto config_info_storage = GPIOControllerPTH12X::GetGPIOConfigInfoStorage(); auto gpio_driver = std::make_shared(config_info_storage); @@ -419,6 +419,6 @@ class GPIOControllerFactory }; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_CONTROLLER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp similarity index 95% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp index e46775fc..a1a194a4 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ #include #include @@ -29,9 +29,9 @@ #include "gpiod.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/types.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { class GPIODriverInterface @@ -247,6 +247,6 @@ class GPIODriver : public GPIODriverInterface const std::filesystem::path gpio_chip_path_ = "/dev/gpiochip0"; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_GPIO_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/types.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp similarity index 87% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/types.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp index 9695a8fd..7aef981f 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/gpio/types.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ #include #include #include "gpiod.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -83,6 +83,6 @@ struct GPIOInfo gpiod::line::offset offset = -1; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_GPIO_TYPES_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/lynx_system.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/lynx_system.hpp similarity index 79% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/lynx_system.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/lynx_system.hpp index b5927e59..a5d12eb0 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/lynx_system.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/lynx_system.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ #include #include -#include "panther_hardware_interfaces/panther_system/ugv_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -55,6 +55,6 @@ class LynxSystem : public UGVSystem static const inline std::vector kJointOrder = {"fl", "fr", "rl", "rr"}; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_LYNX_SYSTEM_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/panther_system.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/panther_system.hpp similarity index 79% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/panther_system.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/panther_system.hpp index 80cf06bb..ad2a741d 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/panther_system.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/panther_system.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ #include #include -#include "panther_hardware_interfaces/panther_system/ugv_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -55,6 +55,6 @@ class PantherSystem : public UGVSystem static const inline std::vector kJointOrder = {"fl", "fr", "rl", "rr"}; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_PANTHER_SYSTEM_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp similarity index 91% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp index 2c00eb69..7486cc5a 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ #include #include @@ -33,7 +33,7 @@ #include "lely/io2/sys/sigset.hpp" #include "lely/io2/sys/timer.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { struct CANopenObject @@ -133,6 +133,6 @@ class CANopenManager const CANopenSettings canopen_settings_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_CANOPEN_MANAGER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp similarity index 91% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp index e4cc87c5..d124368c 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ #include #include @@ -25,7 +25,7 @@ #include "lely/coapp/loop_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { struct MotorDriverState @@ -145,6 +145,6 @@ class DriverInterface using SharedPtr = std::shared_ptr; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp similarity index 75% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp index 25b61114..e12a4707 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ #include #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -66,6 +66,6 @@ class LynxRobotDriver : public RoboteqRobotDriver void DefineDrivers() override; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_LYNX_ROBOT_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp similarity index 75% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp index 40665e76..084c0c87 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ #include #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -68,6 +68,6 @@ class PantherRobotDriver : public RoboteqRobotDriver virtual void DefineDrivers(); }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_PANTHER_ROBOT_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp similarity index 86% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp index 78e38064..214b490e 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -116,6 +116,6 @@ class RobotDriverInterface virtual bool CommunicationError() = 0; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOT_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp similarity index 93% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp index afc071e4..dc7be71f 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ #include #include @@ -25,10 +25,10 @@ #include "panther_msgs/msg/runtime_error.hpp" #include "panther_msgs/msg/script_flag.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" -#include "panther_hardware_interfaces/utils.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/utils.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { struct DrivetrainSettings @@ -258,6 +258,6 @@ class DriverData bool heartbeat_timeout_ = false; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DATA_CONVERTERS_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp similarity index 92% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp index a499120a..2abfa843 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ #include #include @@ -25,9 +25,9 @@ #include "lely/coapp/loop_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { // Forward declaration @@ -195,6 +195,6 @@ class RoboteqMotorDriver : public MotorDriverInterface const std::uint8_t channel_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp similarity index 89% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp index 53a13d10..50419f7c 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ #include #include #include -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { class ErrorFilter @@ -102,6 +102,6 @@ class RoboteqErrorFilter std::map error_filters_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ERROR_FILTER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp similarity index 86% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp index 6f872307..b788729a 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ #include #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { struct MotorNames @@ -170,6 +170,6 @@ class RoboteqRobotDriver : public RobotDriverInterface const std::chrono::milliseconds activate_wait_time_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_ROBOT_DRIVER_ROBOTEQ_ROBOT_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_e_stop.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp similarity index 86% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_e_stop.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp index a0d1088e..5e12536e 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_e_stop.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ #include #include #include -#include "panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -115,6 +115,6 @@ class EStop : public EStopInterface std::atomic_bool e_stop_triggered_ = true; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_E_STOP_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_ros_interface.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp similarity index 95% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_ros_interface.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp index 856d4b72..c879603a 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/system_ros_interface.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ #include #include @@ -34,12 +34,12 @@ #include "panther_msgs/msg/io_state.hpp" #include "panther_msgs/msg/robot_driver_state.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" using namespace std::placeholders; -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { using BoolMsg = std_msgs::msg::Bool; @@ -308,6 +308,6 @@ class SystemROSInterface std::vector service_wrappers_storage_; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_SYSTEM_ROS_INTERFACE_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/ugv_system.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp similarity index 88% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/ugv_system.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp index 03fd02b5..ebdc0693 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/panther_system/ugv_system.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ -#define PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ #include #include @@ -29,14 +29,14 @@ #include #include -#include "panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" -#include "panther_hardware_interfaces/panther_system/system_e_stop.hpp" -#include "panther_hardware_interfaces/panther_system/system_ros_interface.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { using return_type = hardware_interface::return_type; @@ -163,6 +163,6 @@ class UGVSystem : public hardware_interface::SystemInterface rclcpp::Duration driver_states_update_period_{0, 0}; }; -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_PANTHER_SYSTEM_UGV_SYSTEM_HPP_ diff --git a/panther_hardware_interfaces/include/panther_hardware_interfaces/utils.hpp b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/utils.hpp similarity index 89% rename from panther_hardware_interfaces/include/panther_hardware_interfaces/utils.hpp rename to husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/utils.hpp index 9a53b792..b64e8522 100644 --- a/panther_hardware_interfaces/include/panther_hardware_interfaces/utils.hpp +++ b/husarion_ugv_hardware_interfaces/include/husarion_ugv_hardware_interfaces/utils.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_UTILS_HPP_ -#define PANTHER_HARDWARE_INTERFACES_UTILS_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_UTILS_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_UTILS_HPP_ #include #include #include #include -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { /** @@ -59,6 +59,6 @@ bool OperationWithAttempts( */ bool CheckIfJointNameContainValidSequence(const std::string & name, const std::string & sequence); -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces -#endif // PANTHER_HARDWARE_INTERFACES_UTILS_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_UTILS_HPP_ diff --git a/panther_hardware_interfaces/package.xml b/husarion_ugv_hardware_interfaces/package.xml similarity index 95% rename from panther_hardware_interfaces/package.xml rename to husarion_ugv_hardware_interfaces/package.xml index f3c1dfee..eca87791 100644 --- a/panther_hardware_interfaces/package.xml +++ b/husarion_ugv_hardware_interfaces/package.xml @@ -1,7 +1,7 @@ - panther_hardware_interfaces + husarion_ugv_hardware_interfaces 2.1.1 Hardware controller for Panther Husarion @@ -31,9 +31,9 @@ generate_parameter_library geometry_msgs hardware_interface + husarion_ugv_utils imu_filter_madgwick panther_msgs - panther_utils phidgets_api rclcpp rclcpp_lifecycle diff --git a/panther_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp b/husarion_ugv_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp similarity index 98% rename from panther_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp rename to husarion_ugv_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp index 1cd14517..0fdf3b96 100644 --- a/panther_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_imu_sensor/panther_imu_sensor.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp" +#include "husarion_ugv_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp" #include #include @@ -30,7 +30,7 @@ #include "hardware_interface/types/hardware_interface_type_values.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { CallbackReturn PantherImuSensor::on_init(const hardware_interface::HardwareInfo & hardware_info) @@ -548,8 +548,8 @@ void PantherImuSensor::SetStateValuesToNans() imu_sensor_state_.begin(), imu_sensor_state_.end(), std::numeric_limits::quiet_NaN()); } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces #include "pluginlib/class_list_macros.hpp" PLUGINLIB_EXPORT_CLASS( - panther_hardware_interfaces::PantherImuSensor, hardware_interface::SensorInterface) + husarion_ugv_hardware_interfaces::PantherImuSensor, hardware_interface::SensorInterface) diff --git a/panther_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp similarity index 96% rename from panther_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp index 7bfbf24c..f95c1462 100644 --- a/panther_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_controller.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" #include #include @@ -24,10 +24,10 @@ #include "gpiod.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" -#include "panther_hardware_interfaces/panther_system/gpio/types.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/types.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { Watchdog::Watchdog(std::shared_ptr gpio_driver) @@ -342,4 +342,4 @@ const std::vector & GPIOControllerPTH10X::GetGPIOConfigInfoStorage() return gpio_config_info_storage_; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp similarity index 95% rename from panther_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp index 09b8c0fd..59c0d815 100644 --- a/panther_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/gpio/gpio_driver.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" #include #include @@ -29,9 +29,9 @@ #include "gpiod.hpp" -#include "panther_utils/configure_rt.hpp" +#include "husarion_ugv_utils/configure_rt.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { GPIODriver::GPIODriver(std::vector gpio_info_storage) @@ -78,7 +78,7 @@ void GPIODriver::ConfigureEdgeEventCallback(const std::function GPIODriver::CreateLineRequest(gpiod::chip & chip) { auto request_builder = chip.prepare_request(); - request_builder.set_consumer("panther_hardware_interfaces"); + request_builder.set_consumer("husarion_ugv_hardware_interfaces"); for (GPIOInfo & gpio_info : gpio_info_storage_) { ConfigureLineRequest(chip, request_builder, gpio_info); @@ -222,7 +222,7 @@ void GPIODriver::GPIOMonitorOn() void GPIODriver::MonitorAsyncEvents() { if (use_rt_) { - panther_utils::ConfigureRT(gpio_monit_thread_sched_priority_); + husarion_ugv_utils::ConfigureRT(gpio_monit_thread_sched_priority_); } auto edge_event_buffer = gpiod::edge_event_buffer(edge_event_buffer_size_); @@ -308,4 +308,4 @@ GPIOPin GPIODriver::GetPinFromOffset(const gpiod::line::offset & offset) const "Pin with offset " + std::to_string(offset) + " not found in GPIO info storage."); } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/lynx_system.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/lynx_system.cpp similarity index 92% rename from panther_hardware_interfaces/src/panther_system/lynx_system.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/lynx_system.cpp index 8d491af5..9ea4ebba 100644 --- a/panther_hardware_interfaces/src/panther_system/lynx_system.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/lynx_system.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/lynx_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/lynx_system.hpp" #include #include @@ -21,11 +21,11 @@ #include "diagnostic_updater/diagnostic_status_wrapper.hpp" #include "rclcpp/logging.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp" -#include "panther_utils/diagnostics.hpp" +#include "husarion_ugv_utils/diagnostics.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { void LynxSystem::ReadCANopenSettingsDriverCANIDs() @@ -133,7 +133,7 @@ void LynxSystem::DiagnoseErrors(diagnostic_updater::DiagnosticStatusWrapper & st level = diagnostic_updater::DiagnosticStatusWrapper::ERROR; message = "Error detected."; - panther_utils::diagnostics::AddKeyValueIfTrue( + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue( status, driver_data.GetErrorMap(), "Driver error: "); } @@ -141,7 +141,7 @@ void LynxSystem::DiagnoseErrors(diagnostic_updater::DiagnosticStatusWrapper & st level = diagnostic_updater::DiagnosticStatusWrapper::ERROR; message = "Error detected."; - panther_utils::diagnostics::AddKeyValueIfTrue( + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue( status, roboteq_error_filter_->GetErrorMap(), "", " error"); } @@ -170,7 +170,8 @@ std::vector LynxSystem::GetSpeedCommands() const static_cast(hw_commands_velocities_[0]), static_cast(hw_commands_velocities_[1])}; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces #include "pluginlib/class_list_macros.hpp" -PLUGINLIB_EXPORT_CLASS(panther_hardware_interfaces::LynxSystem, hardware_interface::SystemInterface) +PLUGINLIB_EXPORT_CLASS( + husarion_ugv_hardware_interfaces::LynxSystem, hardware_interface::SystemInterface) diff --git a/panther_hardware_interfaces/src/panther_system/panther_system.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/panther_system.cpp similarity index 93% rename from panther_hardware_interfaces/src/panther_system/panther_system.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/panther_system.cpp index e87ded9b..a1ea6a7c 100644 --- a/panther_hardware_interfaces/src/panther_system/panther_system.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/panther_system.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/panther_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/panther_system.hpp" #include #include @@ -21,11 +21,11 @@ #include "diagnostic_updater/diagnostic_status_wrapper.hpp" #include "rclcpp/logging.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" -#include "panther_utils/diagnostics.hpp" +#include "husarion_ugv_utils/diagnostics.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { void PantherSystem::ReadCANopenSettingsDriverCANIDs() @@ -160,7 +160,7 @@ void PantherSystem::DiagnoseErrors(diagnostic_updater::DiagnosticStatusWrapper & level = diagnostic_updater::DiagnosticStatusWrapper::ERROR; message = "Error detected."; - panther_utils::diagnostics::AddKeyValueIfTrue( + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue( status, front_driver_data.GetErrorMap(), "Front driver error: "); } @@ -169,7 +169,7 @@ void PantherSystem::DiagnoseErrors(diagnostic_updater::DiagnosticStatusWrapper & level = diagnostic_updater::DiagnosticStatusWrapper::ERROR; message = "Error detected."; - panther_utils::diagnostics::AddKeyValueIfTrue( + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue( status, rear_driver_data.GetErrorMap(), "Rear driver error: "); } @@ -177,7 +177,7 @@ void PantherSystem::DiagnoseErrors(diagnostic_updater::DiagnosticStatusWrapper & level = diagnostic_updater::DiagnosticStatusWrapper::ERROR; message = "Error detected."; - panther_utils::diagnostics::AddKeyValueIfTrue( + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue( status, roboteq_error_filter_->GetErrorMap(), "", " error"); } @@ -214,8 +214,8 @@ std::vector PantherSystem::GetSpeedCommands() const static_cast(hw_commands_velocities_[2]), static_cast(hw_commands_velocities_[3])}; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces #include "pluginlib/class_list_macros.hpp" PLUGINLIB_EXPORT_CLASS( - panther_hardware_interfaces::PantherSystem, hardware_interface::SystemInterface) + husarion_ugv_hardware_interfaces::PantherSystem, hardware_interface::SystemInterface) diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp similarity index 92% rename from panther_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp index 37dc5db5..09e54a8b 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/canopen_manager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" #include #include @@ -24,9 +24,9 @@ #include "ament_index_cpp/get_package_share_directory.hpp" -#include "panther_utils/configure_rt.hpp" +#include "husarion_ugv_utils/configure_rt.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { CANopenManager::CANopenManager(const CANopenSettings & canopen_settings) @@ -43,7 +43,7 @@ void CANopenManager::Initialize() canopen_communication_started_.store(false); try { - panther_utils::ConfigureRT(kCANopenThreadSchedPriority); + husarion_ugv_utils::ConfigureRT(kCANopenThreadSchedPriority); } catch (const std::runtime_error & e) { std::cerr << "An exception occurred while configuring RT: " << e.what() << std::endl << "Continuing with regular thread settings (it may have a negative impact on the " @@ -137,7 +137,7 @@ void CANopenManager::InitializeCANCommunication() // dcfgen canopen_configuration.yaml -r // dcfgen comes with lely, -r option tells to enable remote PDO mapping std::string master_dcf_path = std::filesystem::path(ament_index_cpp::get_package_share_directory( - "panther_hardware_interfaces")) / + "husarion_ugv_hardware_interfaces")) / "config" / "master.dcf"; master_ = std::make_shared( @@ -156,4 +156,4 @@ void CANopenManager::NotifyCANCommunicationStarted(const bool result) canopen_communication_started_cond_.notify_all(); } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp similarity index 85% rename from panther_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp index 54b655af..e15ae280 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/lynx_robot_driver.cpp @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/lynx_robot_driver.hpp" #include #include #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { void LynxRobotDriver::SendSpeedCommands(const std::vector & speeds) @@ -65,4 +65,4 @@ void LynxRobotDriver::DefineDrivers() drivers_.emplace(DriverNames::DEFAULT, driver); } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp similarity index 90% rename from panther_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp index 7cbbb974..d9209afc 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/panther_robot_driver.cpp @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" #include #include #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { void PantherRobotDriver::SendSpeedCommands(const std::vector & speeds) @@ -87,4 +87,4 @@ void PantherRobotDriver::DefineDrivers() drivers_.emplace(DriverNames::REAR, rear_driver); } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp similarity index 95% rename from panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp index 0382edb7..1cb9788d 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_data_converters.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" #include -#include "panther_hardware_interfaces/utils.hpp" -#include "panther_utils/common_utilities.hpp" +#include "husarion_ugv_hardware_interfaces/utils.hpp" +#include "husarion_ugv_utils/common_utilities.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { RoboteqVelocityCommandConverter::RoboteqVelocityCommandConverter( @@ -264,10 +264,10 @@ std::map DriverData::GetFlagErrorMap() const flag_error_map.merge(fault_flags_.GetErrorMap()); flag_error_map.merge(script_flags_.GetErrorMap()); - auto channel_1_runtime_error_map = panther_utils::common_utilities::PrefixMapKeys( + auto channel_1_runtime_error_map = husarion_ugv_utils::common_utilities::PrefixMapKeys( channel_1_runtime_error_.GetErrorMap(), "channel_1_motor."); - auto channel_2_runtime_error_map = panther_utils::common_utilities::PrefixMapKeys( + auto channel_2_runtime_error_map = husarion_ugv_utils::common_utilities::PrefixMapKeys( channel_2_runtime_error_.GetErrorMap(), "channel_2_motor."); flag_error_map.merge(std::move(channel_1_runtime_error_map)); @@ -291,4 +291,4 @@ std::map DriverData::GetErrorMap() const return error_map; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp similarity index 96% rename from panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp index 56bed72d..42732470 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_driver.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" #include #include @@ -24,10 +24,10 @@ #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/utils.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/utils.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { // All ids and sub ids were read directly from the eds file. Lely CANopen doesn't have the option @@ -273,4 +273,4 @@ void RoboteqDriver::OnRpdoWrite(const std::uint16_t idx, const std::uint8_t subi } } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp similarity index 93% rename from panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp index 1d15abeb..a45b2959 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_error_filter.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_error_filter.hpp" #include #include #include -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { void ErrorFilter::UpdateError(const bool current_error) @@ -91,4 +91,4 @@ void RoboteqErrorFilter::ClearErrorsIfFlagSet() } } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp similarity index 93% rename from panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp index 9a3626c0..7bc28775 100644 --- a/panther_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/robot_driver/roboteq_robot_driver.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" #include #include @@ -24,12 +24,12 @@ #include "lely/util/chrono.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { RoboteqRobotDriver::RoboteqRobotDriver( @@ -257,4 +257,4 @@ void RoboteqRobotDriver::BootDrivers() } } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/system_e_stop.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/system_e_stop.cpp similarity index 93% rename from panther_hardware_interfaces/src/panther_system/system_e_stop.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/system_e_stop.cpp index 35efc987..015dedae 100644 --- a/panther_hardware_interfaces/src/panther_system/system_e_stop.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/system_e_stop.cpp @@ -17,9 +17,9 @@ #include #include -#include "panther_hardware_interfaces/panther_system/system_e_stop.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { bool EStop::ReadEStopState() @@ -83,4 +83,4 @@ void EStop::ResetEStop() } } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/system_ros_interface.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/system_ros_interface.cpp similarity index 97% rename from panther_hardware_interfaces/src/panther_system/system_ros_interface.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/system_ros_interface.cpp index f6b5564e..4656ebcc 100644 --- a/panther_hardware_interfaces/src/panther_system/system_ros_interface.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/system_ros_interface.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/system_ros_interface.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp" #include #include @@ -22,9 +22,9 @@ #include "rclcpp/rclcpp.hpp" #include "realtime_tools/realtime_publisher.h" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { template class ROSServiceWrapper>; @@ -302,4 +302,4 @@ DriverStateNamedMsg & SystemROSInterface::GetDriverStateByName( return *it; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/panther_system/ugv_system.cpp b/husarion_ugv_hardware_interfaces/src/panther_system/ugv_system.cpp similarity index 97% rename from panther_hardware_interfaces/src/panther_system/ugv_system.cpp rename to husarion_ugv_hardware_interfaces/src/panther_system/ugv_system.cpp index fcdf497a..f9843906 100644 --- a/panther_hardware_interfaces/src/panther_system/ugv_system.cpp +++ b/husarion_ugv_hardware_interfaces/src/panther_system/ugv_system.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/panther_system/ugv_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp" #include #include @@ -27,14 +27,14 @@ #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/system_ros_interface.hpp" -#include "panther_hardware_interfaces/utils.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/panther_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_ros_interface.hpp" +#include "husarion_ugv_hardware_interfaces/utils.hpp" -#include "panther_utils/common_utilities.hpp" -#include "panther_utils/diagnostics.hpp" +#include "husarion_ugv_utils/common_utilities.hpp" +#include "husarion_ugv_utils/diagnostics.hpp" -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { CallbackReturn UGVSystem::on_init(const hardware_interface::HardwareInfo & hardware_info) @@ -547,4 +547,4 @@ void UGVSystem::MotorsPowerEnable(const bool enable) } } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/src/utils.cpp b/husarion_ugv_hardware_interfaces/src/utils.cpp similarity index 93% rename from panther_hardware_interfaces/src/utils.cpp rename to husarion_ugv_hardware_interfaces/src/utils.cpp index 1620a06b..a83d3967 100644 --- a/panther_hardware_interfaces/src/utils.cpp +++ b/husarion_ugv_hardware_interfaces/src/utils.cpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_hardware_interfaces/utils.hpp" +#include "husarion_ugv_hardware_interfaces/utils.hpp" #include #include -namespace panther_hardware_interfaces +namespace husarion_ugv_hardware_interfaces { bool OperationWithAttempts( @@ -65,4 +65,4 @@ bool CheckIfJointNameContainValidSequence(const std::string & name, const std::s return true; } -} // namespace panther_hardware_interfaces +} // namespace husarion_ugv_hardware_interfaces diff --git a/panther_hardware_interfaces/test/config/canopen_configuration.yaml b/husarion_ugv_hardware_interfaces/test/config/canopen_configuration.yaml similarity index 100% rename from panther_hardware_interfaces/test/config/canopen_configuration.yaml rename to husarion_ugv_hardware_interfaces/test/config/canopen_configuration.yaml diff --git a/panther_hardware_interfaces/test/config/slave_1.bin b/husarion_ugv_hardware_interfaces/test/config/slave_1.bin similarity index 100% rename from panther_hardware_interfaces/test/config/slave_1.bin rename to husarion_ugv_hardware_interfaces/test/config/slave_1.bin diff --git a/panther_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp b/husarion_ugv_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp similarity index 97% rename from panther_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp rename to husarion_ugv_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp index 9b99f98a..bd738568 100644 --- a/panther_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp +++ b/husarion_ugv_hardware_interfaces/test/panther_imu_sensor/test_panther_imu_sensor.cpp @@ -26,10 +26,10 @@ #include "lifecycle_msgs/msg/state.hpp" -#include "panther_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_hardware_interfaces/panther_imu_sensor/panther_imu_sensor.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class PantherImuSensorWrapper : public panther_hardware_interfaces::PantherImuSensor +class PantherImuSensorWrapper : public husarion_ugv_hardware_interfaces::PantherImuSensor { public: PantherImuSensorWrapper() {} @@ -206,7 +206,7 @@ class TestPantherImuSensor : public testing::Test {"world_frame", "enu"}}; inline static const std::string kPluginName = - "panther_hardware_interfaces/PantherImuSensor"; + "husarion_ugv_hardware_interfaces/PantherImuSensor"; std::unique_ptr imu_sensor_; std::shared_ptr rm_; @@ -425,7 +425,7 @@ TEST_F(TestPantherImuSensor, CheckMagnitudeWrongValueAndCalibration) ASSERT_EQ(imu_sensor_->on_init(info), CallbackReturn::SUCCESS); double magnitude[3]; - magnitude[0] = panther_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; + magnitude[0] = husarion_ugv_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; const auto wrong_magnitude_parsed = imu_sensor_->ParseMagnitude(magnitude); ASSERT_FALSE(imu_sensor_->IsVectorFinite(wrong_magnitude_parsed)); @@ -451,7 +451,7 @@ TEST_F(TestPantherImuSensor, CheckCalibrationOnDataCallbackAndAlgorithmInitializ ASSERT_EQ(imu_sensor_->on_init(info), CallbackReturn::SUCCESS); double magnitude[3], acceleration[3], gyration[3]; - magnitude[0] = panther_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; + magnitude[0] = husarion_ugv_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; const auto fake_wrong_magnitude_parsed = imu_sensor_->ParseMagnitude(magnitude); ASSERT_FALSE(imu_sensor_->IsIMUCalibrated(fake_wrong_magnitude_parsed)); @@ -493,7 +493,7 @@ TEST_F(TestPantherImuSensor, CheckReconnection) ASSERT_EQ(imu_sensor_->on_init(info), CallbackReturn::SUCCESS); double magnitude[3], acceleration[3], gyration[3]; - magnitude[0] = panther_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; + magnitude[0] = husarion_ugv_hardware_interfaces::PantherImuSensor::KImuMagneticFieldUnknownValue; // Correct values read from sensor magnitude[0] = -0.09675; diff --git a/panther_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp b/husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp similarity index 93% rename from panther_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp rename to husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp index aa50bf30..a05c6fd8 100644 --- a/panther_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp +++ b/husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_controller.cpp @@ -20,12 +20,12 @@ #include -#include +#include -using GPIOInfo = panther_hardware_interfaces::GPIOInfo; -using GPIOPin = panther_hardware_interfaces::GPIOPin; +using GPIOInfo = husarion_ugv_hardware_interfaces::GPIOInfo; +using GPIOPin = husarion_ugv_hardware_interfaces::GPIOPin; -class MockGPIODriver : public panther_hardware_interfaces::GPIODriverInterface +class MockGPIODriver : public husarion_ugv_hardware_interfaces::GPIODriverInterface { public: MOCK_METHOD( @@ -42,11 +42,11 @@ class MockGPIODriver : public panther_hardware_interfaces::GPIODriverInterface MOCK_METHOD(bool, SetPinValue, (const GPIOPin pin, const bool value), (override)); }; -class GPIOControllerWrapper : public panther_hardware_interfaces::GPIOControllerPTH12X +class GPIOControllerWrapper : public husarion_ugv_hardware_interfaces::GPIOControllerPTH12X { public: GPIOControllerWrapper(std::shared_ptr gpio_driver) - : panther_hardware_interfaces::GPIOControllerPTH12X(gpio_driver) + : husarion_ugv_hardware_interfaces::GPIOControllerPTH12X(gpio_driver) { } diff --git a/panther_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp b/husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp similarity index 84% rename from panther_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp rename to husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp index aede6036..f8086776 100644 --- a/panther_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp +++ b/husarion_ugv_hardware_interfaces/test/panther_system/gpio/test_gpio_driver.cpp @@ -24,11 +24,11 @@ #include #include -#include "panther_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_driver.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -using GPIOInfo = panther_hardware_interfaces::GPIOInfo; -using GPIOPin = panther_hardware_interfaces::GPIOPin; +using GPIOInfo = husarion_ugv_hardware_interfaces::GPIOInfo; +using GPIOPin = husarion_ugv_hardware_interfaces::GPIOPin; class TestGPIODriver : public ::testing::Test { @@ -43,7 +43,7 @@ class TestGPIODriver : public ::testing::Test void TearDown() override; void SetAndVerifyPinState(const GPIOPin & pin); - std::unique_ptr gpio_driver_; + std::unique_ptr gpio_driver_; std::pair last_gpio_event_summary_; const std::vector gpio_config_info_{ GPIOInfo{GPIOPin::LED_SBC_SEL, gpiod::line::direction::OUTPUT}, @@ -52,7 +52,7 @@ class TestGPIODriver : public ::testing::Test void TestGPIODriver::SetUp() { - gpio_driver_ = std::make_unique(gpio_config_info_); + gpio_driver_ = std::make_unique(gpio_config_info_); last_gpio_event_summary_.first = static_cast(-1); last_gpio_event_summary_.second = static_cast(-1); @@ -80,7 +80,7 @@ TEST(TestGPIODriverInitialization, EmptyInfoStorage) EXPECT_THROW( { auto gpio_driver = - std::make_unique(std::vector{}); + std::make_unique(std::vector{}); }, std::runtime_error); } @@ -90,11 +90,11 @@ TEST(TestGPIODriverInitialization, WrongPinConfigFail) // There is no OS version that supports simultaneous operation of MOTOR_ON and VMOT_ON pins. EXPECT_THROW( { - auto gpio_driver = std::make_unique( + auto gpio_driver = std::make_unique( std::vector{{GPIOPin::MOTOR_ON, gpiod::line::direction::OUTPUT}}); gpio_driver.reset(); - gpio_driver = std::make_unique( + gpio_driver = std::make_unique( std::vector{{GPIOPin::VMOT_ON, gpiod::line::direction::OUTPUT}}); }, std::invalid_argument); @@ -102,7 +102,7 @@ TEST(TestGPIODriverInitialization, WrongPinConfigFail) TEST_F(TestGPIODriver, SetWrongPinValue) { - auto is_message_thrown = panther_utils::test_utils::IsMessageThrown( + auto is_message_thrown = husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { this->gpio_driver_->SetPinValue(static_cast(-1), true); }, "Pin not found in GPIO info storage."); @@ -132,7 +132,7 @@ TEST_F(TestGPIODriver, IsPinActive) TEST_F(TestGPIODriver, IsPinActiveNoMonitorThread) { - auto is_message_thrown = panther_utils::test_utils::IsMessageThrown( + auto is_message_thrown = husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { this->gpio_driver_->IsPinActive(GPIOPin::LED_SBC_SEL); }, "GPIO monitor thread is not running!"); @@ -166,7 +166,7 @@ TEST_F(TestGPIODriver, GPIOMonitorEnableUseRT) TEST_F(TestGPIODriver, GPIOEventCallbackNoMonitorThread) { - auto is_message_thrown = panther_utils::test_utils::IsMessageThrown( + auto is_message_thrown = husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { this->gpio_driver_->ConfigureEdgeEventCallback( std::bind(&TestGPIODriver::GPIOEventCallback, this, std::placeholders::_1)); @@ -202,7 +202,7 @@ TEST_F(TestGPIODriver, ChangePinDirection) this->gpio_driver_->GPIOMonitorEnable(); this->gpio_driver_->ChangePinDirection(GPIOPin::LED_SBC_SEL, gpiod::line::direction::INPUT); - auto is_message_thrown = panther_utils::test_utils::IsMessageThrown( + auto is_message_thrown = husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { this->gpio_driver_->SetPinValue(GPIOPin::LED_SBC_SEL, true); }, "Cannot set value for INPUT pin."); diff --git a/panther_hardware_interfaces/test/test_utils.cpp b/husarion_ugv_hardware_interfaces/test/test_utils.cpp similarity index 86% rename from panther_hardware_interfaces/test/test_utils.cpp rename to husarion_ugv_hardware_interfaces/test/test_utils.cpp index 43f8c457..8d6f0f88 100644 --- a/panther_hardware_interfaces/test/test_utils.cpp +++ b/husarion_ugv_hardware_interfaces/test/test_utils.cpp @@ -19,11 +19,11 @@ #include -#include +#include TEST(TestUtils, GetByte) { - using panther_hardware_interfaces::GetByte; + using husarion_ugv_hardware_interfaces::GetByte; EXPECT_EQ(GetByte(static_cast(0xFA3B4186), 0), 0x86); EXPECT_EQ(GetByte(static_cast(0xFA3B4186), 1), 0x41); @@ -33,7 +33,7 @@ TEST(TestUtils, GetByte) TEST(TestUtils, GetByteOutOfRange) { - using panther_hardware_interfaces::GetByte; + using husarion_ugv_hardware_interfaces::GetByte; EXPECT_THROW(GetByte(static_cast(0xFA3B4186), 4), std::runtime_error); EXPECT_THROW(GetByte(static_cast(0xFA3B4186), -1), std::runtime_error); @@ -45,7 +45,7 @@ TEST(TestUtils, OperationWithAttemptsFailTest) unsigned attempts_counter = 0; unsigned on_error_counter = 0; - EXPECT_FALSE(panther_hardware_interfaces::OperationWithAttempts( + EXPECT_FALSE(husarion_ugv_hardware_interfaces::OperationWithAttempts( [&attempts_counter]() { ++attempts_counter; throw std::runtime_error(""); @@ -60,7 +60,7 @@ TEST(TestUtils, OperationWithAttemptsSuccessTest) unsigned max_attempts = 5; unsigned attempts_counter = 0; - EXPECT_TRUE(panther_hardware_interfaces::OperationWithAttempts( + EXPECT_TRUE(husarion_ugv_hardware_interfaces::OperationWithAttempts( [&attempts_counter, &max_attempts]() { ++attempts_counter; if (attempts_counter < max_attempts) { @@ -73,13 +73,13 @@ TEST(TestUtils, OperationWithAttemptsSuccessTest) TEST(TestUtils, OperationWithAttemptsOnErrorThrowTest) { - EXPECT_FALSE(panther_hardware_interfaces::OperationWithAttempts( + EXPECT_FALSE(husarion_ugv_hardware_interfaces::OperationWithAttempts( []() { throw std::runtime_error(""); }, 5, []() { throw std::runtime_error(""); })); } TEST(TestUtils, CheckIfJointNameContainValidSequence) { - using panther_hardware_interfaces::CheckIfJointNameContainValidSequence; + using husarion_ugv_hardware_interfaces::CheckIfJointNameContainValidSequence; EXPECT_TRUE(CheckIfJointNameContainValidSequence("fr_wheel_joint", "fr")); EXPECT_TRUE(CheckIfJointNameContainValidSequence("namespace/fr_wheel_joint", "fr")); diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp similarity index 74% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp index 51d5ec2b..d0c54a98 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_canopen_manager.cpp @@ -19,12 +19,12 @@ #include #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" #include "utils/fake_can_socket.hpp" #include "utils/test_constants.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" class TestCANopenManager : public ::testing::Test { @@ -34,17 +34,17 @@ class TestCANopenManager : public ::testing::Test ~TestCANopenManager() {} protected: - std::unique_ptr can_socket_; - std::unique_ptr canopen_manager_; + std::unique_ptr can_socket_; + std::unique_ptr canopen_manager_; }; TestCANopenManager::TestCANopenManager() { - can_socket_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings.can_interface_name); + can_socket_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings.can_interface_name); - canopen_manager_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings); + canopen_manager_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings); } TEST_F(TestCANopenManager, InitializeAndDeinitialize) @@ -71,7 +71,7 @@ TEST_F(TestCANopenManager, Activate) TEST_F(TestCANopenManager, ActivateNotInitialized) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { canopen_manager_->Activate(); }, "CANopenManager not initialized.")); } @@ -90,7 +90,7 @@ TEST_F(TestCANopenManager, GetMaster) TEST_F(TestCANopenManager, GetMasterNotInitialized) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { canopen_manager_->GetMaster(); }, "CANopenManager not initialized.")); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp similarity index 58% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp index da5706cd..ba56643b 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_lynx_robot_driver.cpp @@ -20,48 +20,49 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "utils/fake_can_socket.hpp" #include "utils/mock_driver.hpp" #include "utils/test_constants.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class LynxRobotDriverWrapper : public panther_hardware_interfaces::LynxRobotDriver +class LynxRobotDriverWrapper : public husarion_ugv_hardware_interfaces::LynxRobotDriver { public: LynxRobotDriverWrapper( - const panther_hardware_interfaces::CANopenSettings & canopen_settings, - const panther_hardware_interfaces::DrivetrainSettings & drivetrain_settings, + const husarion_ugv_hardware_interfaces::CANopenSettings & canopen_settings, + const husarion_ugv_hardware_interfaces::DrivetrainSettings & drivetrain_settings, const std::chrono::milliseconds activate_wait_time = std::chrono::milliseconds(1000)) : LynxRobotDriver(canopen_settings, drivetrain_settings, activate_wait_time) { - mock_left_motor_driver = - std::make_shared<::testing::NiceMock>(); - mock_right_motor_driver = - std::make_shared<::testing::NiceMock>(); + mock_left_motor_driver = std::make_shared< + ::testing::NiceMock>(); + mock_right_motor_driver = std::make_shared< + ::testing::NiceMock>(); mock_driver = - std::make_shared<::testing::NiceMock>(); + std::make_shared<::testing::NiceMock>(); mock_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::LEFT, mock_left_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::LEFT, mock_left_motor_driver); mock_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::RIGHT, mock_right_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::RIGHT, mock_right_motor_driver); } void DefineDrivers() override { - drivers_.emplace(panther_hardware_interfaces::DriverNames::DEFAULT, mock_driver); + drivers_.emplace(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT, mock_driver); } - std::shared_ptr<::testing::NiceMock> mock_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> + mock_driver; + std::shared_ptr<::testing::NiceMock> mock_left_motor_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_right_motor_driver; }; @@ -70,13 +71,13 @@ class TestLynxRobotDriver : public ::testing::Test public: TestLynxRobotDriver() { - can_socket_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings.can_interface_name); + can_socket_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings.can_interface_name); can_socket_->Initialize(); robot_driver_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings, - panther_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); + husarion_ugv_hardware_interfaces_test::kCANopenSettings, + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); robot_driver_->Initialize(); robot_driver_->Activate(); @@ -85,13 +86,13 @@ class TestLynxRobotDriver : public ::testing::Test ~TestLynxRobotDriver() { robot_driver_->Deinitialize(); } protected: - std::unique_ptr can_socket_; + std::unique_ptr can_socket_; std::unique_ptr robot_driver_; }; TEST_F(TestLynxRobotDriver, SendSpeedCommands) { - using panther_hardware_interfaces_test::kRadPerSecToRbtqCmd; + using husarion_ugv_hardware_interfaces_test::kRadPerSecToRbtqCmd; const float left_v = 0.1; const float right_v = 0.2; @@ -115,7 +116,7 @@ TEST_F(TestLynxRobotDriver, SendSpeedCommandsSendCmdVelError) EXPECT_CALL(*robot_driver_->mock_left_motor_driver, SendCmdVel(::testing::_)) .WillOnce(::testing::Throw(std::runtime_error(""))); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands({0.0, 0.0}); }, "Driver send Roboteq cmd failed:")); } @@ -123,7 +124,7 @@ TEST_F(TestLynxRobotDriver, SendSpeedCommandsCANError) { EXPECT_CALL(*robot_driver_->mock_driver, IsCANError()).WillOnce(::testing::Return(true)); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands({0.0, 0.0}); }, "CAN error detected on the Driver when trying to write speed commands.")); } @@ -132,7 +133,7 @@ TEST_F(TestLynxRobotDriver, SendSpeedCommandsInvalidVectorSize) { const std::vector speeds = {0.1, 0.2, 0.3}; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands(speeds); }, "Invalid speeds vector size")); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp similarity index 55% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp index 7ba08f5f..f714560e 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_panther_robot_driver.cpp @@ -20,67 +20,67 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "utils/fake_can_socket.hpp" #include "utils/mock_driver.hpp" #include "utils/test_constants.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class PantherRobotDriverWrapper : public panther_hardware_interfaces::PantherRobotDriver +class PantherRobotDriverWrapper : public husarion_ugv_hardware_interfaces::PantherRobotDriver { public: PantherRobotDriverWrapper( - const panther_hardware_interfaces::CANopenSettings & canopen_settings, - const panther_hardware_interfaces::DrivetrainSettings & drivetrain_settings, + const husarion_ugv_hardware_interfaces::CANopenSettings & canopen_settings, + const husarion_ugv_hardware_interfaces::DrivetrainSettings & drivetrain_settings, const std::chrono::milliseconds activate_wait_time = std::chrono::milliseconds(1000)) : PantherRobotDriver(canopen_settings, drivetrain_settings, activate_wait_time) { - mock_fl_motor_driver = - std::make_shared<::testing::NiceMock>(); - mock_fr_motor_driver = - std::make_shared<::testing::NiceMock>(); - mock_rl_motor_driver = - std::make_shared<::testing::NiceMock>(); - mock_rr_motor_driver = - std::make_shared<::testing::NiceMock>(); + mock_fl_motor_driver = std::make_shared< + ::testing::NiceMock>(); + mock_fr_motor_driver = std::make_shared< + ::testing::NiceMock>(); + mock_rl_motor_driver = std::make_shared< + ::testing::NiceMock>(); + mock_rr_motor_driver = std::make_shared< + ::testing::NiceMock>(); mock_front_driver = - std::make_shared<::testing::NiceMock>(); + std::make_shared<::testing::NiceMock>(); mock_front_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::LEFT, mock_fl_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::LEFT, mock_fl_motor_driver); mock_front_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::RIGHT, mock_fr_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::RIGHT, mock_fr_motor_driver); mock_rear_driver = - std::make_shared<::testing::NiceMock>(); + std::make_shared<::testing::NiceMock>(); mock_rear_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::LEFT, mock_rl_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::LEFT, mock_rl_motor_driver); mock_rear_driver->AddMotorDriver( - panther_hardware_interfaces::MotorNames::RIGHT, mock_rr_motor_driver); + husarion_ugv_hardware_interfaces::MotorNames::RIGHT, mock_rr_motor_driver); } void DefineDrivers() override { - drivers_.emplace(panther_hardware_interfaces::DriverNames::FRONT, mock_front_driver); - drivers_.emplace(panther_hardware_interfaces::DriverNames::REAR, mock_rear_driver); + drivers_.emplace(husarion_ugv_hardware_interfaces::DriverNames::FRONT, mock_front_driver); + drivers_.emplace(husarion_ugv_hardware_interfaces::DriverNames::REAR, mock_rear_driver); } - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_front_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_rear_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_fl_motor_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_fr_motor_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_rl_motor_driver; - std::shared_ptr<::testing::NiceMock> + std::shared_ptr<::testing::NiceMock> mock_rr_motor_driver; }; @@ -89,13 +89,13 @@ class TestPantherRobotDriver : public ::testing::Test public: TestPantherRobotDriver() { - can_socket_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings.can_interface_name); + can_socket_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings.can_interface_name); can_socket_->Initialize(); robot_driver_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings, - panther_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); + husarion_ugv_hardware_interfaces_test::kCANopenSettings, + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); robot_driver_->Initialize(); robot_driver_->Activate(); @@ -104,13 +104,13 @@ class TestPantherRobotDriver : public ::testing::Test ~TestPantherRobotDriver() { robot_driver_->Deinitialize(); } protected: - std::unique_ptr can_socket_; + std::unique_ptr can_socket_; std::unique_ptr robot_driver_; }; TEST_F(TestPantherRobotDriver, SendSpeedCommands) { - using panther_hardware_interfaces_test::kRadPerSecToRbtqCmd; + using husarion_ugv_hardware_interfaces_test::kRadPerSecToRbtqCmd; const float fl_v = 0.1; const float fr_v = 0.2; @@ -145,7 +145,7 @@ TEST_F(TestPantherRobotDriver, SendSpeedCommandsSendCmdVelError) EXPECT_CALL(*robot_driver_->mock_fl_motor_driver, SendCmdVel(::testing::_)) .WillOnce(::testing::Throw(std::runtime_error(""))); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands({0.0, 0.0, 0.0, 0.0}); }, "Front driver send Roboteq cmd failed:")); } @@ -154,7 +154,7 @@ TEST_F(TestPantherRobotDriver, SendSpeedCommandsCANError) { EXPECT_CALL(*robot_driver_->mock_front_driver, IsCANError()).WillOnce(::testing::Return(true)); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands({0.0, 0.0, 0.0, 0.0}); }, "CAN error detected on the front driver when trying to write speed commands.")); } @@ -163,7 +163,7 @@ TEST_F(TestPantherRobotDriver, SendSpeedCommandsInvalidVectorSize) { const std::vector speeds = {0.1, 0.2, 0.3}; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { robot_driver_->SendSpeedCommands(speeds); }, "Invalid speeds vector size")); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp similarity index 86% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp index 1bba2723..49c65122 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_data_converters.cpp @@ -19,7 +19,7 @@ #include -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_data_converters.hpp" #include "utils/test_constants.hpp" @@ -70,8 +70,8 @@ void TestRuntimeErrorMsg( TEST(TestRoboteqDataConverters, CommandConverter) { - panther_hardware_interfaces::RoboteqVelocityCommandConverter cmd_converter( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::RoboteqVelocityCommandConverter cmd_converter( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); const float conversion_factor = 79.789678; @@ -84,18 +84,18 @@ TEST(TestRoboteqDataConverters, CommandConverter) TEST(TestRoboteqDataConverters, MotorState) { - using panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - using panther_hardware_interfaces_test::kRbtqPosFbToRad; - using panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + using husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + using husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + using husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; - panther_hardware_interfaces::MotorState motor_state( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::MotorState motor_state( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); EXPECT_FLOAT_EQ(motor_state.GetPosition(), 0.0); EXPECT_FLOAT_EQ(motor_state.GetVelocity(), 0.0); EXPECT_FLOAT_EQ(motor_state.GetTorque(), 0.0); - panther_hardware_interfaces::MotorDriverState feedback1; + husarion_ugv_hardware_interfaces::MotorDriverState feedback1; feedback1.pos = 48128; feedback1.vel = 1000; feedback1.current = 1; @@ -105,7 +105,7 @@ TEST(TestRoboteqDataConverters, MotorState) EXPECT_FLOAT_EQ(motor_state.GetVelocity(), feedback1.vel * kRbtqVelFbToRadPerSec); EXPECT_FLOAT_EQ(motor_state.GetTorque(), feedback1.current * kRbtqCurrentFbToNewtonMeters); - panther_hardware_interfaces::MotorDriverState feedback2; + husarion_ugv_hardware_interfaces::MotorDriverState feedback2; feedback2.pos = -48128; feedback2.vel = -1000; feedback2.current = -1; @@ -118,7 +118,7 @@ TEST(TestRoboteqDataConverters, MotorState) TEST(TestRoboteqDataConverters, FlagError) { - panther_hardware_interfaces::FlagError flag_error( + husarion_ugv_hardware_interfaces::FlagError flag_error( {"error1", "error2", "error3", "error4", "error5", "error6", "error7", "error8"}, {"error2", "error6"}); @@ -140,7 +140,7 @@ TEST(TestRoboteqDataConverters, FlagError) TEST(TestRoboteqDataConverters, FaultFlag) { - panther_hardware_interfaces::FaultFlag fault_flag; + husarion_ugv_hardware_interfaces::FaultFlag fault_flag; fault_flag.SetData(0b00000001); TestFaultFlagMsg( @@ -173,7 +173,7 @@ TEST(TestRoboteqDataConverters, FaultFlag) TEST(TestRoboteqDataConverters, ScriptFlag) { - panther_hardware_interfaces::ScriptFlag script_flag; + husarion_ugv_hardware_interfaces::ScriptFlag script_flag; script_flag.SetData(0b00000001); TestScriptFlagMsg(script_flag.GetMessage(), {true, false, false}); @@ -188,7 +188,7 @@ TEST(TestRoboteqDataConverters, ScriptFlag) TEST(TestRoboteqDataConverters, RuntimeError) { - panther_hardware_interfaces::RuntimeError runtime_error; + husarion_ugv_hardware_interfaces::RuntimeError runtime_error; runtime_error.SetData(0b00000001); TestRuntimeErrorMsg(runtime_error.GetMessage(), {true, false, false, false, false, false, false}); @@ -215,7 +215,7 @@ TEST(TestRoboteqDataConverters, RuntimeError) TEST(TestRoboteqDataConverters, DriverState) { - panther_hardware_interfaces::RoboteqDriverState driver_state; + husarion_ugv_hardware_interfaces::RoboteqDriverState driver_state; EXPECT_FLOAT_EQ(driver_state.GetTemperature(), 0.0); EXPECT_FLOAT_EQ(driver_state.GetVoltage(), 0.0); @@ -233,18 +233,19 @@ TEST(TestRoboteqDataConverters, DriverState) TEST(TestRoboteqDataConverters, DriverData) { - using panther_hardware_interfaces::RoboteqDriver; - using panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - using panther_hardware_interfaces_test::kRbtqPosFbToRad; - using panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + using husarion_ugv_hardware_interfaces::RoboteqDriver; + using husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + using husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + using husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); ASSERT_FALSE(roboteq_data.IsError()); - const panther_hardware_interfaces::MotorDriverState channel_1_state = {0, 0, 0, {0, 0}, {0, 0}}; - const panther_hardware_interfaces::MotorDriverState channel_2_state = { + const husarion_ugv_hardware_interfaces::MotorDriverState channel_1_state = { + 0, 0, 0, {0, 0}, {0, 0}}; + const husarion_ugv_hardware_interfaces::MotorDriverState channel_2_state = { 48128, 1000, 1, {0, 0}, {0, 0}}; roboteq_data.SetMotorsStates(channel_1_state, channel_2_state, true); @@ -277,7 +278,7 @@ TEST(TestRoboteqDataConverters, DriverData) roboteq_data.GetMotorState(RoboteqDriver::kChannel2).GetTorque(), channel_2_state.current * kRbtqCurrentFbToNewtonMeters); - panther_hardware_interfaces::DriverState state; + husarion_ugv_hardware_interfaces::DriverState state; state.fault_flags = 0b00000001; state.script_flags = 0b00000010; diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp similarity index 80% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp index 288bc3d0..0d3a5051 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_driver.cpp @@ -20,14 +20,14 @@ #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_driver.hpp" #include "utils/fake_can_socket.hpp" #include "utils/mock_roboteq.hpp" #include "utils/test_constants.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" class TestRoboteqDriver : public ::testing::Test { @@ -44,26 +44,26 @@ class TestRoboteqDriver : public ::testing::Test static constexpr char kMotor1Name[] = "motor_1"; static constexpr char kMotor2Name[] = "motor_2"; - std::unique_ptr can_socket_; - std::unique_ptr mock_roboteq_; - std::unique_ptr canopen_manager_; - std::shared_ptr roboteq_driver_; + std::unique_ptr can_socket_; + std::unique_ptr mock_roboteq_; + std::unique_ptr canopen_manager_; + std::shared_ptr roboteq_driver_; }; TestRoboteqDriver::TestRoboteqDriver() { - can_socket_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings.can_interface_name); + can_socket_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings.can_interface_name); can_socket_->Initialize(); - canopen_manager_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings); + canopen_manager_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings); - mock_roboteq_ = std::make_unique(); + mock_roboteq_ = std::make_unique(); mock_roboteq_->Start(std::chrono::milliseconds(10), std::chrono::milliseconds(50)); canopen_manager_->Initialize(); - roboteq_driver_ = std::make_shared( + roboteq_driver_ = std::make_shared( canopen_manager_->GetMaster(), 1, std::chrono::milliseconds(100)); canopen_manager_->Activate(); @@ -80,10 +80,10 @@ TestRoboteqDriver::~TestRoboteqDriver() void TestRoboteqDriver::BootRoboteqDriver() { - auto motor_1 = std::make_shared( - roboteq_driver_, panther_hardware_interfaces::RoboteqDriver::kChannel1); - auto motor_2 = std::make_shared( - roboteq_driver_, panther_hardware_interfaces::RoboteqDriver::kChannel2); + auto motor_1 = std::make_shared( + roboteq_driver_, husarion_ugv_hardware_interfaces::RoboteqDriver::kChannel1); + auto motor_2 = std::make_shared( + roboteq_driver_, husarion_ugv_hardware_interfaces::RoboteqDriver::kChannel2); roboteq_driver_->AddMotorDriver(kMotor1Name, motor_1); roboteq_driver_->AddMotorDriver(kMotor2Name, motor_2); @@ -130,7 +130,7 @@ TEST_F(TestRoboteqDriver, BootErrorVendorId) TEST_F(TestRoboteqDriver, ReadRoboteqMotorStates) { - using panther_hardware_interfaces_test::DriverChannel; + using husarion_ugv_hardware_interfaces_test::DriverChannel; const std::int32_t motor_1_pos = 101; const std::int32_t motor_1_vel = 102; @@ -152,9 +152,9 @@ TEST_F(TestRoboteqDriver, ReadRoboteqMotorStates) std::this_thread::sleep_for(std::chrono::milliseconds(10)); - panther_hardware_interfaces::MotorDriverState motor_driver_state_1 = + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state_1 = roboteq_driver_->GetMotorDriver(kMotor1Name)->ReadState(); - panther_hardware_interfaces::MotorDriverState motor_driver_state_2 = + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state_2 = roboteq_driver_->GetMotorDriver(kMotor2Name)->ReadState(); EXPECT_EQ(motor_driver_state_1.pos, motor_1_pos); @@ -170,13 +170,13 @@ TEST_F(TestRoboteqDriver, ReadRoboteqMotorStatesTimestamps) { BootRoboteqDriver(); - panther_hardware_interfaces::MotorDriverState motor_driver_state_1 = + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state_1 = roboteq_driver_->GetMotorDriver(kMotor1Name)->ReadState(); // based on publishing frequency in the Roboteq mock (100Hz) std::this_thread::sleep_for(std::chrono::milliseconds(10)); - panther_hardware_interfaces::MotorDriverState motor_driver_state_2 = + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state_2 = roboteq_driver_->GetMotorDriver(kMotor2Name)->ReadState(); // feedback is published with a 100ms period, to check if timestamps are accurate, it is checked @@ -204,10 +204,10 @@ TEST_F(TestRoboteqDriver, ReadRoboteqMotorStatesTimestamps) TEST_F(TestRoboteqDriver, ReadState) { - using panther_hardware_interfaces_test::DriverChannel; - using panther_hardware_interfaces_test::DriverFaultFlags; - using panther_hardware_interfaces_test::DriverRuntimeErrors; - using panther_hardware_interfaces_test::DriverScriptFlags; + using husarion_ugv_hardware_interfaces_test::DriverChannel; + using husarion_ugv_hardware_interfaces_test::DriverFaultFlags; + using husarion_ugv_hardware_interfaces_test::DriverRuntimeErrors; + using husarion_ugv_hardware_interfaces_test::DriverScriptFlags; const std::int16_t temp = 30; const std::int16_t heatsink_temp = 31; @@ -230,7 +230,7 @@ TEST_F(TestRoboteqDriver, ReadState) std::this_thread::sleep_for(std::chrono::milliseconds(50)); - panther_hardware_interfaces::DriverState driver_state = roboteq_driver_->ReadState(); + husarion_ugv_hardware_interfaces::DriverState driver_state = roboteq_driver_->ReadState(); EXPECT_EQ(driver_state.mcu_temp, temp); EXPECT_EQ(driver_state.heatsink_temp, heatsink_temp); @@ -248,12 +248,12 @@ TEST_F(TestRoboteqDriver, ReadStateTimestamp) { BootRoboteqDriver(); - panther_hardware_interfaces::DriverState driver_state_1 = roboteq_driver_->ReadState(); + husarion_ugv_hardware_interfaces::DriverState driver_state_1 = roboteq_driver_->ReadState(); // based on publishing frequency in the Roboteq mock (20Hz) std::this_thread::sleep_for(std::chrono::milliseconds(50)); - panther_hardware_interfaces::DriverState driver_state_2 = roboteq_driver_->ReadState(); + husarion_ugv_hardware_interfaces::DriverState driver_state_2 = roboteq_driver_->ReadState(); // feedback is published with a 100ms period, to check if timestamps are accurate, it is checked // if consecutive messages will have timestamps 100ms + some threshold apart @@ -280,7 +280,7 @@ TEST_F(TestRoboteqDriver, ReadStateTimestamp) TEST_F(TestRoboteqDriver, SendRoboteqCmd) { - using panther_hardware_interfaces_test::DriverChannel; + using husarion_ugv_hardware_interfaces_test::DriverChannel; const std::int32_t motor_1_v = 10; const std::int32_t motor_2_v = 20; @@ -310,7 +310,7 @@ TEST_F(TestRoboteqDriver, ResetRoboteqScriptSDOTimeoutReset) BootRoboteqDriver(); mock_roboteq_->GetDriver()->SetOnWriteWait(0x2018, 0, 100000); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { roboteq_driver_->ResetScript(); }, "SDO protocol timed out")); mock_roboteq_->GetDriver()->SetOnWriteWait(0x2018, 0, 0); @@ -330,7 +330,7 @@ TEST_F(TestRoboteqDriver, TurnOnEStopTimeout) { BootRoboteqDriver(); mock_roboteq_->GetDriver()->SetOnWriteWait(0x200C, 0, 100000); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { roboteq_driver_->TurnOnEStop(); }, "SDO protocol timed out")); } @@ -347,7 +347,7 @@ TEST_F(TestRoboteqDriver, TurnOffEStopTimeout) { BootRoboteqDriver(); mock_roboteq_->GetDriver()->SetOnWriteWait(0x200D, 0, 100000); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { roboteq_driver_->TurnOffEStop(); }, "SDO protocol timed out")); } @@ -373,7 +373,7 @@ TEST_F(TestRoboteqDriver, WriteTimeout) { BootRoboteqDriver(); mock_roboteq_->GetDriver()->SetOnWriteWait(0x202C, 0, 200000); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { roboteq_driver_->GetMotorDriver(kMotor1Name)->TurnOnSafetyStop(); }, "SDO protocol timed out")); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp similarity index 87% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp index cd3d6566..d0219971 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_error_filter.cpp @@ -14,13 +14,13 @@ #include -#include +#include TEST(TestRoboteqErrorFilter, InitialState) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); ASSERT_FALSE(roboteq_error_filter.IsError()); EXPECT_FALSE(roboteq_error_filter.IsError(ErrorsFilterIds::WRITE_PDO_CMDS)); @@ -31,9 +31,9 @@ TEST(TestRoboteqErrorFilter, InitialState) TEST(TestRoboteqErrorFilter, FilterError) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::WRITE_PDO_CMDS, true); @@ -62,9 +62,9 @@ TEST(TestRoboteqErrorFilter, FilterError) TEST(TestRoboteqErrorFilter, Error) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::WRITE_PDO_CMDS, true); @@ -85,9 +85,9 @@ TEST(TestRoboteqErrorFilter, Error) TEST(TestRoboteqErrorFilter, FilterSecondError) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::READ_PDO_MOTOR_STATES, true); @@ -116,9 +116,9 @@ TEST(TestRoboteqErrorFilter, FilterSecondError) TEST(TestRoboteqErrorFilter, SecondError) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::READ_PDO_MOTOR_STATES, true); @@ -139,9 +139,9 @@ TEST(TestRoboteqErrorFilter, SecondError) TEST(TestRoboteqErrorFilter, ErrorSingle) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::READ_PDO_DRIVER_STATE, true); @@ -154,9 +154,9 @@ TEST(TestRoboteqErrorFilter, ErrorSingle) TEST(TestRoboteqErrorFilter, ClearErrors) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::WRITE_PDO_CMDS, true); roboteq_error_filter.UpdateError(ErrorsFilterIds::WRITE_PDO_CMDS, true); @@ -187,9 +187,9 @@ TEST(TestRoboteqErrorFilter, ClearErrors) TEST(TestRoboteqErrorFilter, ClearErrorsCounters) { - using panther_hardware_interfaces::ErrorsFilterIds; + using husarion_ugv_hardware_interfaces::ErrorsFilterIds; - panther_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); + husarion_ugv_hardware_interfaces::RoboteqErrorFilter roboteq_error_filter(2, 2, 1, 1); roboteq_error_filter.UpdateError(ErrorsFilterIds::WRITE_PDO_CMDS, true); roboteq_error_filter.UpdateError(ErrorsFilterIds::READ_PDO_MOTOR_STATES, true); diff --git a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp similarity index 81% rename from panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp index 714de2d9..77783d45 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/robot_driver/test_roboteq_robot_driver.cpp @@ -22,41 +22,43 @@ #include -#include "panther_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/canopen_manager.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" #include "utils/fake_can_socket.hpp" #include "utils/mock_driver.hpp" #include "utils/test_constants.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class RoboteqRobotDriverWrapper : public panther_hardware_interfaces::RoboteqRobotDriver +class RoboteqRobotDriverWrapper : public husarion_ugv_hardware_interfaces::RoboteqRobotDriver { public: RoboteqRobotDriverWrapper( - const panther_hardware_interfaces::CANopenSettings & canopen_settings, - const panther_hardware_interfaces::DrivetrainSettings & drivetrain_settings, + const husarion_ugv_hardware_interfaces::CANopenSettings & canopen_settings, + const husarion_ugv_hardware_interfaces::DrivetrainSettings & drivetrain_settings, const std::chrono::milliseconds activate_wait_time = std::chrono::milliseconds(1000)) : RoboteqRobotDriver(canopen_settings, drivetrain_settings, activate_wait_time) { // Assume 2 drivers and 4 motor drivers mock_fl_motor_driver = - std::make_shared(); + std::make_shared(); mock_fr_motor_driver = - std::make_shared(); + std::make_shared(); mock_rl_motor_driver = - std::make_shared(); + std::make_shared(); mock_rr_motor_driver = - std::make_shared(); + std::make_shared(); - mock_front_driver = std::make_shared(); + mock_front_driver = + std::make_shared(); mock_front_driver->AddMotorDriver(kLeftMotorDriverName, mock_fl_motor_driver); mock_front_driver->AddMotorDriver(kRightMotorDriverName, mock_fr_motor_driver); - mock_rear_driver = std::make_shared(); + mock_rear_driver = + std::make_shared(); mock_rear_driver->AddMotorDriver(kLeftMotorDriverName, mock_rl_motor_driver); mock_rear_driver->AddMotorDriver(kRightMotorDriverName, mock_rr_motor_driver); } @@ -75,12 +77,16 @@ class RoboteqRobotDriverWrapper : public panther_hardware_interfaces::RoboteqRob static constexpr char kLeftMotorDriverName[] = "left"; static constexpr char kRightMotorDriverName[] = "right"; - std::shared_ptr mock_front_driver; - std::shared_ptr mock_rear_driver; - std::shared_ptr mock_fl_motor_driver; - std::shared_ptr mock_fr_motor_driver; - std::shared_ptr mock_rl_motor_driver; - std::shared_ptr mock_rr_motor_driver; + std::shared_ptr mock_front_driver; + std::shared_ptr mock_rear_driver; + std::shared_ptr + mock_fl_motor_driver; + std::shared_ptr + mock_fr_motor_driver; + std::shared_ptr + mock_rl_motor_driver; + std::shared_ptr + mock_rr_motor_driver; }; class TestRoboteqRobotDriverInitialization : public ::testing::Test @@ -88,19 +94,19 @@ class TestRoboteqRobotDriverInitialization : public ::testing::Test public: TestRoboteqRobotDriverInitialization() { - can_socket_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings.can_interface_name); + can_socket_ = std::make_unique( + husarion_ugv_hardware_interfaces_test::kCANopenSettings.can_interface_name); can_socket_->Initialize(); robot_driver_ = std::make_unique( - panther_hardware_interfaces_test::kCANopenSettings, - panther_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); + husarion_ugv_hardware_interfaces_test::kCANopenSettings, + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings, std::chrono::milliseconds(10)); } ~TestRoboteqRobotDriverInitialization() {} protected: - std::unique_ptr can_socket_; + std::unique_ptr can_socket_; std::unique_ptr robot_driver_; }; @@ -164,7 +170,7 @@ TEST_F(TestRoboteqRobotDriver, GetDataError) const std::string name = "invalid_name"; const std::string error_msg = "Data with name '" + name + "' does not exist."; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&] { robot_driver_->GetData(name); }, error_msg)); } @@ -206,10 +212,10 @@ TEST_F(TestRoboteqRobotDriver, UpdateCommunicationStateHeartbeatTimeout) TEST_F(TestRoboteqRobotDriver, UpdateMotorsState) { - using panther_hardware_interfaces::MotorChannels; - using panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - using panther_hardware_interfaces_test::kRbtqPosFbToRad; - using panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + using husarion_ugv_hardware_interfaces::MotorChannels; + using husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + using husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + using husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; const std::int32_t fl_pos = 101; const std::int32_t fl_vel = 102; @@ -225,17 +231,17 @@ TEST_F(TestRoboteqRobotDriver, UpdateMotorsState) const std::int32_t rr_current = 403; ON_CALL(*robot_driver_->mock_fl_motor_driver, ReadState()) - .WillByDefault(::testing::Return( - panther_hardware_interfaces::MotorDriverState({fl_pos, fl_vel, fl_current, {0, 0}, {0, 0}}))); + .WillByDefault(::testing::Return(husarion_ugv_hardware_interfaces::MotorDriverState( + {fl_pos, fl_vel, fl_current, {0, 0}, {0, 0}}))); ON_CALL(*robot_driver_->mock_fr_motor_driver, ReadState()) - .WillByDefault(::testing::Return( - panther_hardware_interfaces::MotorDriverState({fr_pos, fr_vel, fr_current, {0, 0}, {0, 0}}))); + .WillByDefault(::testing::Return(husarion_ugv_hardware_interfaces::MotorDriverState( + {fr_pos, fr_vel, fr_current, {0, 0}, {0, 0}}))); ON_CALL(*robot_driver_->mock_rl_motor_driver, ReadState()) - .WillByDefault(::testing::Return( - panther_hardware_interfaces::MotorDriverState({rl_pos, rl_vel, rl_current, {0, 0}, {0, 0}}))); + .WillByDefault(::testing::Return(husarion_ugv_hardware_interfaces::MotorDriverState( + {rl_pos, rl_vel, rl_current, {0, 0}, {0, 0}}))); ON_CALL(*robot_driver_->mock_rr_motor_driver, ReadState()) - .WillByDefault(::testing::Return( - panther_hardware_interfaces::MotorDriverState({rr_pos, rr_vel, rr_current, {0, 0}, {0, 0}}))); + .WillByDefault(::testing::Return(husarion_ugv_hardware_interfaces::MotorDriverState( + {rr_pos, rr_vel, rr_current, {0, 0}, {0, 0}}))); robot_driver_->UpdateMotorsState(); @@ -268,10 +274,10 @@ TEST_F(TestRoboteqRobotDriver, UpdateMotorsState) TEST_F(TestRoboteqRobotDriver, UpdateMotorsStateTimestamps) { auto current_time = GetCurrentTimeWithTimeout( - panther_hardware_interfaces_test::kCANopenSettings.pdo_motor_states_timeout_ms); + husarion_ugv_hardware_interfaces_test::kCANopenSettings.pdo_motor_states_timeout_ms); auto read_motor_driver_state_method = [¤t_time]() { - panther_hardware_interfaces::MotorDriverState state; + husarion_ugv_hardware_interfaces::MotorDriverState state; state.pos_timestamp = current_time; state.vel_current_timestamp = current_time; return state; @@ -302,9 +308,9 @@ TEST_F(TestRoboteqRobotDriver, UpdateMotorsStateTimestamps) TEST_F(TestRoboteqRobotDriver, UpdateMotorsStateTimeout) { const auto current_time = GetCurrentTimeWithTimeout( - panther_hardware_interfaces_test::kCANopenSettings.pdo_motor_states_timeout_ms); + husarion_ugv_hardware_interfaces_test::kCANopenSettings.pdo_motor_states_timeout_ms); - panther_hardware_interfaces::MotorDriverState state = {0, 0, 0, current_time, current_time}; + husarion_ugv_hardware_interfaces::MotorDriverState state = {0, 0, 0, current_time, current_time}; ON_CALL(*robot_driver_->mock_fl_motor_driver, ReadState()) .WillByDefault(::testing::Return(state)); @@ -327,7 +333,7 @@ TEST_F(TestRoboteqRobotDriver, UpdateMotorsStateTimeout) TEST_F(TestRoboteqRobotDriver, UpdateDriverState) { - using panther_hardware_interfaces::MotorChannels; + using husarion_ugv_hardware_interfaces::MotorChannels; const std::int16_t f_temp = 30; const std::int16_t r_temp = 32; @@ -349,7 +355,7 @@ TEST_F(TestRoboteqRobotDriver, UpdateDriverState) const std::uint8_t runtime_error_forward_limit_triggered = static_cast(0b10000); const std::uint8_t runtime_error_reverse_limit_triggered = static_cast(0b100000); - panther_hardware_interfaces::DriverState front_driver_state_data = { + husarion_ugv_hardware_interfaces::DriverState front_driver_state_data = { fault_flag_overheat, script_flag_encoder_disconnected, runtime_error_loop_error, @@ -362,7 +368,7 @@ TEST_F(TestRoboteqRobotDriver, UpdateDriverState) {0, 0}, {0, 0}}; - panther_hardware_interfaces::DriverState rear_driver_state_data = { + husarion_ugv_hardware_interfaces::DriverState rear_driver_state_data = { fault_flag_overvoltage, script_flag_amp_limiter, runtime_error_forward_limit_triggered, @@ -377,10 +383,10 @@ TEST_F(TestRoboteqRobotDriver, UpdateDriverState) ON_CALL(*robot_driver_->mock_front_driver, ReadState()) .WillByDefault( - ::testing::Return(panther_hardware_interfaces::DriverState(front_driver_state_data))); + ::testing::Return(husarion_ugv_hardware_interfaces::DriverState(front_driver_state_data))); ON_CALL(*robot_driver_->mock_rear_driver, ReadState()) .WillByDefault( - ::testing::Return(panther_hardware_interfaces::DriverState(rear_driver_state_data))); + ::testing::Return(husarion_ugv_hardware_interfaces::DriverState(rear_driver_state_data))); robot_driver_->UpdateDriversState(); @@ -420,10 +426,10 @@ TEST_F(TestRoboteqRobotDriver, UpdateDriverState) TEST_F(TestRoboteqRobotDriver, UpdateDriverStateTimestamps) { auto current_time = GetCurrentTimeWithTimeout( - panther_hardware_interfaces_test::kCANopenSettings.pdo_driver_state_timeout_ms); + husarion_ugv_hardware_interfaces_test::kCANopenSettings.pdo_driver_state_timeout_ms); auto read_driver_state_method = [¤t_time]() { - panther_hardware_interfaces::DriverState state; + husarion_ugv_hardware_interfaces::DriverState state; state.flags_current_timestamp = current_time; state.voltages_temps_timestamp = current_time; return state; @@ -450,9 +456,9 @@ TEST_F(TestRoboteqRobotDriver, UpdateDriverStateTimestamps) TEST_F(TestRoboteqRobotDriver, UpdateDriverStateTimeout) { const auto current_time = GetCurrentTimeWithTimeout( - panther_hardware_interfaces_test::kCANopenSettings.pdo_driver_state_timeout_ms); + husarion_ugv_hardware_interfaces_test::kCANopenSettings.pdo_driver_state_timeout_ms); - panther_hardware_interfaces::DriverState state = { + husarion_ugv_hardware_interfaces::DriverState state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, current_time, current_time}; ON_CALL(*robot_driver_->mock_front_driver, ReadState()).WillByDefault(::testing::Return(state)); diff --git a/panther_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp similarity index 64% rename from panther_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp index ed1ecd65..8f735d4c 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_lynx_system.cpp @@ -22,22 +22,22 @@ #include -#include "panther_hardware_interfaces/panther_system/lynx_system.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/lynx_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" #include "utils/system_test_utils.hpp" #include "utils/test_constants.hpp" -class LynxSystemWrapper : public panther_hardware_interfaces::LynxSystem +class LynxSystemWrapper : public husarion_ugv_hardware_interfaces::LynxSystem { public: LynxSystemWrapper() : LynxSystem() { mock_robot_driver = - std::make_shared(); + std::make_shared(); mock_gpio_controller = - std::make_shared(); - mock_e_stop = std::make_shared(); + std::make_shared(); + mock_e_stop = std::make_shared(); } void DefineRobotDriver() override { robot_driver_ = mock_robot_driver; } @@ -61,20 +61,24 @@ class LynxSystemWrapper : public panther_hardware_interfaces::LynxSystem hw_commands_velocities_[3] = velocities[3]; } - panther_hardware_interfaces::CANopenSettings GetCANopenSettings() { return canopen_settings_; } + husarion_ugv_hardware_interfaces::CANopenSettings GetCANopenSettings() + { + return canopen_settings_; + } std::vector GetHwStatesPositions() { return hw_states_positions_; } std::vector GetHwStatesVelocities() { return hw_states_velocities_; } std::vector GetHwStatesEfforts() { return hw_states_efforts_; } - std::shared_ptr GetRoboteqErrorFilter() + std::shared_ptr GetRoboteqErrorFilter() { return roboteq_error_filter_; } - std::shared_ptr mock_robot_driver; - std::shared_ptr + std::shared_ptr + mock_robot_driver; + std::shared_ptr mock_gpio_controller; - std::shared_ptr mock_e_stop; + std::shared_ptr mock_e_stop; }; class TestLynxSystem : public ::testing::Test @@ -84,7 +88,7 @@ class TestLynxSystem : public ::testing::Test { lynx_system_ = std::make_shared(); - hardware_info_ = panther_hardware_interfaces_test::GenerateDefaultHardwareInfo(); + hardware_info_ = husarion_ugv_hardware_interfaces_test::GenerateDefaultHardwareInfo(); hardware_info_.hardware_parameters.emplace("driver_can_id", "1"); lynx_system_->on_init(hardware_info_); @@ -106,7 +110,7 @@ TEST_F(TestLynxSystem, ReadCANopenSettingsDriverCANIDs) EXPECT_EQ(canopen_settings.driver_can_ids.size(), 1); EXPECT_EQ( - canopen_settings.driver_can_ids.at(panther_hardware_interfaces::DriverNames::DEFAULT), 1); + canopen_settings.driver_can_ids.at(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT), 1); } TEST_F(TestLynxSystem, UpdateHwStates) @@ -118,29 +122,31 @@ TEST_F(TestLynxSystem, UpdateHwStates) const std::int16_t right_vel = 50; const std::int16_t right_eff = 60; - const auto left_expected_pos = left_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; - const auto left_expected_vel = left_vel * panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; - const auto left_expected_eff = left_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - const auto right_expected_pos = right_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; + const auto left_expected_pos = left_pos * husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + const auto left_expected_vel = left_vel * + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + const auto left_expected_eff = + left_eff * husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + const auto right_expected_pos = right_pos * + husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; const auto right_expected_vel = right_vel * - panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; - const auto right_expected_eff = right_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + const auto right_expected_eff = + right_eff * husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - panther_hardware_interfaces::MotorDriverState left_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState left_motor_driver_state = { left_pos, left_vel, left_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::MotorDriverState right_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState right_motor_driver_state = { right_pos, right_vel, right_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); // left - channel 2, right - channel 1 roboteq_data.SetMotorsStates(right_motor_driver_state, left_motor_driver_state, false); EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); ASSERT_NO_THROW(lynx_system_->UpdateHwStates()); @@ -163,22 +169,22 @@ TEST_F(TestLynxSystem, UpdateHwStates) TEST_F(TestLynxSystem, UpdateMotorsStateDataTimedOut) { - panther_hardware_interfaces::MotorDriverState motor_driver_state; + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetMotorsStates(motor_driver_state, motor_driver_state, true); EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->UpdateMotorsStateDataTimedOut(); auto error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); EXPECT_TRUE(error); @@ -187,15 +193,15 @@ TEST_F(TestLynxSystem, UpdateMotorsStateDataTimedOut) EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); lynx_system_->UpdateMotorsStateDataTimedOut(); error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); EXPECT_FALSE(error); } @@ -208,23 +214,23 @@ TEST_F(TestLynxSystem, UpdateDriverStateMsg) TEST_F(TestLynxSystem, UpdateFlagErrors) { - auto driver_state = panther_hardware_interfaces::DriverState(); + auto driver_state = husarion_ugv_hardware_interfaces::DriverState(); driver_state.fault_flags = 0b01; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetDriverState(driver_state, false); EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->UpdateFlagErrors(); auto error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); EXPECT_TRUE(error); @@ -234,37 +240,37 @@ TEST_F(TestLynxSystem, UpdateFlagErrors) EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); lynx_system_->UpdateFlagErrors(); error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); EXPECT_FALSE(error); } TEST_F(TestLynxSystem, UpdateDriverStateDataTimedOut) { - panther_hardware_interfaces::DriverState driver_state; + husarion_ugv_hardware_interfaces::DriverState driver_state; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetDriverState(driver_state, true); EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->UpdateDriverStateDataTimedOut(); auto error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); EXPECT_TRUE(error); @@ -273,15 +279,15 @@ TEST_F(TestLynxSystem, UpdateDriverStateDataTimedOut) EXPECT_CALL( *lynx_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::DEFAULT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::DEFAULT))) .WillOnce(::testing::ReturnRef(roboteq_data)); lynx_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); lynx_system_->UpdateDriverStateDataTimedOut(); error_map = lynx_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); EXPECT_FALSE(error); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp similarity index 59% rename from panther_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp index f75704ef..4f48e28b 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_panther_system.cpp @@ -22,28 +22,30 @@ #include -#include "panther_hardware_interfaces/panther_system/panther_system.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/panther_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/roboteq_robot_driver.hpp" #include "utils/system_test_utils.hpp" #include "utils/test_constants.hpp" -class PantherSystemWrapper : public panther_hardware_interfaces::PantherSystem +class PantherSystemWrapper : public husarion_ugv_hardware_interfaces::PantherSystem { public: PantherSystemWrapper() : PantherSystem() { mock_robot_driver = - std::make_shared(); + std::make_shared(); mock_gpio_controller = - std::make_shared(); - mock_e_stop = std::make_shared(); + std::make_shared(); + mock_e_stop = std::make_shared(); ON_CALL( - *mock_robot_driver, GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + *mock_robot_driver, + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .WillByDefault(::testing::ReturnRef(default_driver_data)); ON_CALL( - *mock_robot_driver, GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + *mock_robot_driver, + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .WillByDefault(::testing::ReturnRef(default_driver_data)); } @@ -68,24 +70,29 @@ class PantherSystemWrapper : public panther_hardware_interfaces::PantherSystem hw_commands_velocities_[3] = velocities[3]; } - panther_hardware_interfaces::CANopenSettings GetCANopenSettings() { return canopen_settings_; } + husarion_ugv_hardware_interfaces::CANopenSettings GetCANopenSettings() + { + return canopen_settings_; + } std::vector GetHwStatesPositions() { return hw_states_positions_; } std::vector GetHwStatesVelocities() { return hw_states_velocities_; } std::vector GetHwStatesEfforts() { return hw_states_efforts_; } - std::shared_ptr GetRoboteqErrorFilter() + std::shared_ptr GetRoboteqErrorFilter() { return roboteq_error_filter_; } - std::shared_ptr mock_robot_driver; - std::shared_ptr + std::shared_ptr + mock_robot_driver; + std::shared_ptr mock_gpio_controller; - std::shared_ptr mock_e_stop; + std::shared_ptr mock_e_stop; private: - panther_hardware_interfaces::DriverData default_driver_data = - panther_hardware_interfaces::DriverData(panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData default_driver_data = + husarion_ugv_hardware_interfaces::DriverData( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); }; class TestPantherSystem : public ::testing::Test @@ -95,7 +102,7 @@ class TestPantherSystem : public ::testing::Test { panther_system_ = std::make_shared(); - hardware_info_ = panther_hardware_interfaces_test::GenerateDefaultHardwareInfo(); + hardware_info_ = husarion_ugv_hardware_interfaces_test::GenerateDefaultHardwareInfo(); hardware_info_.hardware_parameters.emplace("front_driver_can_id", "1"); hardware_info_.hardware_parameters.emplace("rear_driver_can_id", "2"); @@ -117,8 +124,10 @@ TEST_F(TestPantherSystem, ReadCANopenSettingsDriverCANIDs) const auto canopen_settings = panther_system_->GetCANopenSettings(); EXPECT_EQ(canopen_settings.driver_can_ids.size(), 2); - EXPECT_EQ(canopen_settings.driver_can_ids.at(panther_hardware_interfaces::DriverNames::FRONT), 1); - EXPECT_EQ(canopen_settings.driver_can_ids.at(panther_hardware_interfaces::DriverNames::REAR), 2); + EXPECT_EQ( + canopen_settings.driver_can_ids.at(husarion_ugv_hardware_interfaces::DriverNames::FRONT), 1); + EXPECT_EQ( + canopen_settings.driver_can_ids.at(husarion_ugv_hardware_interfaces::DriverNames::REAR), 2); } TEST_F(TestPantherSystem, UpdateHwStates) @@ -136,47 +145,51 @@ TEST_F(TestPantherSystem, UpdateHwStates) const std::int16_t rr_vel = 110; const std::int16_t rr_eff = 120; - const auto fl_expected_pos = fl_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; - const auto fl_expected_vel = fl_vel * panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + const auto fl_expected_pos = fl_pos * husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + const auto fl_expected_vel = fl_vel * + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; const auto fl_expected_eff = fl_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - const auto fr_expected_pos = fr_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; - const auto fr_expected_vel = fr_vel * panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + const auto fr_expected_pos = fr_pos * husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + const auto fr_expected_vel = fr_vel * + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; const auto fr_expected_eff = fr_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - const auto rl_expected_pos = rl_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; - const auto rl_expected_vel = rl_vel * panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + const auto rl_expected_pos = rl_pos * husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + const auto rl_expected_vel = rl_vel * + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; const auto rl_expected_eff = rl_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - const auto rr_expected_pos = rr_pos * panther_hardware_interfaces_test::kRbtqPosFbToRad; - const auto rr_expected_vel = rr_vel * panther_hardware_interfaces_test::kRbtqVelFbToRadPerSec; + husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + const auto rr_expected_pos = rr_pos * husarion_ugv_hardware_interfaces_test::kRbtqPosFbToRad; + const auto rr_expected_vel = rr_vel * + husarion_ugv_hardware_interfaces_test::kRbtqVelFbToRadPerSec; const auto rr_expected_eff = rr_eff * - panther_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; + husarion_ugv_hardware_interfaces_test::kRbtqCurrentFbToNewtonMeters; - panther_hardware_interfaces::MotorDriverState fl_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState fl_motor_driver_state = { fl_pos, fl_vel, fl_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::MotorDriverState fr_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState fr_motor_driver_state = { fr_pos, fr_vel, fr_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::MotorDriverState rl_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState rl_motor_driver_state = { rl_pos, rl_vel, rl_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::MotorDriverState rr_motor_driver_state = { + husarion_ugv_hardware_interfaces::MotorDriverState rr_motor_driver_state = { rr_pos, rr_vel, rr_eff, {0, 0}, {0, 0}}; - panther_hardware_interfaces::DriverData front_roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); - panther_hardware_interfaces::DriverData rear_roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData front_roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData rear_roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); // left - channel 2, right - channel 1 front_roboteq_data.SetMotorsStates(fr_motor_driver_state, fl_motor_driver_state, false); rear_roboteq_data.SetMotorsStates(rr_motor_driver_state, rl_motor_driver_state, false); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .WillOnce(::testing::ReturnRef(front_roboteq_data)); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .WillOnce(::testing::ReturnRef(rear_roboteq_data)); ASSERT_NO_THROW(panther_system_->UpdateHwStates()); @@ -199,26 +212,26 @@ TEST_F(TestPantherSystem, UpdateHwStates) TEST_F(TestPantherSystem, UpdateMotorsStateDataTimedOut) { - panther_hardware_interfaces::MotorDriverState motor_driver_state; + husarion_ugv_hardware_interfaces::MotorDriverState motor_driver_state; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetMotorsStates(motor_driver_state, motor_driver_state, true); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .WillOnce(::testing::ReturnRef(roboteq_data)); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .Times(0); panther_system_->UpdateMotorsStateDataTimedOut(); auto error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); EXPECT_TRUE(error); @@ -227,19 +240,19 @@ TEST_F(TestPantherSystem, UpdateMotorsStateDataTimedOut) EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .Times(1); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .Times(1); panther_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); panther_system_->UpdateMotorsStateDataTimedOut(); error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_MOTOR_STATES)); EXPECT_FALSE(error); } @@ -252,30 +265,30 @@ TEST_F(TestPantherSystem, UpdateDriverStateMsg) TEST_F(TestPantherSystem, UpdateFlagErrors) { - panther_hardware_interfaces::DriverState driver_state; + husarion_ugv_hardware_interfaces::DriverState driver_state; driver_state.fault_flags = 0b01; driver_state.script_flags = 0; driver_state.runtime_stat_flag_channel_1 = 0; driver_state.runtime_stat_flag_channel_2 = 0; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetDriverState(driver_state, false); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .Times(1); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .WillOnce(::testing::ReturnRef(roboteq_data)); panther_system_->UpdateFlagErrors(); auto error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); EXPECT_TRUE(error); @@ -285,45 +298,45 @@ TEST_F(TestPantherSystem, UpdateFlagErrors) EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .Times(1); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .WillOnce(::testing::ReturnRef(roboteq_data)); panther_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); panther_system_->UpdateFlagErrors(); error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::ROBOTEQ_DRIVER)); EXPECT_FALSE(error); } TEST_F(TestPantherSystem, UpdateDriverStateDataTimedOut) { - panther_hardware_interfaces::DriverState driver_state; + husarion_ugv_hardware_interfaces::DriverState driver_state; - panther_hardware_interfaces::DriverData roboteq_data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData roboteq_data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); roboteq_data.SetDriverState(driver_state, true); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .WillOnce(::testing::ReturnRef(roboteq_data)); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .Times(0); panther_system_->UpdateDriverStateDataTimedOut(); auto error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - auto error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); + auto error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); EXPECT_TRUE(error); @@ -332,19 +345,19 @@ TEST_F(TestPantherSystem, UpdateDriverStateDataTimedOut) EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::FRONT))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::FRONT))) .WillOnce(::testing::ReturnRef(roboteq_data)); EXPECT_CALL( *panther_system_->mock_robot_driver, - GetData(::testing::Eq(panther_hardware_interfaces::DriverNames::REAR))) + GetData(::testing::Eq(husarion_ugv_hardware_interfaces::DriverNames::REAR))) .Times(1); panther_system_->GetRoboteqErrorFilter()->SetClearErrorsFlag(); panther_system_->UpdateDriverStateDataTimedOut(); error_map = panther_system_->GetRoboteqErrorFilter()->GetErrorMap(); - error = error_map.at(panther_hardware_interfaces::error_filter_id_names.at( - panther_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); + error = error_map.at(husarion_ugv_hardware_interfaces::error_filter_id_names.at( + husarion_ugv_hardware_interfaces::ErrorsFilterIds::READ_PDO_DRIVER_STATE)); EXPECT_FALSE(error); } diff --git a/panther_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp similarity index 87% rename from panther_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp index 68e2fbff..44cd950e 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_system_ros_interface.cpp @@ -22,13 +22,13 @@ #include -#include +#include #include "utils/test_constants.hpp" using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState; -class SystemROSInterfaceWrapper : public panther_hardware_interfaces::SystemROSInterface +class SystemROSInterfaceWrapper : public husarion_ugv_hardware_interfaces::SystemROSInterface { public: SystemROSInterfaceWrapper(const std::string & node_name) : SystemROSInterface(node_name) {} @@ -52,7 +52,7 @@ class TestSystemROSInterface : public ::testing::Test TEST(TestSystemROSInterfaceInitialization, NodeCreation) { - using panther_hardware_interfaces::SystemROSInterface; + using husarion_ugv_hardware_interfaces::SystemROSInterface; std::vector node_names; const std::string system_node_name = "hardware_controller"; @@ -82,10 +82,10 @@ TEST(TestSystemROSInterfaceInitialization, NodeCreation) TEST_F(TestSystemROSInterface, UpdateMsgErrorFlags) { - panther_hardware_interfaces::DriverData data( - panther_hardware_interfaces_test::kDrivetrainSettings); + husarion_ugv_hardware_interfaces::DriverData data( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings); - panther_hardware_interfaces::DriverState driver_state; + husarion_ugv_hardware_interfaces::DriverState driver_state; driver_state.fault_flags = 0b00000001; driver_state.script_flags = 0b00000010; driver_state.runtime_stat_flag_channel_1 = 0b00001000; @@ -106,7 +106,7 @@ TEST_F(TestSystemROSInterface, UpdateMsgErrorFlags) TEST_F(TestSystemROSInterface, UpdateMsgDriversStates) { - panther_hardware_interfaces::RoboteqDriverState state; + husarion_ugv_hardware_interfaces::RoboteqDriverState state; const std::int16_t temp = 36; const std::int16_t heatsink_temp = 37; @@ -138,14 +138,14 @@ TEST_F(TestSystemROSInterface, UpdateMsgDriversStates) TEST_F(TestSystemROSInterface, UpdateMsgErrors) { - panther_hardware_interfaces::CANErrors can_errors; + husarion_ugv_hardware_interfaces::CANErrors can_errors; can_errors.error = true; can_errors.write_pdo_cmds_error = true; can_errors.read_pdo_motor_states_error = false; can_errors.read_pdo_driver_state_error = false; - panther_hardware_interfaces::DriverCANErrors driver_can_errors; + husarion_ugv_hardware_interfaces::DriverCANErrors driver_can_errors; driver_can_errors.motor_states_data_timed_out = true; driver_can_errors.driver_state_data_timed_out = false; driver_can_errors.can_error = false; @@ -181,12 +181,13 @@ TEST_F(TestSystemROSInterface, CreateDriverStateEntryInMsg) // check 3 different methods that can create a new entry in the message system_ros_interface_->UpdateMsgErrorFlags( - driver_1_name, - panther_hardware_interfaces::DriverData(panther_hardware_interfaces_test::kDrivetrainSettings)); + driver_1_name, husarion_ugv_hardware_interfaces::DriverData( + husarion_ugv_hardware_interfaces_test::kDrivetrainSettings)); system_ros_interface_->UpdateMsgDriversStates(driver_2_name, {}); - panther_hardware_interfaces::CANErrors can_errors; - can_errors.driver_errors.emplace(driver_3_name, panther_hardware_interfaces::DriverCANErrors()); + husarion_ugv_hardware_interfaces::CANErrors can_errors; + can_errors.driver_errors.emplace( + driver_3_name, husarion_ugv_hardware_interfaces::DriverCANErrors()); system_ros_interface_->UpdateMsgErrors(can_errors); EXPECT_EQ(driver_state_msg.driver_states.size(), 3); diff --git a/panther_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp similarity index 90% rename from panther_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp rename to husarion_ugv_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp index 0474f8cd..cbcb6f36 100644 --- a/panther_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp +++ b/husarion_ugv_hardware_interfaces/test/unit/panther_system/test_ugv_system.cpp @@ -23,21 +23,21 @@ #include #include -#include "panther_hardware_interfaces/panther_system/ugv_system.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/ugv_system.hpp" #include "utils/system_test_utils.hpp" -class MockUGVSystem : public panther_hardware_interfaces::UGVSystem +class MockUGVSystem : public husarion_ugv_hardware_interfaces::UGVSystem { public: MockUGVSystem(const std::vector & joint_order) - : panther_hardware_interfaces::UGVSystem(joint_order) + : husarion_ugv_hardware_interfaces::UGVSystem(joint_order) { mock_robot_driver_ = - std::make_shared(); + std::make_shared(); mock_gpio_controller_ = - std::make_shared(); - mock_e_stop_ = std::make_shared(); + std::make_shared(); + mock_e_stop_ = std::make_shared(); ON_CALL(*this, DefineRobotDriver()).WillByDefault(::testing::Invoke([&]() { robot_driver_ = mock_robot_driver_; @@ -69,7 +69,8 @@ class MockUGVSystem : public panther_hardware_interfaces::UGVSystem void DefaultDefineRobotDriver() { - robot_driver_ = std::make_shared(); + robot_driver_ = + std::make_shared(); } void SetHwCommandVelocity(const std::vector & velocity) @@ -83,18 +84,19 @@ class MockUGVSystem : public panther_hardware_interfaces::UGVSystem } void SetHwStateEffort(const std::vector & effort) { hw_states_efforts_ = effort; } - std::shared_ptr GetMockRobotDriver() + std::shared_ptr + GetMockRobotDriver() { return mock_robot_driver_; } - std::shared_ptr + std::shared_ptr GetMockGPIOController() { return mock_gpio_controller_; } - std::shared_ptr GetMockEStop() + std::shared_ptr GetMockEStop() { return mock_e_stop_; } @@ -102,10 +104,11 @@ class MockUGVSystem : public panther_hardware_interfaces::UGVSystem using NiceMock = testing::NiceMock; private: - std::shared_ptr mock_robot_driver_; - std::shared_ptr + std::shared_ptr + mock_robot_driver_; + std::shared_ptr mock_gpio_controller_; - std::shared_ptr mock_e_stop_; + std::shared_ptr mock_e_stop_; }; class TestUGVSystem : public ::testing::Test @@ -116,7 +119,7 @@ class TestUGVSystem : public ::testing::Test ugv_system_ = std::make_shared(std::vector{"fl", "fr", "rl", "rr"}); - hardware_info_ = panther_hardware_interfaces_test::GenerateDefaultHardwareInfo(); + hardware_info_ = husarion_ugv_hardware_interfaces_test::GenerateDefaultHardwareInfo(); } ~TestUGVSystem() {} diff --git a/panther_hardware_interfaces/test/utils/fake_can_socket.hpp b/husarion_ugv_hardware_interfaces/test/utils/fake_can_socket.hpp similarity index 86% rename from panther_hardware_interfaces/test/utils/fake_can_socket.hpp rename to husarion_ugv_hardware_interfaces/test/utils/fake_can_socket.hpp index e2920cff..0cb07b86 100644 --- a/panther_hardware_interfaces/test/utils/fake_can_socket.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/fake_can_socket.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ #include #include #include -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { class FakeCANSocket @@ -75,6 +75,6 @@ class FakeCANSocket bool can_device_created_; }; -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_FAKE_CAN_SOCKET_HPP_ diff --git a/panther_hardware_interfaces/test/utils/mock_driver.hpp b/husarion_ugv_hardware_interfaces/test/utils/mock_driver.hpp similarity index 63% rename from panther_hardware_interfaces/test/utils/mock_driver.hpp rename to husarion_ugv_hardware_interfaces/test/utils/mock_driver.hpp index da2b3390..d9da785b 100644 --- a/panther_hardware_interfaces/test/utils/mock_driver.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/mock_driver.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ #include #include @@ -22,12 +22,12 @@ #include -#include "panther_hardware_interfaces/panther_system/robot_driver/driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/driver.hpp" -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { -class MockDriver : public panther_hardware_interfaces::DriverInterface +class MockDriver : public husarion_ugv_hardware_interfaces::DriverInterface { public: MockDriver() @@ -43,12 +43,12 @@ class MockDriver : public panther_hardware_interfaces::DriverInterface MOCK_METHOD(bool, IsCANError, (), (const, override)); MOCK_METHOD(bool, IsHeartbeatTimeout, (), (const, override)); - MOCK_METHOD(panther_hardware_interfaces::DriverState, ReadState, (), (override)); + MOCK_METHOD(husarion_ugv_hardware_interfaces::DriverState, ReadState, (), (override)); MOCK_METHOD(void, ResetScript, (), (override)); MOCK_METHOD(void, TurnOnEStop, (), (override)); MOCK_METHOD(void, TurnOffEStop, (), (override)); - std::shared_ptr GetMotorDriver( + std::shared_ptr GetMotorDriver( const std::string & name) override { return motor_drivers_.at(name); @@ -56,7 +56,7 @@ class MockDriver : public panther_hardware_interfaces::DriverInterface void AddMotorDriver( const std::string name, - std::shared_ptr motor_driver) override + std::shared_ptr motor_driver) override { motor_drivers_.emplace(name, motor_driver); } @@ -64,20 +64,20 @@ class MockDriver : public panther_hardware_interfaces::DriverInterface using NiceMock = testing::NiceMock; private: - std::map> + std::map> motor_drivers_; }; -class MockMotorDriver : public panther_hardware_interfaces::MotorDriverInterface +class MockMotorDriver : public husarion_ugv_hardware_interfaces::MotorDriverInterface { public: - MOCK_METHOD(panther_hardware_interfaces::MotorDriverState, ReadState, (), (override)); + MOCK_METHOD(husarion_ugv_hardware_interfaces::MotorDriverState, ReadState, (), (override)); MOCK_METHOD(void, SendCmdVel, (const std::int32_t cmd), (override)); MOCK_METHOD(void, TurnOnSafetyStop, (), (override)); using NiceMock = testing::NiceMock; }; -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_DRIVER_HPP_ diff --git a/panther_hardware_interfaces/test/utils/mock_roboteq.hpp b/husarion_ugv_hardware_interfaces/test/utils/mock_roboteq.hpp similarity index 95% rename from panther_hardware_interfaces/test/utils/mock_roboteq.hpp rename to husarion_ugv_hardware_interfaces/test/utils/mock_roboteq.hpp index c863daf4..d2ff9f7f 100644 --- a/panther_hardware_interfaces/test/utils/mock_roboteq.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/mock_roboteq.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ #include #include @@ -31,7 +31,7 @@ #include "lely/io2/sys/sigset.hpp" #include "lely/io2/sys/timer.hpp" -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { enum class DriverFaultFlags { @@ -284,11 +284,11 @@ class MockRoboteq std::thread([this, motors_states_period, driver_state_period]() { std::string slave_eds_path = std::filesystem::path( - ament_index_cpp::get_package_share_directory("panther_hardware_interfaces")) / + ament_index_cpp::get_package_share_directory("husarion_ugv_hardware_interfaces")) / "config" / "roboteq_motor_controllers_v80_21a.eds"; std::string slave1_eds_bin_path = std::filesystem::path( - ament_index_cpp::get_package_share_directory("panther_hardware_interfaces")) / + ament_index_cpp::get_package_share_directory("husarion_ugv_hardware_interfaces")) / "test" / "config" / "slave_1.bin"; lely::io::IoGuard io_guard; @@ -359,6 +359,6 @@ class MockRoboteq std::shared_ptr driver_; }; -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_MOCK_ROBOTEQ_HPP_ diff --git a/panther_hardware_interfaces/test/utils/panther_system_test_utils.hpp b/husarion_ugv_hardware_interfaces/test/utils/panther_system_test_utils.hpp similarity index 92% rename from panther_hardware_interfaces/test/utils/panther_system_test_utils.hpp rename to husarion_ugv_hardware_interfaces/test/utils/panther_system_test_utils.hpp index 0e07cc37..39cf60d7 100644 --- a/panther_hardware_interfaces/test/utils/panther_system_test_utils.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/panther_system_test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ #include #include @@ -28,7 +28,7 @@ #include "roboteqs_mock.hpp" #include "test_constants.hpp" -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { /** @@ -159,6 +159,6 @@ class PantherSystemTestUtils std::string default_panther_system_urdf_; }; -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_PANTHER_SYSTEM_TEST_UTILS_HPP_ diff --git a/panther_hardware_interfaces/test/utils/system_test_utils.hpp b/husarion_ugv_hardware_interfaces/test/utils/system_test_utils.hpp similarity index 75% rename from panther_hardware_interfaces/test/utils/system_test_utils.hpp rename to husarion_ugv_hardware_interfaces/test/utils/system_test_utils.hpp index db294b4e..360359b4 100644 --- a/panther_hardware_interfaces/test/utils/system_test_utils.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/system_test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ #include #include @@ -22,16 +22,16 @@ #include -#include "panther_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" -#include "panther_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" -#include "panther_hardware_interfaces/panther_system/system_e_stop.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/gpio/gpio_controller.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/robot_driver/robot_driver.hpp" +#include "husarion_ugv_hardware_interfaces/panther_system/system_e_stop.hpp" #include "utils/mock_driver.hpp" -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { -class MockRobotDriver : public panther_hardware_interfaces::RobotDriverInterface +class MockRobotDriver : public husarion_ugv_hardware_interfaces::RobotDriverInterface { public: MOCK_METHOD(void, Initialize, (), (override)); @@ -41,7 +41,8 @@ class MockRobotDriver : public panther_hardware_interfaces::RobotDriverInterface MOCK_METHOD(void, UpdateMotorsState, (), (override)); MOCK_METHOD(void, UpdateDriversState, (), (override)); MOCK_METHOD( - const panther_hardware_interfaces::DriverData &, GetData, (const std::string &), (override)); + const husarion_ugv_hardware_interfaces::DriverData &, GetData, (const std::string &), + (override)); MOCK_METHOD(void, SendSpeedCommands, (const std::vector &), (override)); MOCK_METHOD(void, TurnOnEStop, (), (override)); MOCK_METHOD(void, TurnOffEStop, (), (override)); @@ -51,26 +52,26 @@ class MockRobotDriver : public panther_hardware_interfaces::RobotDriverInterface using NiceMock = testing::NiceMock; }; -class MockGPIODriver : public panther_hardware_interfaces::GPIODriverInterface +class MockGPIODriver : public husarion_ugv_hardware_interfaces::GPIODriverInterface { public: MOCK_METHOD(void, GPIOMonitorEnable, (const bool, const unsigned), (override)); MOCK_METHOD( void, ConfigureEdgeEventCallback, - (const std::function &), (override)); + (const std::function &), (override)); MOCK_METHOD( void, ChangePinDirection, - (const panther_hardware_interfaces::GPIOPin, const gpiod::line::direction), (override)); + (const husarion_ugv_hardware_interfaces::GPIOPin, const gpiod::line::direction), (override)); MOCK_METHOD( - bool, IsPinAvailable, (const panther_hardware_interfaces::GPIOPin), (const, override)); - MOCK_METHOD(bool, IsPinActive, (const panther_hardware_interfaces::GPIOPin), (override)); + bool, IsPinAvailable, (const husarion_ugv_hardware_interfaces::GPIOPin), (const, override)); + MOCK_METHOD(bool, IsPinActive, (const husarion_ugv_hardware_interfaces::GPIOPin), (override)); MOCK_METHOD( - bool, SetPinValue, (const panther_hardware_interfaces::GPIOPin, const bool), (override)); + bool, SetPinValue, (const husarion_ugv_hardware_interfaces::GPIOPin, const bool), (override)); using NiceMock = testing::NiceMock; }; -class MockGPIOController : public panther_hardware_interfaces::GPIOControllerInterface +class MockGPIOController : public husarion_ugv_hardware_interfaces::GPIOControllerInterface { public: MockGPIOController() : GPIOControllerInterface() @@ -88,13 +89,13 @@ class MockGPIOController : public panther_hardware_interfaces::GPIOControllerInt MOCK_METHOD(bool, ChargerEnable, (const bool), (override)); MOCK_METHOD(bool, LEDControlEnable, (const bool), (override)); MOCK_METHOD( - (std::unordered_map), QueryControlInterfaceIOStates, - (), (const, override)); + (std::unordered_map), + QueryControlInterfaceIOStates, (), (const, override)); using NiceMock = testing::NiceMock; }; -class MockEStop : public panther_hardware_interfaces::EStopInterface +class MockEStop : public husarion_ugv_hardware_interfaces::EStopInterface { public: MockEStop() : EStopInterface() {} @@ -169,6 +170,6 @@ hardware_interface::HardwareInfo GenerateDefaultHardwareInfo() return hardware_info; } -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_SYSTEM_TEST_UTILS_HPP_ diff --git a/panther_hardware_interfaces/test/utils/test_constants.hpp b/husarion_ugv_hardware_interfaces/test/utils/test_constants.hpp similarity index 78% rename from panther_hardware_interfaces/test/utils/test_constants.hpp rename to husarion_ugv_hardware_interfaces/test/utils/test_constants.hpp index c3d4a0fa..a25e75f6 100644 --- a/panther_hardware_interfaces/test/utils/test_constants.hpp +++ b/husarion_ugv_hardware_interfaces/test/utils/test_constants.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ -#define PANTHER_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ +#ifndef HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ +#define HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ #include #include @@ -21,13 +21,13 @@ #include #include -#include -#include +#include +#include -namespace panther_hardware_interfaces_test +namespace husarion_ugv_hardware_interfaces_test { -const panther_hardware_interfaces::CANopenSettings kCANopenSettings{ +const husarion_ugv_hardware_interfaces::CANopenSettings kCANopenSettings{ "panther_can", 3, {{"default", 1}, {"front", 1}, {"rear", 2}}, @@ -36,7 +36,7 @@ const panther_hardware_interfaces::CANopenSettings kCANopenSettings{ std::chrono::milliseconds(100), }; -const panther_hardware_interfaces::DrivetrainSettings kDrivetrainSettings{ +const husarion_ugv_hardware_interfaces::DrivetrainSettings kDrivetrainSettings{ 0.11, 30.08, 0.75, 1600.0, 3600.0}; constexpr float kRadPerSecToRbtqCmd = 30.08 * (1.0 / (2.0 * M_PI)) * 60.0 * (1000.0 / 3600.0); @@ -63,7 +63,7 @@ const std::string kJointInterfaces = )"; const std::string kPluginName = - R"(panther_hardware_interfaces/PantherSystem + R"(husarion_ugv_hardware_interfaces/PantherSystem )"; const std::map kDefaultParamMap = { @@ -92,6 +92,6 @@ const std::vector kDefaultJoints = { const std::string kRobotDriverStateTopic = "/hardware_controller/robot_driver_state"; -} // namespace panther_hardware_interfaces_test +} // namespace husarion_ugv_hardware_interfaces_test -#endif // PANTHER_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ +#endif // HUSARION_UGV_HARDWARE_INTERFACES_TEST_UTILS_TEST_CONSTANTS_HPP_ diff --git a/panther_lights/.docs/AUTONOMOUS_ACTION.webp b/husarion_ugv_lights/.docs/AUTONOMOUS_ACTION.webp similarity index 100% rename from panther_lights/.docs/AUTONOMOUS_ACTION.webp rename to husarion_ugv_lights/.docs/AUTONOMOUS_ACTION.webp diff --git a/panther_lights/.docs/BATTERY_STATE.webp b/husarion_ugv_lights/.docs/BATTERY_STATE.webp similarity index 100% rename from panther_lights/.docs/BATTERY_STATE.webp rename to husarion_ugv_lights/.docs/BATTERY_STATE.webp diff --git a/panther_lights/.docs/CHARGING_BATTERY.webp b/husarion_ugv_lights/.docs/CHARGING_BATTERY.webp similarity index 100% rename from panther_lights/.docs/CHARGING_BATTERY.webp rename to husarion_ugv_lights/.docs/CHARGING_BATTERY.webp diff --git a/panther_lights/.docs/CRITICAL_BATTERY.webp b/husarion_ugv_lights/.docs/CRITICAL_BATTERY.webp similarity index 100% rename from panther_lights/.docs/CRITICAL_BATTERY.webp rename to husarion_ugv_lights/.docs/CRITICAL_BATTERY.webp diff --git a/panther_lights/.docs/ERROR.webp b/husarion_ugv_lights/.docs/ERROR.webp similarity index 100% rename from panther_lights/.docs/ERROR.webp rename to husarion_ugv_lights/.docs/ERROR.webp diff --git a/panther_lights/.docs/E_STOP.webp b/husarion_ugv_lights/.docs/E_STOP.webp similarity index 100% rename from panther_lights/.docs/E_STOP.webp rename to husarion_ugv_lights/.docs/E_STOP.webp diff --git a/panther_lights/.docs/GOAL_ACHIEVED.webp b/husarion_ugv_lights/.docs/GOAL_ACHIEVED.webp similarity index 100% rename from panther_lights/.docs/GOAL_ACHIEVED.webp rename to husarion_ugv_lights/.docs/GOAL_ACHIEVED.webp diff --git a/panther_lights/.docs/LOW_BATTERY.webp b/husarion_ugv_lights/.docs/LOW_BATTERY.webp similarity index 100% rename from panther_lights/.docs/LOW_BATTERY.webp rename to husarion_ugv_lights/.docs/LOW_BATTERY.webp diff --git a/panther_lights/.docs/MANUAL_ACTION.webp b/husarion_ugv_lights/.docs/MANUAL_ACTION.webp similarity index 100% rename from panther_lights/.docs/MANUAL_ACTION.webp rename to husarion_ugv_lights/.docs/MANUAL_ACTION.webp diff --git a/panther_lights/.docs/READY.webp b/husarion_ugv_lights/.docs/READY.webp similarity index 100% rename from panther_lights/.docs/READY.webp rename to husarion_ugv_lights/.docs/READY.webp diff --git a/panther_lights/CHANGELOG.rst b/husarion_ugv_lights/CHANGELOG.rst similarity index 100% rename from panther_lights/CHANGELOG.rst rename to husarion_ugv_lights/CHANGELOG.rst diff --git a/panther_lights/CMakeLists.txt b/husarion_ugv_lights/CMakeLists.txt similarity index 86% rename from panther_lights/CMakeLists.txt rename to husarion_ugv_lights/CMakeLists.txt index 482023e3..3fc9de63 100644 --- a/panther_lights/CMakeLists.txt +++ b/husarion_ugv_lights/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_lights) +project(husarion_ugv_lights) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) @@ -10,7 +10,7 @@ set(PACKAGE_DEPENDENCIES diagnostic_updater image_transport panther_msgs - panther_utils + husarion_ugv_utils pluginlib rclcpp rclcpp_components @@ -26,11 +26,10 @@ include_directories(include) pluginlib_export_plugin_description_file(${PROJECT_NAME} plugins.xml) -add_library( - panther_animation_plugins SHARED src/animation/image_animation.cpp - src/animation/charging_animation.cpp) -ament_target_dependencies(panther_animation_plugins panther_utils pluginlib) -target_link_libraries(panther_animation_plugins png yaml-cpp) +add_library(animation_plugins SHARED src/animation/image_animation.cpp + src/animation/charging_animation.cpp) +ament_target_dependencies(animation_plugins husarion_ugv_utils pluginlib) +target_link_libraries(animation_plugins png yaml-cpp) add_library(lights_driver_node_component SHARED src/lights_driver_node.cpp src/apa102.cpp) @@ -52,7 +51,7 @@ add_library( ament_target_dependencies( lights_controller_node_component panther_msgs - panther_utils + husarion_ugv_utils pluginlib rclcpp rclcpp_components @@ -60,12 +59,12 @@ ament_target_dependencies( target_link_libraries(lights_controller_node_component yaml-cpp) rclcpp_components_register_node( - lights_driver_node_component PLUGIN "panther_lights::LightsDriverNode" + lights_driver_node_component PLUGIN "husarion_ugv_lights::LightsDriverNode" EXECUTABLE lights_driver_node) rclcpp_components_register_node( lights_controller_node_component PLUGIN - "panther_lights::LightsControllerNode" EXECUTABLE lights_controller_node) + "husarion_ugv_lights::LightsControllerNode" EXECUTABLE lights_controller_node) ament_export_targets(export_lights_driver_node_component) install( @@ -83,7 +82,7 @@ install( LIBRARY DESTINATION lib RUNTIME DESTINATION bin) -install(TARGETS panther_animation_plugins LIBRARY DESTINATION lib) +install(TARGETS animation_plugins LIBRARY DESTINATION lib) install(DIRECTORY animations config launch test DESTINATION share/${PROJECT_NAME}) @@ -100,7 +99,7 @@ if(BUILD_TESTING) ${PROJECT_NAME}_test_animation PUBLIC $ $) - ament_target_dependencies(${PROJECT_NAME}_test_animation panther_utils) + ament_target_dependencies(${PROJECT_NAME}_test_animation husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_animation yaml-cpp) ament_add_gtest( @@ -112,7 +111,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_charging_animation - ament_index_cpp panther_utils pluginlib) + ament_index_cpp husarion_ugv_utils pluginlib) target_link_libraries(${PROJECT_NAME}_test_charging_animation yaml-cpp) ament_add_gtest( @@ -124,7 +123,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_image_animation - ament_index_cpp panther_utils pluginlib) + ament_index_cpp husarion_ugv_utils pluginlib) target_link_libraries(${PROJECT_NAME}_test_image_animation png yaml-cpp) ament_add_gtest( @@ -144,7 +143,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_led_segment pluginlib - panther_utils) + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_led_segment yaml-cpp) ament_add_gtest( @@ -158,7 +157,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_segment_converter pluginlib - panther_utils) + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_segment_converter yaml-cpp) ament_add_gtest( @@ -172,7 +171,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_led_animation pluginlib - panther_utils rclcpp) + husarion_ugv_utils rclcpp) target_link_libraries(${PROJECT_NAME}_test_led_animation yaml-cpp) ament_add_gtest( @@ -186,7 +185,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_led_animations_queue pluginlib - panther_utils rclcpp) + husarion_ugv_utils rclcpp) target_link_libraries(${PROJECT_NAME}_test_led_animations_queue yaml-cpp) ament_add_gmock(${PROJECT_NAME}_test_apa102 test/unit/test_apa102.cpp @@ -205,7 +204,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_lights_driver_node - panther_utils) + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_lights_driver_node lights_driver_node_component) @@ -222,19 +221,19 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_lights_controller_node - panther_utils) + husarion_ugv_utils) target_link_libraries(${PROJECT_NAME}_test_lights_controller_node lights_controller_node_component yaml-cpp) # Integration tests option(TEST_INTEGRATION "Run integration tests" OFF) if(TEST_INTEGRATION) - add_ros_test(test/integration/panther_lights.test.py) + add_ros_test(test/integration/husarion_ugv_lights.test.py) endif() endif() ament_export_include_directories(include) -ament_export_libraries(panther_animation_plugins) +ament_export_libraries(animation_plugins) ament_package() diff --git a/panther_lights/CONFIGURATION.md b/husarion_ugv_lights/CONFIGURATION.md similarity index 88% rename from panther_lights/CONFIGURATION.md rename to husarion_ugv_lights/CONFIGURATION.md index df53c7dc..4a80d775 100644 --- a/panther_lights/CONFIGURATION.md +++ b/husarion_ugv_lights/CONFIGURATION.md @@ -1,4 +1,4 @@ -# panther_light +# husarion_ugv_lights ## LED Animations @@ -44,7 +44,7 @@ The `segments_map` section allows creating named groups of segments on which ani The `led_animations` section contains a list with definitions for various animations that can be displayed on the LED segments. Supported keys are: - `animations` [*list*, default: **None**]: definition of animation for each Bumper Lights. Supported keys are: - - `type` [*string*, default **None**]: Specifies the type of animation. Default animation types are: `panther_lights::ImageAnimation`, `panther_lights::ChargingAnimation`. + - `type` [*string*, default **None**]: Specifies the type of animation. Default animation types are: `husarion_ugv_lights::ImageAnimation`, `husarion_ugv_lights::ChargingAnimation`. - `segments` [*string*, default **None**]: Indicates which segment mapping this particular animation applies to (e.g., all, front, rear). - `animation` [*yaml*, default: **None**]: An animation to be displayed on segments. The keys for the configuration of different animation types are explained in detail under the [**Animation Types**](#animation-types) section. - `id` [*int*, default: **None**]: unique ID of an animation. @@ -70,14 +70,14 @@ Basic animation definition. Keys are inherited from the basic **Animation** clas #### ImageAnimation -Animation of type `panther_lights::ImageAnimation`, returns frames to display based on a supplied image. Extends `Animation` with keys: +Animation of type `husarion_ugv_lights::ImageAnimation`, returns frames to display based on a supplied image. Extends `Animation` with keys: - `color` [*int*, default: **None**]: The image is turned into grayscale, and then the color is applied with brightness from the gray image. Values have to be in HEX format. This parameter is not required. - `image` [*string*, default: **None**]: path to an image file. Only global paths are valid. Allows using `$(find ros_package)` syntax. #### ChargingAnimation -Animation of type `panther_lights::ChargingAnimation`, returns frame to display based on `param` value representing Battery percentage. Displays a solid color with a duty cycle proportional to the Battery percentage. The color is changing from red (Battery discharged) to green (Battery fully charged). +Animation of type `husarion_ugv_lights::ChargingAnimation`, returns frame to display based on `param` value representing Battery percentage. Displays a solid color with a duty cycle proportional to the Battery percentage. The color is changing from red (Battery discharged) to green (Battery fully charged). ### Defining Animations @@ -93,10 +93,10 @@ user_animations: name: ANIMATION_1 priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/strip01_red.png + image: $(find husarion_ugv_lights)/animations/strip01_red.png duration: 2 repeat: 2 color: 0xffff00 @@ -106,7 +106,7 @@ user_animations: name: ANIMATION_2 priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: image: /animations/custom_image.png @@ -118,7 +118,7 @@ user_animations: name: ANIMATION_3 priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: image: $(find custom_pkg)/animations/custom_image.png @@ -130,13 +130,13 @@ user_animations: name: ANIMATION_4 priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: front animation: image: $(find custom_pkg)/animations/front_custom_image.png duration: 2 repeat: 2 - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: rear animation: image: $(find custom_pkg)/animations/rear_custom_image.png @@ -152,7 +152,7 @@ user_animations: Remember to modify launch command to use user animations: ``` bash -ros2 launch panther_bringup bringup.launch user_animations_file:=/my_awesome_user_animations.yaml +ros2 launch husarion_ugv_bringup bringup.launch user_animations_file:=/my_awesome_user_animations.yaml ``` Test new animations: diff --git a/panther_lights/LIGHTS_API.md b/husarion_ugv_lights/LIGHTS_API.md similarity index 92% rename from panther_lights/LIGHTS_API.md rename to husarion_ugv_lights/LIGHTS_API.md index 4def8a0e..cef272ad 100644 --- a/panther_lights/LIGHTS_API.md +++ b/husarion_ugv_lights/LIGHTS_API.md @@ -35,7 +35,7 @@ Getters: ## Defining a New Animation Type -It is possible to define your own animation type with expected, new behavior. All animation definitions inherit from the basic `Animation` class. Animations are loaded using `pluginlib` and can be defined from any point in your project. All you need is to import `Animation` class from `panther_lights` package and export it as a pluginlib plugin. For more information about creating and managing pluginlib see: [Creating and using plugins (C++)](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Pluginlib.html). +It is possible to define your own animation type with expected, new behavior. All animation definitions inherit from the basic `Animation` class. Animations are loaded using `pluginlib` and can be defined from any point in your project. All you need is to import `Animation` class from `husarion_ugv_lights` package and export it as a pluginlib plugin. For more information about creating and managing pluginlib see: [Creating and using plugins (C++)](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Pluginlib.html). Frames are processed in ticks with a frequency of `controller_frequency`. It is required to overwrite the `UpdateFrame` method which must return a list representing the frame for a given tick. The advised way is to use the `GetAnimationIteration` (current animation tick) as a time base for animation frames. The length of the frame has to match `num_led`. Each element of the frame represents a color for a single LED in the Bumper Lights. Colors are described as a list of integers with respective **R**, **G**, and **B** color values and **A** alpha channel. Additional parameters (e.g. image path) can be passed within `animation_description` and processed inside `Initialize` method. See the example below or other animation definitions. @@ -49,7 +49,7 @@ Create a New Animation Type: #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/animation.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" class MyCoolAnimation : public Animation { diff --git a/panther_lights/README.md b/husarion_ugv_lights/README.md similarity index 81% rename from panther_lights/README.md rename to husarion_ugv_lights/README.md index 548b0403..50a8c4e6 100644 --- a/panther_lights/README.md +++ b/husarion_ugv_lights/README.md @@ -1,12 +1,12 @@ -# panther_lights +# husarion_ugv_lights -Package used to control the Husarion Panther Bumper Lights. +Package used to control the Husarion UGV robot's lights. ## Launch files This package contains: -- `lights.launch.py`: Responsible for launching the nodes required to control the Panther Bumper Lights. +- `lights.launch.py`: Responsible for launching the nodes required to control the robot's lights. ## Configuration Files @@ -17,7 +17,7 @@ This package contains: ### LightsControllerNode -This node is of type rclcpp_components is responsible for processing animations and publishing frames to be displayed on the Husarion Panther robot Bumper Lights. +This node is of type rclcpp_components is responsible for processing animations and publishing frames to `light_driver` node. #### Publishers @@ -30,13 +30,13 @@ This node is of type rclcpp_components is responsible for processing animations #### Parameters -- `~animations_config_path` [*string*, default: **$(find panther_lights)/panther_lights/config/{robot_model}_animations.yaml**]: Path to a YAML file with a description of led configuration. This file includes definition of robot panels, virtual segments and default animations. +- `~animations_config_path` [*string*, default: **$(find husarion_ugv_lights)/husarion_ugv_lights/config/{robot_model}_animations.yaml**]: Path to a YAML file with a description of led configuration. This file includes definition of robot panels, virtual segments and default animations. - `~controller_frequency` [*float*, default: **50.0**]: Frequency [Hz] at which the lights controller node will process animations. - `~user_led_animations_path` [*string*, default: **None**]: Path to a YAML file with a description of the user defined animations. ### LightsDriverNode -This node is of type rclcpp_components is responsible for displaying frames on the Husarion Panther robot's Bumper Lights. +This node is of type rclcpp_components is responsible for displaying frames on the robot's lights. #### Publishers diff --git a/panther_lights/animations/lynx/battery_critical.png b/husarion_ugv_lights/animations/lynx/battery_critical.png similarity index 100% rename from panther_lights/animations/lynx/battery_critical.png rename to husarion_ugv_lights/animations/lynx/battery_critical.png diff --git a/panther_lights/animations/lynx/battery_low.png b/husarion_ugv_lights/animations/lynx/battery_low.png similarity index 100% rename from panther_lights/animations/lynx/battery_low.png rename to husarion_ugv_lights/animations/lynx/battery_low.png diff --git a/panther_lights/animations/lynx/strip01_purple.png b/husarion_ugv_lights/animations/lynx/strip01_purple.png similarity index 100% rename from panther_lights/animations/lynx/strip01_purple.png rename to husarion_ugv_lights/animations/lynx/strip01_purple.png diff --git a/panther_lights/animations/lynx/strip01_red.png b/husarion_ugv_lights/animations/lynx/strip01_red.png similarity index 100% rename from panther_lights/animations/lynx/strip01_red.png rename to husarion_ugv_lights/animations/lynx/strip01_red.png diff --git a/panther_lights/animations/lynx/triangle01_blue.png b/husarion_ugv_lights/animations/lynx/triangle01_blue.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_blue.png rename to husarion_ugv_lights/animations/lynx/triangle01_blue.png diff --git a/panther_lights/animations/lynx/triangle01_cyan.png b/husarion_ugv_lights/animations/lynx/triangle01_cyan.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_cyan.png rename to husarion_ugv_lights/animations/lynx/triangle01_cyan.png diff --git a/panther_lights/animations/lynx/triangle01_green.png b/husarion_ugv_lights/animations/lynx/triangle01_green.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_green.png rename to husarion_ugv_lights/animations/lynx/triangle01_green.png diff --git a/panther_lights/animations/lynx/triangle01_orange.png b/husarion_ugv_lights/animations/lynx/triangle01_orange.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_orange.png rename to husarion_ugv_lights/animations/lynx/triangle01_orange.png diff --git a/panther_lights/animations/lynx/triangle01_purple.png b/husarion_ugv_lights/animations/lynx/triangle01_purple.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_purple.png rename to husarion_ugv_lights/animations/lynx/triangle01_purple.png diff --git a/panther_lights/animations/lynx/triangle01_red.png b/husarion_ugv_lights/animations/lynx/triangle01_red.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_red.png rename to husarion_ugv_lights/animations/lynx/triangle01_red.png diff --git a/panther_lights/animations/lynx/triangle01_yellow.png b/husarion_ugv_lights/animations/lynx/triangle01_yellow.png similarity index 100% rename from panther_lights/animations/lynx/triangle01_yellow.png rename to husarion_ugv_lights/animations/lynx/triangle01_yellow.png diff --git a/panther_lights/animations/panther/battery_critical.png b/husarion_ugv_lights/animations/panther/battery_critical.png similarity index 100% rename from panther_lights/animations/panther/battery_critical.png rename to husarion_ugv_lights/animations/panther/battery_critical.png diff --git a/panther_lights/animations/panther/battery_low.png b/husarion_ugv_lights/animations/panther/battery_low.png similarity index 100% rename from panther_lights/animations/panther/battery_low.png rename to husarion_ugv_lights/animations/panther/battery_low.png diff --git a/panther_lights/animations/panther/strip01_purple.png b/husarion_ugv_lights/animations/panther/strip01_purple.png similarity index 100% rename from panther_lights/animations/panther/strip01_purple.png rename to husarion_ugv_lights/animations/panther/strip01_purple.png diff --git a/panther_lights/animations/panther/strip01_red.png b/husarion_ugv_lights/animations/panther/strip01_red.png similarity index 100% rename from panther_lights/animations/panther/strip01_red.png rename to husarion_ugv_lights/animations/panther/strip01_red.png diff --git a/panther_lights/animations/panther/triangle01_blue.png b/husarion_ugv_lights/animations/panther/triangle01_blue.png similarity index 100% rename from panther_lights/animations/panther/triangle01_blue.png rename to husarion_ugv_lights/animations/panther/triangle01_blue.png diff --git a/panther_lights/animations/panther/triangle01_cyan.png b/husarion_ugv_lights/animations/panther/triangle01_cyan.png similarity index 100% rename from panther_lights/animations/panther/triangle01_cyan.png rename to husarion_ugv_lights/animations/panther/triangle01_cyan.png diff --git a/panther_lights/animations/panther/triangle01_green.png b/husarion_ugv_lights/animations/panther/triangle01_green.png similarity index 100% rename from panther_lights/animations/panther/triangle01_green.png rename to husarion_ugv_lights/animations/panther/triangle01_green.png diff --git a/panther_lights/animations/panther/triangle01_orange.png b/husarion_ugv_lights/animations/panther/triangle01_orange.png similarity index 100% rename from panther_lights/animations/panther/triangle01_orange.png rename to husarion_ugv_lights/animations/panther/triangle01_orange.png diff --git a/panther_lights/animations/panther/triangle01_purple.png b/husarion_ugv_lights/animations/panther/triangle01_purple.png similarity index 100% rename from panther_lights/animations/panther/triangle01_purple.png rename to husarion_ugv_lights/animations/panther/triangle01_purple.png diff --git a/panther_lights/animations/panther/triangle01_red.png b/husarion_ugv_lights/animations/panther/triangle01_red.png similarity index 100% rename from panther_lights/animations/panther/triangle01_red.png rename to husarion_ugv_lights/animations/panther/triangle01_red.png diff --git a/panther_lights/animations/panther/triangle01_yellow.png b/husarion_ugv_lights/animations/panther/triangle01_yellow.png similarity index 100% rename from panther_lights/animations/panther/triangle01_yellow.png rename to husarion_ugv_lights/animations/panther/triangle01_yellow.png diff --git a/panther_lights/config/lynx_animations.yaml b/husarion_ugv_lights/config/lynx_animations.yaml similarity index 61% rename from panther_lights/config/lynx_animations.yaml rename to husarion_ugv_lights/config/lynx_animations.yaml index a697e5e3..765c974f 100644 --- a/panther_lights/config/lynx_animations.yaml +++ b/husarion_ugv_lights/config/lynx_animations.yaml @@ -28,30 +28,30 @@ led_animations: name: E_STOP priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/triangle01_red.png + image: $(find husarion_ugv_lights)/animations/lynx/triangle01_red.png duration: 2 - id: 1 name: READY priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/triangle01_green.png + image: $(find husarion_ugv_lights)/animations/lynx/triangle01_green.png duration: 2 - id: 2 name: ERROR priority: 1 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/strip01_red.png + image: $(find husarion_ugv_lights)/animations/lynx/strip01_red.png duration: 3 repeat: 2 @@ -59,30 +59,30 @@ led_animations: name: MANUAL_ACTION priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/triangle01_blue.png + image: $(find husarion_ugv_lights)/animations/lynx/triangle01_blue.png duration: 3 - id: 4 name: AUTONOMOUS_ACTION priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/triangle01_orange.png + image: $(find husarion_ugv_lights)/animations/lynx/triangle01_orange.png duration: 3 - id: 5 name: GOAL_ACHIEVED priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/strip01_purple.png + image: $(find husarion_ugv_lights)/animations/lynx/strip01_purple.png duration: 3 repeat: 2 @@ -90,10 +90,10 @@ led_animations: name: LOW_BATTERY priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/battery_low.png + image: $(find husarion_ugv_lights)/animations/lynx/battery_low.png duration: 2 repeat: 2 @@ -101,10 +101,10 @@ led_animations: name: CRITICAL_BATTERY priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/lynx/battery_critical.png + image: $(find husarion_ugv_lights)/animations/lynx/battery_critical.png duration: 2 repeat: 2 @@ -115,7 +115,7 @@ led_animations: name: CHARGING_BATTERY priority: 3 animations: - - type: panther_lights::ChargingAnimation + - type: husarion_ugv_lights::ChargingAnimation segments: all animation: duration: 3 diff --git a/panther_lights/config/lynx_driver.yaml b/husarion_ugv_lights/config/lynx_driver.yaml similarity index 100% rename from panther_lights/config/lynx_driver.yaml rename to husarion_ugv_lights/config/lynx_driver.yaml diff --git a/panther_lights/config/panther_animations.yaml b/husarion_ugv_lights/config/panther_animations.yaml similarity index 60% rename from panther_lights/config/panther_animations.yaml rename to husarion_ugv_lights/config/panther_animations.yaml index aa766cdb..ea92b413 100644 --- a/panther_lights/config/panther_animations.yaml +++ b/husarion_ugv_lights/config/panther_animations.yaml @@ -22,30 +22,30 @@ led_animations: name: E_STOP priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/triangle01_red.png + image: $(find husarion_ugv_lights)/animations/panther/triangle01_red.png duration: 2 - id: 1 name: READY priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/triangle01_green.png + image: $(find husarion_ugv_lights)/animations/panther/triangle01_green.png duration: 2 - id: 2 name: ERROR priority: 1 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/strip01_red.png + image: $(find husarion_ugv_lights)/animations/panther/strip01_red.png duration: 3 repeat: 2 @@ -53,30 +53,30 @@ led_animations: name: MANUAL_ACTION priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/triangle01_blue.png + image: $(find husarion_ugv_lights)/animations/panther/triangle01_blue.png duration: 3 - id: 4 name: AUTONOMOUS_ACTION priority: 3 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/triangle01_orange.png + image: $(find husarion_ugv_lights)/animations/panther/triangle01_orange.png duration: 3 - id: 5 name: GOAL_ACHIEVED priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/strip01_purple.png + image: $(find husarion_ugv_lights)/animations/panther/strip01_purple.png duration: 3 repeat: 2 @@ -84,10 +84,10 @@ led_animations: name: LOW_BATTERY priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/battery_low.png + image: $(find husarion_ugv_lights)/animations/panther/battery_low.png duration: 2 repeat: 2 @@ -95,10 +95,10 @@ led_animations: name: CRITICAL_BATTERY priority: 2 animations: - - type: panther_lights::ImageAnimation + - type: husarion_ugv_lights::ImageAnimation segments: all animation: - image: $(find panther_lights)/animations/panther/battery_critical.png + image: $(find husarion_ugv_lights)/animations/panther/battery_critical.png duration: 2 repeat: 2 @@ -109,7 +109,7 @@ led_animations: name: CHARGING_BATTERY priority: 3 animations: - - type: panther_lights::ChargingAnimation + - type: husarion_ugv_lights::ChargingAnimation segments: all animation: duration: 3 diff --git a/panther_lights/config/panther_driver.yaml b/husarion_ugv_lights/config/panther_driver.yaml similarity index 100% rename from panther_lights/config/panther_driver.yaml rename to husarion_ugv_lights/config/panther_driver.yaml diff --git a/panther_lights/include/panther_lights/animation/animation.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/animation/animation.hpp similarity index 91% rename from panther_lights/include/panther_lights/animation/animation.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/animation/animation.hpp index 9c237b1d..98c9bf1d 100644 --- a/panther_lights/include/panther_lights/animation/animation.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/animation/animation.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_ANIMATION_ANIMATION_HPP_ -#define PANTHER_LIGHTS_ANIMATION_ANIMATION_HPP_ +#ifndef HUSARION_UGV_LIGHTS_ANIMATION_ANIMATION_HPP_ +#define HUSARION_UGV_LIGHTS_ANIMATION_ANIMATION_HPP_ #include #include @@ -25,9 +25,9 @@ #include "yaml-cpp/yaml.h" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_lights +namespace husarion_ugv_lights { class Animation @@ -53,12 +53,12 @@ class Animation num_led_ = num_led; frame_ = std::vector(num_led_ * kRGBAColorLen, 0); - auto duration = panther_utils::GetYAMLKeyValue(animation_description, "duration"); + auto duration = husarion_ugv_utils::GetYAMLKeyValue(animation_description, "duration"); if ((duration - std::numeric_limits::epsilon()) <= 0.0) { throw std::out_of_range("Duration has to be positive"); } - loops_ = panther_utils::GetYAMLKeyValue(animation_description, "repeat", 1); + loops_ = husarion_ugv_utils::GetYAMLKeyValue(animation_description, "repeat", 1); if (duration * loops_ > 10.0) { throw std::runtime_error("Animation display duration (duration * repeat) exceeds 10 seconds"); @@ -187,6 +187,6 @@ class Animation std::vector frame_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_ANIMATION_ANIMATION_HPP_ +#endif // HUSARION_UGV_LIGHTS_ANIMATION_ANIMATION_HPP_ diff --git a/panther_lights/include/panther_lights/animation/charging_animation.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/animation/charging_animation.hpp similarity index 83% rename from panther_lights/include/panther_lights/animation/charging_animation.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/animation/charging_animation.hpp index 95f7ab7b..2c325bc2 100644 --- a/panther_lights/include/panther_lights/animation/charging_animation.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/animation/charging_animation.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ -#define PANTHER_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ +#ifndef HUSARION_UGV_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ +#define HUSARION_UGV_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ #include #include @@ -22,9 +22,9 @@ #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/animation.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" -namespace panther_lights +namespace husarion_ugv_lights { class ChargingAnimation : public Animation @@ -57,6 +57,6 @@ class ChargingAnimation : public Animation std::array color_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ +#endif // HUSARION_UGV_LIGHTS_ANIMATION_CHARGING_ANIMATION_HPP_ diff --git a/panther_lights/include/panther_lights/animation/image_animation.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/animation/image_animation.hpp similarity index 88% rename from panther_lights/include/panther_lights/animation/image_animation.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/animation/image_animation.hpp index 31663f95..78506908 100644 --- a/panther_lights/include/panther_lights/animation/image_animation.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/animation/image_animation.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ -#define PANTHER_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ +#ifndef HUSARION_UGV_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ +#define HUSARION_UGV_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ #include #include @@ -25,11 +25,11 @@ #include "boost/gil.hpp" #include "boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp" -#include "panther_lights/animation/animation.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" namespace gil = boost::gil; -namespace panther_lights +namespace husarion_ugv_lights { class ImageAnimation : public Animation @@ -77,6 +77,6 @@ class ImageAnimation : public Animation gil::rgba8_image_t image_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ +#endif // HUSARION_UGV_LIGHTS_ANIMATION_IMAGE_ANIMATION_HPP_ diff --git a/panther_lights/include/panther_lights/apa102.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/apa102.hpp similarity index 96% rename from panther_lights/include/panther_lights/apa102.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/apa102.hpp index 801a0610..f58ed240 100644 --- a/panther_lights/include/panther_lights/apa102.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/apa102.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_APA102_HPP_ -#define PANTHER_LIGHTS_APA102_HPP_ +#ifndef HUSARION_UGV_LIGHTS_APA102_HPP_ +#define HUSARION_UGV_LIGHTS_APA102_HPP_ #include #include @@ -25,7 +25,7 @@ #include #include -namespace panther_lights +namespace husarion_ugv_lights { class SPIDeviceInterface @@ -165,6 +165,6 @@ class APA102 : public APA102Interface const int file_descriptor_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_APA102_HPP_ +#endif // HUSARION_UGV_LIGHTS_APA102_HPP_ diff --git a/panther_lights/include/panther_lights/led_components/led_animations_queue.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_animations_queue.hpp similarity index 94% rename from panther_lights/include/panther_lights/led_components/led_animations_queue.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_animations_queue.hpp index e9fd454d..6327bfd5 100644 --- a/panther_lights/include/panther_lights/led_components/led_animations_queue.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_animations_queue.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ -#define PANTHER_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ +#define HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ #include #include @@ -27,9 +27,9 @@ #include "rclcpp/time.hpp" -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" -namespace panther_lights +namespace husarion_ugv_lights { /** @@ -189,6 +189,6 @@ class LEDAnimationsQueue const std::size_t max_queue_size_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ +#endif // HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_ANIMATIONS_QUEUE_HPP_ diff --git a/panther_lights/include/panther_lights/led_components/led_panel.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_panel.hpp similarity index 85% rename from panther_lights/include/panther_lights/led_components/led_panel.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_panel.hpp index 06d8def5..71719dcb 100644 --- a/panther_lights/include/panther_lights/led_components/led_panel.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_panel.hpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ -#define PANTHER_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ +#define HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ #include #include -namespace panther_lights +namespace husarion_ugv_lights { /** @@ -49,6 +49,6 @@ class LEDPanel std::vector frame_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ +#endif // HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_PANEL_HPP_ diff --git a/panther_lights/include/panther_lights/led_components/led_segment.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_segment.hpp similarity index 87% rename from panther_lights/include/panther_lights/led_components/led_segment.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_segment.hpp index 91b03724..5133d947 100644 --- a/panther_lights/include/panther_lights/led_components/led_segment.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/led_segment.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ -#define PANTHER_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ +#define HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ #include #include @@ -22,9 +22,9 @@ #include "pluginlib/class_loader.hpp" -#include "panther_lights/animation/animation.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" -namespace panther_lights +namespace husarion_ugv_lights { /** @@ -117,8 +117,8 @@ class LEDSegment bool HasAnimation() const { return animation_ || default_animation_; } protected: - std::shared_ptr animation_; - std::shared_ptr default_animation_; + std::shared_ptr animation_; + std::shared_ptr default_animation_; private: const float controller_frequency_; @@ -129,9 +129,9 @@ class LEDSegment std::size_t last_led_iterator_; std::size_t num_led_; - std::shared_ptr> animation_loader_; + std::shared_ptr> animation_loader_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ +#endif // HUSARION_UGV_LIGHTS_LED_COMPONENTS_LED_SEGMENT_HPP_ diff --git a/panther_lights/include/panther_lights/led_components/segment_converter.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/segment_converter.hpp similarity index 70% rename from panther_lights/include/panther_lights/led_components/segment_converter.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/led_components/segment_converter.hpp index fba745cd..1d23cbc8 100644 --- a/panther_lights/include/panther_lights/led_components/segment_converter.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/led_components/segment_converter.hpp @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ -#define PANTHER_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ +#define HUSARION_UGV_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ #include #include #include -#include "panther_lights/led_components/led_panel.hpp" -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" -namespace panther_lights +namespace husarion_ugv_lights { class SegmentConverter @@ -36,6 +36,6 @@ class SegmentConverter const std::unordered_map> & panels); }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ +#endif // HUSARION_UGV_LIGHTS_LED_COMPONENTS_SEGMENT_CONVERTER_HPP_ diff --git a/panther_lights/include/panther_lights/lights_controller_node.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/lights_controller_node.hpp similarity index 91% rename from panther_lights/include/panther_lights/lights_controller_node.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/lights_controller_node.hpp index eb98f16f..fc7b61cc 100644 --- a/panther_lights/include/panther_lights/lights_controller_node.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/lights_controller_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ -#define PANTHER_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ +#define HUSARION_UGV_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ #include #include @@ -27,12 +27,12 @@ #include "panther_msgs/srv/set_led_animation.hpp" -#include "panther_lights/animation/animation.hpp" -#include "panther_lights/led_components/led_animations_queue.hpp" -#include "panther_lights/led_components/segment_converter.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" +#include "husarion_ugv_lights/led_components/led_animations_queue.hpp" +#include "husarion_ugv_lights/led_components/segment_converter.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_lights +namespace husarion_ugv_lights { using ImageMsg = sensor_msgs::msg::Image; @@ -154,6 +154,6 @@ class LightsControllerNode : public rclcpp::Node bool animation_finished_ = true; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ +#endif // HUSARION_UGV_LIGHTS_LIGHTS_CONTROLLER_NODE_HPP_ diff --git a/panther_lights/include/panther_lights/lights_driver_node.hpp b/husarion_ugv_lights/include/husarion_ugv_lights/lights_driver_node.hpp similarity index 94% rename from panther_lights/include/panther_lights/lights_driver_node.hpp rename to husarion_ugv_lights/include/husarion_ugv_lights/lights_driver_node.hpp index f1a4b5b5..0a5de4ae 100644 --- a/panther_lights/include/panther_lights/lights_driver_node.hpp +++ b/husarion_ugv_lights/include/husarion_ugv_lights/lights_driver_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ -#define PANTHER_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ +#ifndef HUSARION_UGV_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ +#define HUSARION_UGV_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ #include #include @@ -26,9 +26,9 @@ #include "panther_msgs/srv/set_led_brightness.hpp" -#include "panther_lights/apa102.hpp" +#include "husarion_ugv_lights/apa102.hpp" -namespace panther_lights +namespace husarion_ugv_lights { using ImageMsg = sensor_msgs::msg::Image; @@ -133,6 +133,6 @@ class LightsDriverNode : public rclcpp::Node diagnostic_updater::Updater diagnostic_updater_; }; -} // namespace panther_lights +} // namespace husarion_ugv_lights -#endif // PANTHER_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ +#endif // HUSARION_UGV_LIGHTS_LIGHTS_DRIVER_NODE_HPP_ diff --git a/panther_lights/launch/lights.launch.py b/husarion_ugv_lights/launch/lights.launch.py similarity index 93% rename from panther_lights/launch/lights.launch.py rename to husarion_ugv_lights/launch/lights.launch.py index f77ef14d..fa45aa53 100644 --- a/panther_lights/launch/lights.launch.py +++ b/husarion_ugv_lights/launch/lights.launch.py @@ -33,7 +33,7 @@ def generate_launch_description(): robot_model = LaunchConfiguration("robot_model") - lights_pkg = FindPackageShare("panther_lights") + lights_pkg = FindPackageShare("husarion_ugv_lights") animations_config = PythonExpression(["'", robot_model, "_animations.yaml'"]) animations_config_path = LaunchConfiguration("animations_config_path") @@ -82,8 +82,8 @@ def generate_launch_description(): executable="component_container", composable_node_descriptions=[ ComposableNode( - package="panther_lights", - plugin="panther_lights::LightsDriverNode", + package="husarion_ugv_lights", + plugin="husarion_ugv_lights::LightsDriverNode", name="lights_driver", namespace=namespace, remappings=[("/diagnostics", "diagnostics")], @@ -94,8 +94,8 @@ def generate_launch_description(): condition=UnlessCondition(use_sim), ), ComposableNode( - package="panther_lights", - plugin="panther_lights::LightsControllerNode", + package="husarion_ugv_lights", + plugin="husarion_ugv_lights::LightsControllerNode", name="lights_controller", namespace=namespace, parameters=[ diff --git a/panther_lights/package.xml b/husarion_ugv_lights/package.xml similarity index 88% rename from panther_lights/package.xml rename to husarion_ugv_lights/package.xml index 2dfb2248..8e68c10c 100644 --- a/panther_lights/package.xml +++ b/husarion_ugv_lights/package.xml @@ -1,9 +1,9 @@ - panther_lights + husarion_ugv_lights 2.1.1 - Package used to control the Husarion Panther Bumper Lights + Package used to control the robot lights Husarion Apache License 2.0 @@ -17,10 +17,10 @@ ament_cmake diagnostic_updater + husarion_ugv_utils image_transport libpng-dev panther_msgs - panther_utils pluginlib rclcpp rclcpp_components diff --git a/husarion_ugv_lights/plugins.xml b/husarion_ugv_lights/plugins.xml new file mode 100644 index 00000000..5b499546 --- /dev/null +++ b/husarion_ugv_lights/plugins.xml @@ -0,0 +1,8 @@ + + + Animation processed from an image + + + Charging animation representing percentage of battery + + diff --git a/panther_lights/src/animation/charging_animation.cpp b/husarion_ugv_lights/src/animation/charging_animation.cpp similarity index 95% rename from panther_lights/src/animation/charging_animation.cpp rename to husarion_ugv_lights/src/animation/charging_animation.cpp index 9a02d6b7..4aeec55d 100644 --- a/panther_lights/src/animation/charging_animation.cpp +++ b/husarion_ugv_lights/src/animation/charging_animation.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/animation/charging_animation.hpp" +#include "husarion_ugv_lights/animation/charging_animation.hpp" #include #include @@ -25,7 +25,7 @@ #include "yaml-cpp/yaml.h" -namespace panther_lights +namespace husarion_ugv_lights { void ChargingAnimation::Initialize( @@ -153,8 +153,8 @@ std::vector ChargingAnimation::CreateRGBAFrame( return frame; } -} // namespace panther_lights +} // namespace husarion_ugv_lights #include "pluginlib/class_list_macros.hpp" -PLUGINLIB_EXPORT_CLASS(panther_lights::ChargingAnimation, panther_lights::Animation) +PLUGINLIB_EXPORT_CLASS(husarion_ugv_lights::ChargingAnimation, husarion_ugv_lights::Animation) diff --git a/panther_lights/src/animation/image_animation.cpp b/husarion_ugv_lights/src/animation/image_animation.cpp similarity index 93% rename from panther_lights/src/animation/image_animation.cpp rename to husarion_ugv_lights/src/animation/image_animation.cpp index 5cc68f08..ab7d9cd9 100644 --- a/panther_lights/src/animation/image_animation.cpp +++ b/husarion_ugv_lights/src/animation/image_animation.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/animation/image_animation.hpp" +#include "husarion_ugv_lights/animation/image_animation.hpp" #include #include @@ -30,9 +30,9 @@ #include "boost/gil/extension/numeric/resample.hpp" #include "boost/gil/extension/numeric/sampler.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_lights +namespace husarion_ugv_lights { void ImageAnimation::Initialize( @@ -41,8 +41,8 @@ void ImageAnimation::Initialize( { Animation::Initialize(animation_description, num_led, controller_frequency); - const auto image_path = - ParseImagePath(panther_utils::GetYAMLKeyValue(animation_description, "image")); + const auto image_path = ParseImagePath( + husarion_ugv_utils::GetYAMLKeyValue(animation_description, "image")); gil::rgba8_image_t base_image; gil::read_and_convert_image(std::string(image_path), base_image, gil::png_tag()); image_ = RGBAImageResize(base_image, this->GetNumberOfLeds(), this->GetAnimationLength()); @@ -156,8 +156,8 @@ void ImageAnimation::GreyImageNormalizeBrightness(gil::gray_alpha8_image_t & ima }); } -} // namespace panther_lights +} // namespace husarion_ugv_lights #include "pluginlib/class_list_macros.hpp" -PLUGINLIB_EXPORT_CLASS(panther_lights::ImageAnimation, panther_lights::Animation) +PLUGINLIB_EXPORT_CLASS(husarion_ugv_lights::ImageAnimation, husarion_ugv_lights::Animation) diff --git a/panther_lights/src/apa102.cpp b/husarion_ugv_lights/src/apa102.cpp similarity index 97% rename from panther_lights/src/apa102.cpp rename to husarion_ugv_lights/src/apa102.cpp index 8a2a70aa..df35f857 100644 --- a/panther_lights/src/apa102.cpp +++ b/husarion_ugv_lights/src/apa102.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/apa102.hpp" +#include "husarion_ugv_lights/apa102.hpp" #include #include @@ -22,7 +22,7 @@ #include #include -namespace panther_lights +namespace husarion_ugv_lights { APA102::APA102( @@ -126,4 +126,4 @@ void APA102::SPISendBuffer(const std::vector & buffer) const } } -} // namespace panther_lights +} // namespace husarion_ugv_lights diff --git a/panther_lights/src/led_components/led_animations_queue.cpp b/husarion_ugv_lights/src/led_components/led_animations_queue.cpp similarity index 96% rename from panther_lights/src/led_components/led_animations_queue.cpp rename to husarion_ugv_lights/src/led_components/led_animations_queue.cpp index 0d295ab0..6a0aa04f 100644 --- a/panther_lights/src/led_components/led_animations_queue.cpp +++ b/husarion_ugv_lights/src/led_components/led_animations_queue.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/led_components/led_animations_queue.hpp" +#include "husarion_ugv_lights/led_components/led_animations_queue.hpp" #include #include @@ -23,7 +23,7 @@ #include "rclcpp/logging.hpp" #include "rclcpp/time.hpp" -namespace panther_lights +namespace husarion_ugv_lights { LEDAnimation::LEDAnimation( @@ -148,4 +148,4 @@ bool LEDAnimationsQueue::HasAnimation(const std::shared_ptr & anim return std::find(queue_.begin(), queue_.end(), animation) != queue_.end(); } -} // namespace panther_lights +} // namespace husarion_ugv_lights diff --git a/panther_lights/src/led_components/led_panel.cpp b/husarion_ugv_lights/src/led_components/led_panel.cpp similarity index 93% rename from panther_lights/src/led_components/led_panel.cpp rename to husarion_ugv_lights/src/led_components/led_panel.cpp index 46820f17..6107e1ea 100644 --- a/panther_lights/src/led_components/led_panel.cpp +++ b/husarion_ugv_lights/src/led_components/led_panel.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" #include #include #include #include -namespace panther_lights +namespace husarion_ugv_lights { LEDPanel::LEDPanel(const std::size_t num_led) : num_led_(num_led) @@ -50,4 +50,4 @@ void LEDPanel::UpdateFrame( std::copy(values.begin(), values.end(), frame_.begin() + iterator_first); } -} // namespace panther_lights +} // namespace husarion_ugv_lights diff --git a/panther_lights/src/led_components/led_segment.cpp b/husarion_ugv_lights/src/led_components/led_segment.cpp similarity index 86% rename from panther_lights/src/led_components/led_segment.cpp rename to husarion_ugv_lights/src/led_components/led_segment.cpp index bd4eaa98..ef82263d 100644 --- a/panther_lights/src/led_components/led_segment.cpp +++ b/husarion_ugv_lights/src/led_components/led_segment.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" #include #include @@ -20,17 +20,17 @@ #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/animation.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_lights +namespace husarion_ugv_lights { LEDSegment::LEDSegment(const YAML::Node & segment_description, const float controller_frequency) : controller_frequency_(controller_frequency) { - channel_ = panther_utils::GetYAMLKeyValue(segment_description, "channel"); - const auto led_range = panther_utils::GetYAMLKeyValue( + channel_ = husarion_ugv_utils::GetYAMLKeyValue(segment_description, "channel"); + const auto led_range = husarion_ugv_utils::GetYAMLKeyValue( segment_description, "led_range"); const std::size_t split_char = led_range.find('-'); @@ -52,8 +52,8 @@ LEDSegment::LEDSegment(const YAML::Node & segment_description, const float contr num_led_ = std::abs(int(last_led_iterator_ - first_led_iterator_)) + 1; - animation_loader_ = std::make_shared>( - "panther_lights", "panther_lights::Animation"); + animation_loader_ = std::make_shared>( + "husarion_ugv_lights", "husarion_ugv_lights::Animation"); } LEDSegment::~LEDSegment() @@ -68,7 +68,7 @@ void LEDSegment::SetAnimation( const std::string & type, const YAML::Node & animation_description, const bool repeating, const std::string & param) { - std::shared_ptr animation; + std::shared_ptr animation; try { animation = animation_loader_->createSharedInstance(type); @@ -107,7 +107,7 @@ void LEDSegment::UpdateAnimation() animation_finished_ = true; } - std::shared_ptr animation_to_update = + std::shared_ptr animation_to_update = animation_finished_ && default_animation_ ? default_animation_ : animation_; if (animation_finished_ && default_animation_ && default_animation_->IsFinished()) { @@ -167,4 +167,4 @@ std::size_t LEDSegment::GetFirstLEDPosition() const return (invert_led_order_ ? last_led_iterator_ : first_led_iterator_) * Animation::kRGBAColorLen; } -} // namespace panther_lights +} // namespace husarion_ugv_lights diff --git a/panther_lights/src/led_components/segment_converter.cpp b/husarion_ugv_lights/src/led_components/segment_converter.cpp similarity index 85% rename from panther_lights/src/led_components/segment_converter.cpp rename to husarion_ugv_lights/src/led_components/segment_converter.cpp index fb1f54dd..b5ecf372 100644 --- a/panther_lights/src/led_components/segment_converter.cpp +++ b/husarion_ugv_lights/src/led_components/segment_converter.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/led_components/segment_converter.hpp" +#include "husarion_ugv_lights/led_components/segment_converter.hpp" #include #include @@ -20,10 +20,10 @@ #include #include -#include "panther_lights/led_components/led_panel.hpp" -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" -namespace panther_lights +namespace husarion_ugv_lights { void SegmentConverter::Convert( @@ -52,4 +52,4 @@ void SegmentConverter::Convert( } } -} // namespace panther_lights +} // namespace husarion_ugv_lights diff --git a/panther_lights/src/lights_controller_node.cpp b/husarion_ugv_lights/src/lights_controller_node.cpp similarity index 86% rename from panther_lights/src/lights_controller_node.cpp rename to husarion_ugv_lights/src/lights_controller_node.cpp index d77443ef..b54cf25d 100644 --- a/panther_lights/src/lights_controller_node.cpp +++ b/husarion_ugv_lights/src/lights_controller_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/lights_controller_node.hpp" +#include "husarion_ugv_lights/lights_controller_node.hpp" #include #include @@ -31,14 +31,14 @@ #include "panther_msgs/srv/set_led_animation.hpp" -#include "panther_lights/led_components/led_animations_queue.hpp" -#include "panther_lights/led_components/led_panel.hpp" -#include "panther_lights/led_components/led_segment.hpp" -#include "panther_lights/led_components/segment_converter.hpp" -#include "panther_utils/ros_utils.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_lights/led_components/led_animations_queue.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/segment_converter.hpp" +#include "husarion_ugv_utils/ros_utils.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_lights +namespace husarion_ugv_lights { LightsControllerNode::LightsControllerNode(const rclcpp::NodeOptions & options) @@ -86,8 +86,8 @@ void LightsControllerNode::InitializeLEDPanels(const YAML::Node & panels_descrip RCLCPP_DEBUG(this->get_logger(), "Initializing LED panels."); for (auto & panel : panels_description.as>()) { - const auto channel = panther_utils::GetYAMLKeyValue(panel, "channel"); - const auto number_of_leds = panther_utils::GetYAMLKeyValue( + const auto channel = husarion_ugv_utils::GetYAMLKeyValue(panel, "channel"); + const auto number_of_leds = husarion_ugv_utils::GetYAMLKeyValue( panel, "number_of_leds"); const auto result = led_panels_.emplace(channel, std::make_unique(number_of_leds)); @@ -115,7 +115,7 @@ void LightsControllerNode::InitializeLEDSegments( RCLCPP_DEBUG(this->get_logger(), "Initializing LED segments."); for (auto & segment : segments_description.as>()) { - const auto segment_name = panther_utils::GetYAMLKeyValue(segment, "name"); + const auto segment_name = husarion_ugv_utils::GetYAMLKeyValue(segment, "name"); try { const auto result = segments_.emplace( @@ -165,17 +165,17 @@ void LightsControllerNode::LoadUserAnimations(const std::string & user_led_anima try { YAML::Node user_led_animations = YAML::LoadFile(user_led_animations_path); - auto user_animations = panther_utils::GetYAMLKeyValue>( + auto user_animations = husarion_ugv_utils::GetYAMLKeyValue>( user_led_animations, "user_animations"); for (auto & animation_description : user_animations) { try { - auto id = panther_utils::GetYAMLKeyValue(animation_description, "id"); + auto id = husarion_ugv_utils::GetYAMLKeyValue(animation_description, "id"); if (id < 20) { throw std::runtime_error("Animation ID must be greater than 19."); } - auto priority = panther_utils::GetYAMLKeyValue( + auto priority = husarion_ugv_utils::GetYAMLKeyValue( animation_description, "priority", LEDAnimation::kDefaultPriority); if (priority == 1) { throw std::runtime_error("User animation can not have priority 1."); @@ -199,13 +199,13 @@ void LightsControllerNode::LoadAnimation(const YAML::Node & animation_descriptio LEDAnimationDescription led_animation_desc; try { - led_animation_desc.id = panther_utils::GetYAMLKeyValue( + led_animation_desc.id = husarion_ugv_utils::GetYAMLKeyValue( animation_description, "id"); - led_animation_desc.name = panther_utils::GetYAMLKeyValue( + led_animation_desc.name = husarion_ugv_utils::GetYAMLKeyValue( animation_description, "name", "ANIMATION_" + std::to_string(led_animation_desc.id)); - led_animation_desc.priority = panther_utils::GetYAMLKeyValue( + led_animation_desc.priority = husarion_ugv_utils::GetYAMLKeyValue( animation_description, "priority", LEDAnimation::kDefaultPriority); - led_animation_desc.timeout = panther_utils::GetYAMLKeyValue( + led_animation_desc.timeout = husarion_ugv_utils::GetYAMLKeyValue( animation_description, "timeout", LEDAnimation::kDefaultTimeout); if ( @@ -215,14 +215,15 @@ void LightsControllerNode::LoadAnimation(const YAML::Node & animation_descriptio throw std::runtime_error("Invalid LED animation priority."); } - auto animations = panther_utils::GetYAMLKeyValue>( + auto animations = husarion_ugv_utils::GetYAMLKeyValue>( animation_description, "animations"); for (auto & animation : animations) { AnimationDescription animation_desc; - animation_desc.type = panther_utils::GetYAMLKeyValue(animation, "type"); - animation_desc.animation = panther_utils::GetYAMLKeyValue(animation, "animation"); + animation_desc.type = husarion_ugv_utils::GetYAMLKeyValue(animation, "type"); + animation_desc.animation = husarion_ugv_utils::GetYAMLKeyValue( + animation, "animation"); - auto segments_group = panther_utils::GetYAMLKeyValue(animation, "segments"); + auto segments_group = husarion_ugv_utils::GetYAMLKeyValue(animation, "segments"); animation_desc.segments = segments_map_.at(segments_group); led_animation_desc.animations.push_back(animation_desc); @@ -258,7 +259,7 @@ void LightsControllerNode::PublishPanelFrame(const std::size_t channel) const auto number_of_leds = panel->GetNumberOfLeds(); ImageMsg::UniquePtr image(new ImageMsg); - image->header.frame_id = panther_utils::ros::AddNamespaceToFrameID( + image->header.frame_id = husarion_ugv_utils::ros::AddNamespaceToFrameID( "lights_channel_" + std::to_string(channel) + "_link", std::string(this->get_namespace())); image->header.stamp = this->get_clock()->now(); image->encoding = "rgba8"; @@ -370,7 +371,7 @@ void LightsControllerNode::SetLEDAnimation(const std::shared_ptr & current_animation_ = std::move(led_animation); } -} // namespace panther_lights +} // namespace husarion_ugv_lights #include -RCLCPP_COMPONENTS_REGISTER_NODE(panther_lights::LightsControllerNode) +RCLCPP_COMPONENTS_REGISTER_NODE(husarion_ugv_lights::LightsControllerNode) diff --git a/panther_lights/src/lights_driver_node.cpp b/husarion_ugv_lights/src/lights_driver_node.cpp similarity index 97% rename from panther_lights/src/lights_driver_node.cpp rename to husarion_ugv_lights/src/lights_driver_node.cpp index 7535955c..62e89236 100644 --- a/panther_lights/src/lights_driver_node.cpp +++ b/husarion_ugv_lights/src/lights_driver_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_lights/lights_driver_node.hpp" +#include "husarion_ugv_lights/lights_driver_node.hpp" #include #include @@ -31,9 +31,9 @@ #include "panther_msgs/srv/set_led_brightness.hpp" -#include "panther_lights/apa102.hpp" +#include "husarion_ugv_lights/apa102.hpp" -namespace panther_lights +namespace husarion_ugv_lights { using std::placeholders::_1; @@ -280,7 +280,7 @@ void LightsDriverNode::DiagnoseLights(diagnostic_updater::DiagnosticStatusWrappe status.summary(error_level, message); } -} // namespace panther_lights +} // namespace husarion_ugv_lights #include -RCLCPP_COMPONENTS_REGISTER_NODE(panther_lights::LightsDriverNode) +RCLCPP_COMPONENTS_REGISTER_NODE(husarion_ugv_lights::LightsDriverNode) diff --git a/panther_lights/test/files/animation.png b/husarion_ugv_lights/test/files/animation.png similarity index 100% rename from panther_lights/test/files/animation.png rename to husarion_ugv_lights/test/files/animation.png diff --git a/panther_lights/test/integration/panther_lights.test.py b/husarion_ugv_lights/test/integration/panther_lights.test.py similarity index 94% rename from panther_lights/test/integration/panther_lights.test.py rename to husarion_ugv_lights/test/integration/panther_lights.test.py index 25fa0e95..a40efd04 100644 --- a/panther_lights/test/integration/panther_lights.test.py +++ b/husarion_ugv_lights/test/integration/panther_lights.test.py @@ -17,9 +17,9 @@ import unittest +import husarion_ugv_utils.integration_test_utils as test_utils import launch import launch_testing -import panther_utils.integration_test_utils as test_utils import rclpy import rclpy.qos from diagnostic_msgs.msg import DiagnosticArray @@ -38,17 +38,19 @@ def generate_test_description(): # TODO: Fix the path for specific robot model animations_config_path = ( - PathJoinSubstitution([FindPackageShare("panther_lights"), "config", "animations.yaml"]), + PathJoinSubstitution( + [FindPackageShare("husarion_ugv_lights"), "config", "animations.yaml"] + ), ) lights_controller_node = Node( - package="panther_lights", + package="husarion_ugv_lights", executable="lights_controller_node", parameters=[{"animations_config_path": animations_config_path}], ) lights_driver_node = Node( - package="panther_lights", + package="husarion_ugv_lights", executable="lights_driver_node", ) diff --git a/panther_lights/test/unit/animation/test_animation.cpp b/husarion_ugv_lights/test/unit/animation/test_animation.cpp similarity index 98% rename from panther_lights/test/unit/animation/test_animation.cpp rename to husarion_ugv_lights/test/unit/animation/test_animation.cpp index fb85d6a9..11e1f1bb 100644 --- a/panther_lights/test/unit/animation/test_animation.cpp +++ b/husarion_ugv_lights/test/unit/animation/test_animation.cpp @@ -20,9 +20,9 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/animation.hpp" +#include "husarion_ugv_lights/animation/animation.hpp" -class AnimationWrapper : public panther_lights::Animation +class AnimationWrapper : public husarion_ugv_lights::Animation { public: AnimationWrapper() {} diff --git a/panther_lights/test/unit/animation/test_charging_animation.cpp b/husarion_ugv_lights/test/unit/animation/test_charging_animation.cpp similarity index 97% rename from panther_lights/test/unit/animation/test_charging_animation.cpp rename to husarion_ugv_lights/test/unit/animation/test_charging_animation.cpp index 9a1c6d6a..b95eff58 100644 --- a/panther_lights/test/unit/animation/test_charging_animation.cpp +++ b/husarion_ugv_lights/test/unit/animation/test_charging_animation.cpp @@ -21,9 +21,9 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/charging_animation.hpp" +#include "husarion_ugv_lights/animation/charging_animation.hpp" -class ChargingAnimationWrapper : public panther_lights::ChargingAnimation +class ChargingAnimationWrapper : public husarion_ugv_lights::ChargingAnimation { public: ChargingAnimationWrapper() {} diff --git a/panther_lights/test/unit/animation/test_image_animation.cpp b/husarion_ugv_lights/test/unit/animation/test_image_animation.cpp similarity index 94% rename from panther_lights/test/unit/animation/test_image_animation.cpp rename to husarion_ugv_lights/test/unit/animation/test_image_animation.cpp index 2409a30c..5fdb993c 100644 --- a/panther_lights/test/unit/animation/test_image_animation.cpp +++ b/husarion_ugv_lights/test/unit/animation/test_image_animation.cpp @@ -24,11 +24,11 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_lights/animation/image_animation.hpp" +#include "husarion_ugv_lights/animation/image_animation.hpp" namespace gil = boost::gil; -class ImageAnimationWrapper : public panther_lights::ImageAnimation +class ImageAnimationWrapper : public husarion_ugv_lights::ImageAnimation { public: ImageAnimationWrapper() {} @@ -98,17 +98,17 @@ TEST_F(TestImageAnimation, ParseImagePath) EXPECT_THROW(animation_->ParseImagePath(image_path), std::runtime_error); // invalid substitution - image_path = "$(fin panther_lights)/test/files/animation.png"; + image_path = "$(fin husarion_ugv_lights)/test/files/animation.png"; EXPECT_THROW(animation_->ParseImagePath(image_path), std::runtime_error); - image_path = "$(find panther_lights/test/files/animation.png"; + image_path = "$(find husarion_ugv_lights/test/files/animation.png"; EXPECT_THROW(animation_->ParseImagePath(image_path), std::runtime_error); // following ones may not work if ROS package is not build or sourced - image_path = "$(find panther_lights)/test/files/animation.png"; + image_path = "$(find husarion_ugv_lights)/test/files/animation.png"; EXPECT_NO_THROW(animation_->ParseImagePath(image_path)); // multiple spaces after find syntax - image_path = "$(find panther_lights)/test/files/animation.png"; + image_path = "$(find husarion_ugv_lights)/test/files/animation.png"; EXPECT_NO_THROW(animation_->ParseImagePath(image_path)); } diff --git a/panther_lights/test/unit/led_components/test_led_animation.cpp b/husarion_ugv_lights/test/unit/led_components/test_led_animation.cpp similarity index 79% rename from panther_lights/test/unit/led_components/test_led_animation.cpp rename to husarion_ugv_lights/test/unit/led_components/test_led_animation.cpp index 51dbc58d..67173da0 100644 --- a/panther_lights/test/unit/led_components/test_led_animation.cpp +++ b/husarion_ugv_lights/test/unit/led_components/test_led_animation.cpp @@ -22,8 +22,8 @@ #include "rclcpp/time.hpp" -#include "panther_lights/led_components/led_animations_queue.hpp" -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_animations_queue.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" class TestLEDAnimation : public testing::Test { @@ -37,8 +37,8 @@ class TestLEDAnimation : public testing::Test static constexpr char kTestSegmentName1[] = "segment_1"; static constexpr char kTestSegmentName2[] = "segment_2"; - std::shared_ptr led_anim_; - std::unordered_map> segments_; + std::shared_ptr led_anim_; + std::unordered_map> segments_; }; TestLEDAnimation::TestLEDAnimation() @@ -46,24 +46,24 @@ TestLEDAnimation::TestLEDAnimation() auto segment_1_desc = YAML::Load("{channel: 1, led_range: 0-10}"); auto segment_2_desc = YAML::Load("{channel: 2, led_range: 0-10}"); segments_.emplace( - kTestSegmentName1, std::make_shared(segment_1_desc, 50.0)); + kTestSegmentName1, std::make_shared(segment_1_desc, 50.0)); segments_.emplace( - kTestSegmentName2, std::make_shared(segment_2_desc, 50.0)); + kTestSegmentName2, std::make_shared(segment_2_desc, 50.0)); - panther_lights::AnimationDescription anim_desc; + husarion_ugv_lights::AnimationDescription anim_desc; anim_desc.segments = {kTestSegmentName1, kTestSegmentName2}; - anim_desc.type = "panther_lights::ImageAnimation"; + anim_desc.type = "husarion_ugv_lights::ImageAnimation"; anim_desc.animation = - YAML::Load("{image: $(find panther_lights)/test/files/animation.png, duration: 2.0}"); + YAML::Load("{image: $(find husarion_ugv_lights)/test/files/animation.png, duration: 2.0}"); - panther_lights::LEDAnimationDescription led_anim_desc; + husarion_ugv_lights::LEDAnimationDescription led_anim_desc; led_anim_desc.id = 0; led_anim_desc.name = "TEST"; led_anim_desc.priority = 1; led_anim_desc.timeout = 10.0; led_anim_desc.animations = {anim_desc}; - led_anim_ = std::make_shared( + led_anim_ = std::make_shared( led_anim_desc, segments_, rclcpp::Time(0)); } @@ -80,16 +80,16 @@ void TestLEDAnimation::SetSegmentAnimations() TEST(TestLEDAnimationInitialization, InvalidSegmentName) { - std::unordered_map> segments; + std::unordered_map> segments; - panther_lights::AnimationDescription anim_desc; + husarion_ugv_lights::AnimationDescription anim_desc; anim_desc.segments = {"invalid_segment"}; - panther_lights::LEDAnimationDescription led_anim_desc; + husarion_ugv_lights::LEDAnimationDescription led_anim_desc; led_anim_desc.animations = {anim_desc}; EXPECT_THROW( - std::make_shared(led_anim_desc, segments, rclcpp::Time(0)), + std::make_shared(led_anim_desc, segments, rclcpp::Time(0)), std::runtime_error); } diff --git a/panther_lights/test/unit/led_components/test_led_animations_queue.cpp b/husarion_ugv_lights/test/unit/led_components/test_led_animations_queue.cpp similarity index 66% rename from panther_lights/test/unit/led_components/test_led_animations_queue.cpp rename to husarion_ugv_lights/test/unit/led_components/test_led_animations_queue.cpp index 4eb8d8c7..d7d8c04a 100644 --- a/panther_lights/test/unit/led_components/test_led_animations_queue.cpp +++ b/husarion_ugv_lights/test/unit/led_components/test_led_animations_queue.cpp @@ -22,8 +22,8 @@ #include "rclcpp/time.hpp" -#include "panther_lights/led_components/led_animations_queue.hpp" -#include "panther_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/led_animations_queue.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" class TestLEDAnimationsQueue : public testing::Test { @@ -31,13 +31,13 @@ class TestLEDAnimationsQueue : public testing::Test TestLEDAnimationsQueue(); ~TestLEDAnimationsQueue() {} - panther_lights::LEDAnimation CreateLEDAnimation( + husarion_ugv_lights::LEDAnimation CreateLEDAnimation( const std::string & name, const std::uint8_t priority, const rclcpp::Time & init_time = rclcpp::Time(0)); protected: - std::shared_ptr led_anim_queue_; - std::unordered_map> segments_; + std::shared_ptr led_anim_queue_; + std::unordered_map> segments_; const std::size_t max_queue_size_ = 5; }; @@ -47,35 +47,36 @@ TestLEDAnimationsQueue::TestLEDAnimationsQueue() auto segment_1_desc = YAML::Load("{channel: 1, led_range: 0-10}"); auto segment_2_desc = YAML::Load("{channel: 2, led_range: 0-10}"); segments_.emplace( - "segment_1", std::make_shared(segment_1_desc, 50.0)); + "segment_1", std::make_shared(segment_1_desc, 50.0)); segments_.emplace( - "segment_2", std::make_shared(segment_2_desc, 50.0)); + "segment_2", std::make_shared(segment_2_desc, 50.0)); - led_anim_queue_ = std::make_shared(5); + led_anim_queue_ = std::make_shared(5); } -panther_lights::LEDAnimation TestLEDAnimationsQueue::CreateLEDAnimation( +husarion_ugv_lights::LEDAnimation TestLEDAnimationsQueue::CreateLEDAnimation( const std::string & name, const std::uint8_t priority, const rclcpp::Time & init_time) { - panther_lights::AnimationDescription anim_desc; + husarion_ugv_lights::AnimationDescription anim_desc; anim_desc.segments = {"segment_1", "segment_2"}; - anim_desc.type = "panther_lights::ImageAnimation"; + anim_desc.type = "husarion_ugv_lights::ImageAnimation"; anim_desc.animation = - YAML::Load("{image: $(find panther_lights)/test/files/animation.png, duration: 2.0}"); + YAML::Load("{image: $(find husarion_ugv_lights)/test/files/animation.png, duration: 2.0}"); - panther_lights::LEDAnimationDescription led_anim_desc; + husarion_ugv_lights::LEDAnimationDescription led_anim_desc; led_anim_desc.id = 0; led_anim_desc.name = name; led_anim_desc.priority = priority; led_anim_desc.timeout = 10.0; led_anim_desc.animations = {anim_desc}; - return panther_lights::LEDAnimation(led_anim_desc, segments_, init_time); + return husarion_ugv_lights::LEDAnimation(led_anim_desc, segments_, init_time); } TEST_F(TestLEDAnimationsQueue, Put) { - auto led_anim = std::make_shared(CreateLEDAnimation("TEST", 1)); + auto led_anim = + std::make_shared(CreateLEDAnimation("TEST", 1)); led_anim_queue_->Put(led_anim, rclcpp::Time(0)); EXPECT_FALSE(led_anim_queue_->Empty()); @@ -84,7 +85,8 @@ TEST_F(TestLEDAnimationsQueue, Put) TEST_F(TestLEDAnimationsQueue, PutQueueOverloaded) { - auto led_anim = std::make_shared(CreateLEDAnimation("TEST", 1)); + auto led_anim = + std::make_shared(CreateLEDAnimation("TEST", 1)); for (std::size_t i = 0; i < max_queue_size_; i++) { led_anim_queue_->Put(led_anim, rclcpp::Time(0)); } @@ -95,11 +97,11 @@ TEST_F(TestLEDAnimationsQueue, PutQueueOverloaded) TEST_F(TestLEDAnimationsQueue, PutClearWhenPriorityEqualOne) { auto led_anim_pr_1 = - std::make_shared(CreateLEDAnimation("TEST", 1)); + std::make_shared(CreateLEDAnimation("TEST", 1)); auto led_anim_pr_2 = - std::make_shared(CreateLEDAnimation("TEST", 2)); + std::make_shared(CreateLEDAnimation("TEST", 2)); auto led_anim_pr_3 = - std::make_shared(CreateLEDAnimation("TEST", 3)); + std::make_shared(CreateLEDAnimation("TEST", 3)); led_anim_queue_->Put(led_anim_pr_3, rclcpp::Time(0)); led_anim_queue_->Put(led_anim_pr_2, rclcpp::Time(0)); @@ -113,9 +115,9 @@ TEST_F(TestLEDAnimationsQueue, PutClearWhenPriorityEqualOne) TEST_F(TestLEDAnimationsQueue, PutSortByPriority) { auto led_anim_pr_2 = - std::make_shared(CreateLEDAnimation("TEST", 2)); + std::make_shared(CreateLEDAnimation("TEST", 2)); auto led_anim_pr_3 = - std::make_shared(CreateLEDAnimation("TEST", 3)); + std::make_shared(CreateLEDAnimation("TEST", 3)); led_anim_queue_->Put(led_anim_pr_3, rclcpp::Time(0)); led_anim_queue_->Put(led_anim_pr_2, rclcpp::Time(0)); @@ -130,14 +132,14 @@ TEST_F(TestLEDAnimationsQueue, PutSortByPriority) TEST_F(TestLEDAnimationsQueue, PutSortByTime) { - auto led_anim_t0 = - std::make_shared(CreateLEDAnimation("TEST", 1, rclcpp::Time(0))); - auto led_anim_t1 = - std::make_shared(CreateLEDAnimation("TEST", 1, rclcpp::Time(1))); - auto led_anim_t2 = - std::make_shared(CreateLEDAnimation("TEST", 1, rclcpp::Time(2))); - auto led_anim_t3 = - std::make_shared(CreateLEDAnimation("TEST", 1, rclcpp::Time(3))); + auto led_anim_t0 = std::make_shared( + CreateLEDAnimation("TEST", 1, rclcpp::Time(0))); + auto led_anim_t1 = std::make_shared( + CreateLEDAnimation("TEST", 1, rclcpp::Time(1))); + auto led_anim_t2 = std::make_shared( + CreateLEDAnimation("TEST", 1, rclcpp::Time(2))); + auto led_anim_t3 = std::make_shared( + CreateLEDAnimation("TEST", 1, rclcpp::Time(3))); led_anim_queue_->Put(led_anim_t3, rclcpp::Time(4)); led_anim_queue_->Put(led_anim_t1, rclcpp::Time(4)); @@ -158,11 +160,11 @@ TEST_F(TestLEDAnimationsQueue, GetQueueEmpty) TEST_F(TestLEDAnimationsQueue, Clear) { auto led_anim_pr_1 = - std::make_shared(CreateLEDAnimation("TEST1", 1)); + std::make_shared(CreateLEDAnimation("TEST1", 1)); auto led_anim_pr_2 = - std::make_shared(CreateLEDAnimation("TEST2", 2)); + std::make_shared(CreateLEDAnimation("TEST2", 2)); auto led_anim_pr_3 = - std::make_shared(CreateLEDAnimation("TEST3", 3)); + std::make_shared(CreateLEDAnimation("TEST3", 3)); led_anim_queue_->Put(led_anim_pr_1, rclcpp::Time(0)); led_anim_queue_->Put(led_anim_pr_2, rclcpp::Time(0)); @@ -184,8 +186,8 @@ TEST_F(TestLEDAnimationsQueue, Clear) TEST_F(TestLEDAnimationsQueue, ValidateAnimationTimedOut) { - auto led_anim = - std::make_shared(CreateLEDAnimation("TEST", 1, rclcpp::Time(0))); + auto led_anim = std::make_shared( + CreateLEDAnimation("TEST", 1, rclcpp::Time(0))); led_anim_queue_->Put(led_anim, rclcpp::Time(0)); led_anim_queue_->Validate(rclcpp::Time(0)); @@ -200,11 +202,11 @@ TEST_F(TestLEDAnimationsQueue, ValidateAnimationTimedOut) TEST_F(TestLEDAnimationsQueue, GetFirstAnimationPriority) { auto led_anim_pr_1 = - std::make_shared(CreateLEDAnimation("TEST1", 1)); + std::make_shared(CreateLEDAnimation("TEST1", 1)); auto led_anim_pr_2 = - std::make_shared(CreateLEDAnimation("TEST2", 2)); + std::make_shared(CreateLEDAnimation("TEST2", 2)); auto led_anim_pr_3 = - std::make_shared(CreateLEDAnimation("TEST3", 3)); + std::make_shared(CreateLEDAnimation("TEST3", 3)); led_anim_queue_->Put(led_anim_pr_1, rclcpp::Time(0)); led_anim_queue_->Put(led_anim_pr_2, rclcpp::Time(0)); @@ -223,11 +225,11 @@ TEST_F(TestLEDAnimationsQueue, GetFirstAnimationPriority) TEST_F(TestLEDAnimationsQueue, Remove) { auto led_anim_pr_1 = - std::make_shared(CreateLEDAnimation("TEST1", 1)); + std::make_shared(CreateLEDAnimation("TEST1", 1)); auto led_anim_pr_2 = - std::make_shared(CreateLEDAnimation("TEST2", 2)); + std::make_shared(CreateLEDAnimation("TEST2", 2)); auto led_anim_pr_3 = - std::make_shared(CreateLEDAnimation("TEST3", 3)); + std::make_shared(CreateLEDAnimation("TEST3", 3)); led_anim_queue_->Put(led_anim_pr_1, rclcpp::Time(0)); led_anim_queue_->Put(led_anim_pr_2, rclcpp::Time(0)); diff --git a/panther_lights/test/unit/led_components/test_led_panel.cpp b/husarion_ugv_lights/test/unit/led_components/test_led_panel.cpp similarity index 93% rename from panther_lights/test/unit/led_components/test_led_panel.cpp rename to husarion_ugv_lights/test/unit/led_components/test_led_panel.cpp index 3b3c1aaf..7e0c90c3 100644 --- a/panther_lights/test/unit/led_components/test_led_panel.cpp +++ b/husarion_ugv_lights/test/unit/led_components/test_led_panel.cpp @@ -19,18 +19,18 @@ #include "gtest/gtest.h" -#include "panther_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" class TestLEDPanel : public testing::Test { public: - TestLEDPanel() { led_panel_ = std::make_unique(num_led_); } + TestLEDPanel() { led_panel_ = std::make_unique(num_led_); } ~TestLEDPanel() {} protected: void UpdateAndTestFrame( const std::size_t iterator_first, const std::vector & test_frame); - std::unique_ptr led_panel_; + std::unique_ptr led_panel_; const std::size_t num_led_ = 46; const std::size_t frame_size_ = num_led_ * 4; @@ -60,7 +60,7 @@ void TestLEDPanel::UpdateAndTestFrame( TEST(TestLEDPanelInitialization, FrameSize) { const std::size_t num_led = 22; - auto led_panel = panther_lights::LEDPanel(num_led); + auto led_panel = husarion_ugv_lights::LEDPanel(num_led); EXPECT_EQ(num_led * 4, led_panel.GetFrame().size()); } diff --git a/panther_lights/test/unit/led_components/test_led_segment.cpp b/husarion_ugv_lights/test/unit/led_components/test_led_segment.cpp similarity index 57% rename from panther_lights/test/unit/led_components/test_led_segment.cpp rename to husarion_ugv_lights/test/unit/led_components/test_led_segment.cpp index 82fbec3e..9423f2fd 100644 --- a/panther_lights/test/unit/led_components/test_led_segment.cpp +++ b/husarion_ugv_lights/test/unit/led_components/test_led_segment.cpp @@ -21,10 +21,10 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_lights/led_components/led_segment.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class LEDSegmentWrapper : public panther_lights::LEDSegment +class LEDSegmentWrapper : public husarion_ugv_lights::LEDSegment { public: LEDSegmentWrapper(const YAML::Node & segment_description, const float controller_frequency) @@ -32,8 +32,8 @@ class LEDSegmentWrapper : public panther_lights::LEDSegment { } - std::shared_ptr GetAnimation() const { return animation_; } - std::shared_ptr GetDefaultAnimation() const + std::shared_ptr GetAnimation() const { return animation_; } + std::shared_ptr GetDefaultAnimation() const { return default_animation_; } @@ -67,121 +67,128 @@ YAML::Node CreateSegmentDescription(const std::string & led_range, const std::st TEST(TestLEDSegmentInitialization, DescriptionMissingRequiredKey) { auto segment_desc = YAML::Load(""); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Missing 'channel' in description")); segment_desc = YAML::Load("channel: 0"); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Missing 'led_range' in description")); } TEST(TestLEDSegmentInitialization, InvalidChannelExpression) { auto segment_desc = CreateSegmentDescription("0-10", "s1"); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Failed to convert 'channel' key")); segment_desc["channel"] = "-1"; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Failed to convert 'channel' key")); } TEST(TestLEDSegmentInitialization, InvalidLedRangeExpression) { auto segment_desc = CreateSegmentDescription("010", "1"); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "No '-' character found in the led_range expression")); segment_desc["led_range"] = "s0-10"; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Error converting string to integer")); segment_desc["led_range"] = "0-p10"; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [segment_desc]() { panther_lights::LEDSegment(segment_desc, 10.0); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [segment_desc]() { husarion_ugv_lights::LEDSegment(segment_desc, 10.0); }, "Error converting string to integer")); } TEST(TestLEDSegmentInitialization, ValidDescription) { const auto segment_desc = CreateSegmentDescription("0-10", "1"); - EXPECT_NO_THROW(panther_lights::LEDSegment(segment_desc, 10.0)); + EXPECT_NO_THROW(husarion_ugv_lights::LEDSegment(segment_desc, 10.0)); } TEST(TestLEDSegmentInitialization, FirstLedPosition) { auto segment_desc = CreateSegmentDescription("0-10", "1"); - std::shared_ptr led_segment; + std::shared_ptr led_segment; - ASSERT_NO_THROW(led_segment = std::make_shared(segment_desc, 10.0)); + ASSERT_NO_THROW( + led_segment = std::make_shared(segment_desc, 10.0)); EXPECT_EQ(std::size_t(0), led_segment->GetFirstLEDPosition()); segment_desc["led_range"] = "5-11"; led_segment.reset(); - ASSERT_NO_THROW(led_segment = std::make_shared(segment_desc, 10.0)); + ASSERT_NO_THROW( + led_segment = std::make_shared(segment_desc, 10.0)); EXPECT_EQ(std::size_t(5 * 4), led_segment->GetFirstLEDPosition()); segment_desc["led_range"] = "10-10"; led_segment.reset(); - ASSERT_NO_THROW(led_segment = std::make_shared(segment_desc, 10.0)); + ASSERT_NO_THROW( + led_segment = std::make_shared(segment_desc, 10.0)); EXPECT_EQ(std::size_t(10 * 4), led_segment->GetFirstLEDPosition()); segment_desc["led_range"] = "13-5"; led_segment.reset(); - ASSERT_NO_THROW(led_segment = std::make_shared(segment_desc, 10.0)); + ASSERT_NO_THROW( + led_segment = std::make_shared(segment_desc, 10.0)); EXPECT_EQ(std::size_t(5 * 4), led_segment->GetFirstLEDPosition()); segment_desc["led_range"] = "17-0"; led_segment.reset(); - ASSERT_NO_THROW(led_segment = std::make_shared(segment_desc, 10.0)); + ASSERT_NO_THROW( + led_segment = std::make_shared(segment_desc, 10.0)); EXPECT_EQ(std::size_t(0), led_segment->GetFirstLEDPosition()); } TEST_F(TestLEDSegment, GetAnimationFrameNoAnimation) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { led_segment_->GetAnimationFrame(); }, "Segment animation not defined")); } TEST_F(TestLEDSegment, GetAnimationProgressNoAnimation) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { led_segment_->GetAnimationProgress(); }, "Segment animation not defined")); } TEST_F(TestLEDSegment, ResetAnimationNoAnimation) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { led_segment_->ResetAnimation(); }, "Segment animation not defined")); } TEST_F(TestLEDSegment, GetAnimationBrightnessNoAnimation) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { led_segment_->GetAnimationBrightness(); }, "Segment animation not defined")); } TEST_F(TestLEDSegment, SetAnimationInvalidType) { const YAML::Node animation_desc; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { - led_segment_->SetAnimation("panther_lights::WrongAnimationType}", animation_desc, false); + led_segment_->SetAnimation("husarion_ugv_lights::WrongAnimationType}", animation_desc, false); }, "The plugin failed to load. Error: ")); } TEST_F(TestLEDSegment, SetAnimationFailAnimationInitialization) { - const auto animation_desc = YAML::Load("{type: panther_lights::ImageAnimation}"); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [&]() { led_segment_->SetAnimation("panther_lights::ImageAnimation", animation_desc, false); }, + const auto animation_desc = YAML::Load("{type: husarion_ugv_lights::ImageAnimation}"); + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [&]() { + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", animation_desc, false); + }, "Failed to initialize animation: ")); } @@ -189,27 +196,29 @@ TEST_F(TestLEDSegment, SetAnimation) { // test each known animtion type const auto image_anim_desc = YAML::Load( - "{image: $(find panther_lights)/test/files/animation.png, " + "{image: $(find husarion_ugv_lights)/test/files/animation.png, " "duration: 2}"); const auto charging_anim_desc = YAML::Load("{duration: 2}"); EXPECT_NO_THROW( - led_segment_->SetAnimation("panther_lights::ImageAnimation", image_anim_desc, false)); + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", image_anim_desc, false)); EXPECT_NO_THROW(led_segment_->SetAnimation( - "panther_lights::ChargingAnimation", charging_anim_desc, false, "0.5")); + "husarion_ugv_lights::ChargingAnimation", charging_anim_desc, false, "0.5")); } TEST_F(TestLEDSegment, SetAnimationRepeating) { const auto anim_desc = YAML::Load( - "{image: $(find panther_lights)/test/files/animation.png, " + "{image: $(find husarion_ugv_lights)/test/files/animation.png, " "duration: 2}"); - ASSERT_NO_THROW(led_segment_->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + ASSERT_NO_THROW( + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); EXPECT_TRUE(led_segment_->GetDefaultAnimation().get() == nullptr); - ASSERT_NO_THROW(led_segment_->SetAnimation("panther_lights::ImageAnimation", anim_desc, true)); + ASSERT_NO_THROW( + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, true)); EXPECT_TRUE(led_segment_->GetDefaultAnimation().get() != nullptr); EXPECT_TRUE(led_segment_->IsAnimationFinished()); @@ -217,16 +226,17 @@ TEST_F(TestLEDSegment, SetAnimationRepeating) TEST_F(TestLEDSegment, UpdateAnimationAnimationNotSet) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { led_segment_->UpdateAnimation(); }, "Segment animation not defined")); } TEST_F(TestLEDSegment, UpdateAnimation) { const auto anim_desc = YAML::Load( - "{image: $(find panther_lights)/test/files/animation.png, " + "{image: $(find husarion_ugv_lights)/test/files/animation.png, " "duration: 2}"); - ASSERT_NO_THROW(led_segment_->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + ASSERT_NO_THROW( + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); EXPECT_NO_THROW(led_segment_->UpdateAnimation()); EXPECT_EQ(segment_led_num_ * 4, led_segment_->GetAnimationFrame().size()); } @@ -240,9 +250,10 @@ int main(int argc, char ** argv) TEST_F(TestLEDSegment, ResetDefaultAnimationWhenNewArrive) { const auto anim_desc = YAML::Load( - "{image: $(find panther_lights)/test/files/animation.png, " + "{image: $(find husarion_ugv_lights)/test/files/animation.png, " "duration: 2}"); - ASSERT_NO_THROW(led_segment_->SetAnimation("panther_lights::ImageAnimation", anim_desc, true)); + ASSERT_NO_THROW( + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, true)); auto default_anim = led_segment_->GetDefaultAnimation(); while (!default_anim->IsFinished()) { @@ -250,7 +261,8 @@ TEST_F(TestLEDSegment, ResetDefaultAnimationWhenNewArrive) } // add new animation, and check if default animation was reset - ASSERT_NO_THROW(led_segment_->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + ASSERT_NO_THROW( + led_segment_->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); EXPECT_FALSE(default_anim->IsFinished()); } diff --git a/panther_lights/test/unit/led_components/test_segment_converter.cpp b/husarion_ugv_lights/test/unit/led_components/test_segment_converter.cpp similarity index 69% rename from panther_lights/test/unit/led_components/test_segment_converter.cpp rename to husarion_ugv_lights/test/unit/led_components/test_segment_converter.cpp index 807f9440..53928704 100644 --- a/panther_lights/test/unit/led_components/test_segment_converter.cpp +++ b/husarion_ugv_lights/test/unit/led_components/test_segment_converter.cpp @@ -22,20 +22,20 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_lights/led_components/led_panel.hpp" -#include "panther_lights/led_components/led_segment.hpp" -#include "panther_lights/led_components/segment_converter.hpp" +#include "husarion_ugv_lights/led_components/led_panel.hpp" +#include "husarion_ugv_lights/led_components/led_segment.hpp" +#include "husarion_ugv_lights/led_components/segment_converter.hpp" class TestSegmentConverter : public testing::Test { public: TestSegmentConverter() { - segment_converter_ = std::make_unique(); + segment_converter_ = std::make_unique(); // create 2 basic panels with different number of leds - led_panels_.insert({1, std::make_unique(panel_1_num_led_)}); - led_panels_.insert({2, std::make_unique(panel_2_num_led_)}); + led_panels_.insert({1, std::make_unique(panel_1_num_led_)}); + led_panels_.insert({2, std::make_unique(panel_2_num_led_)}); } ~TestSegmentConverter() {} @@ -47,9 +47,9 @@ class TestSegmentConverter : public testing::Test std::size_t panel_1_num_led_ = 20; std::size_t panel_2_num_led_ = 30; - std::unique_ptr segment_converter_; - std::unordered_map> segments_; - std::unordered_map> led_panels_; + std::unique_ptr segment_converter_; + std::unordered_map> segments_; + std::unordered_map> led_panels_; }; YAML::Node TestSegmentConverter::CreateSegmentDescription( @@ -63,17 +63,17 @@ YAML::Node TestSegmentConverter::CreateSegmentDescription( YAML::Node TestSegmentConverter::CreateImageAnimationDescription() { - return YAML::Load("{image: $(find panther_lights)/test/files/animation.png, duration: 2}"); + return YAML::Load("{image: $(find husarion_ugv_lights)/test/files/animation.png, duration: 2}"); } TEST_F(TestSegmentConverter, ConvertInvalidChannel) { segments_.emplace( "name", - std::make_shared(CreateSegmentDescription(0, 10, 123), 50.0)); + std::make_shared(CreateSegmentDescription(0, 10, 123), 50.0)); const auto anim_desc = CreateImageAnimationDescription(); ASSERT_NO_THROW( - segments_.at("name")->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + segments_.at("name")->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); EXPECT_THROW(segment_converter_->Convert(segments_, led_panels_), std::out_of_range); } @@ -81,11 +81,11 @@ TEST_F(TestSegmentConverter, ConvertInvalidChannel) TEST_F(TestSegmentConverter, ConvertInvalidLedRange) { segments_.emplace( - "name", std::make_shared( + "name", std::make_shared( CreateSegmentDescription(panel_1_num_led_, panel_1_num_led_ + 1, 1), 50.0)); const auto anim_desc = CreateImageAnimationDescription(); ASSERT_NO_THROW( - segments_.at("name")->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + segments_.at("name")->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); EXPECT_THROW(segment_converter_->Convert(segments_, led_panels_), std::runtime_error); } @@ -93,17 +93,17 @@ TEST_F(TestSegmentConverter, ConvertInvalidLedRange) TEST_F(TestSegmentConverter, ConvertSingleSegmentForEachPanel) { segments_.emplace( - "name_1", std::make_shared( + "name_1", std::make_shared( CreateSegmentDescription(0, panel_1_num_led_ - 1, 1), 50.0)); segments_.emplace( - "name_2", std::make_shared( + "name_2", std::make_shared( CreateSegmentDescription(0, panel_2_num_led_ - 1, 2), 50.0)); const auto anim_desc = CreateImageAnimationDescription(); for (auto & segment : segments_) { ASSERT_NO_THROW( - segment.second->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + segment.second->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); ASSERT_NO_THROW(segment.second->UpdateAnimation()); } @@ -113,28 +113,28 @@ TEST_F(TestSegmentConverter, ConvertSingleSegmentForEachPanel) TEST_F(TestSegmentConverter, ConvertMultipleSegments) { segments_.emplace( - "name_1", std::make_shared( + "name_1", std::make_shared( CreateSegmentDescription(0, std::size_t(panel_1_num_led_ / 2) - 1, 1), 50.0)); segments_.emplace( "name_2", - std::make_shared( + std::make_shared( CreateSegmentDescription(std::size_t(panel_1_num_led_ / 2), panel_1_num_led_ - 1, 1), 50.0)); segments_.emplace( - "name_3", std::make_shared( + "name_3", std::make_shared( CreateSegmentDescription(0, (panel_2_num_led_ / 4) - 1, 2), 50.0)); segments_.emplace( "name_4", - std::make_shared( + std::make_shared( CreateSegmentDescription((panel_2_num_led_ / 4), (panel_2_num_led_ / 2) - 1, 2), 50.0)); segments_.emplace( - "name_5", std::make_shared( + "name_5", std::make_shared( CreateSegmentDescription((panel_2_num_led_ / 2), panel_2_num_led_ - 1, 2), 50.0)); const auto anim_desc = CreateImageAnimationDescription(); for (auto & segment : segments_) { ASSERT_NO_THROW( - segment.second->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + segment.second->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); ASSERT_NO_THROW(segment.second->UpdateAnimation()); } @@ -150,11 +150,11 @@ TEST_F(TestSegmentConverter, ConvertBrightnessOverride) anim_desc["brightness"] = float_brightness; segments_.emplace( - "name", std::make_shared( + "name", std::make_shared( CreateSegmentDescription(0, panel_1_num_led_ - 1, channel), 50.0)); ASSERT_NO_THROW( - segments_.at("name")->SetAnimation("panther_lights::ImageAnimation", anim_desc, false)); + segments_.at("name")->SetAnimation("husarion_ugv_lights::ImageAnimation", anim_desc, false)); segment_converter_->Convert(segments_, led_panels_); ASSERT_NO_THROW(segment_converter_->Convert(segments_, led_panels_)); @@ -169,10 +169,10 @@ TEST_F(TestSegmentConverter, ConvertBrightnessOverride) TEST_F(TestSegmentConverter, ConvertNoThrowIfAnimationNotSet) { segments_.emplace( - "name_1", std::make_shared( + "name_1", std::make_shared( CreateSegmentDescription(0, panel_1_num_led_ - 1, 1), 50.0)); segments_.emplace( - "name_2", std::make_shared( + "name_2", std::make_shared( CreateSegmentDescription(0, panel_2_num_led_ - 1, 2), 50.0)); EXPECT_NO_THROW(segment_converter_->Convert(segments_, led_panels_)); diff --git a/panther_lights/test/unit/test_apa102.cpp b/husarion_ugv_lights/test/unit/test_apa102.cpp similarity index 97% rename from panther_lights/test/unit/test_apa102.cpp rename to husarion_ugv_lights/test/unit/test_apa102.cpp index 2f5bbd2f..2d43684c 100644 --- a/panther_lights/test/unit/test_apa102.cpp +++ b/husarion_ugv_lights/test/unit/test_apa102.cpp @@ -15,13 +15,13 @@ #include #include -#include "panther_lights/apa102.hpp" +#include "husarion_ugv_lights/apa102.hpp" static constexpr char kMockDeviceName[] = "/dev/mocked_device"; static constexpr int kStartFrame = 0x00; static constexpr int kEndFrame = 0xFF; -class MockSPIDevice : public panther_lights::SPIDeviceInterface +class MockSPIDevice : public husarion_ugv_lights::SPIDeviceInterface { public: MOCK_METHOD(int, Open, (const std::string & device), (override)); @@ -32,7 +32,7 @@ class MockSPIDevice : public panther_lights::SPIDeviceInterface using NiceMock = testing::NiceMock; }; -class APA102Wrapper : public panther_lights::APA102 +class APA102Wrapper : public husarion_ugv_lights::APA102 { public: APA102Wrapper(std::shared_ptr spi_device, const std::string & device_name) diff --git a/panther_lights/test/unit/test_lights_controller_node.cpp b/husarion_ugv_lights/test/unit/test_lights_controller_node.cpp similarity index 87% rename from panther_lights/test/unit/test_lights_controller_node.cpp rename to husarion_ugv_lights/test/unit/test_lights_controller_node.cpp index 99b0a069..07546ac4 100644 --- a/panther_lights/test/unit/test_lights_controller_node.cpp +++ b/husarion_ugv_lights/test/unit/test_lights_controller_node.cpp @@ -26,10 +26,10 @@ #include "rclcpp/rclcpp.hpp" -#include "panther_lights/lights_controller_node.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_lights/lights_controller_node.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class ControllerNodeWrapper : public panther_lights::LightsControllerNode +class ControllerNodeWrapper : public husarion_ugv_lights::LightsControllerNode { public: ControllerNodeWrapper(const rclcpp::NodeOptions & options) : LightsControllerNode(options) {} @@ -55,9 +55,12 @@ class ControllerNodeWrapper : public panther_lights::LightsControllerNode return LightsControllerNode::AddAnimationToQueue(animation_id, repeating, param); } - std::shared_ptr GetQueue() { return this->animations_queue_; } + std::shared_ptr GetQueue() + { + return this->animations_queue_; + } - std::shared_ptr GetCurrentAnimation() + std::shared_ptr GetCurrentAnimation() { return this->current_animation_; } @@ -116,11 +119,11 @@ void TestLightsControllerNode::CreateLEDConfig(const std::filesystem::path file_ segments_map["test"] = std::vector(1, kTestSegmentName); YAML::Node animation; - animation["image"] = "$(find panther_lights)/test/files/strip01_red.png"; + animation["image"] = "$(find husarion_ugv_lights)/test/files/strip01_red.png"; animation["duration"] = 2; YAML::Node animation_desc; - animation_desc["type"] = "panther_lights::ImageAnimation"; + animation_desc["type"] = "husarion_ugv_lights::ImageAnimation"; animation_desc["segments"] = "test"; animation_desc["animation"] = animation; @@ -171,7 +174,7 @@ TEST_F(TestLightsControllerNode, InitializeLEDPanelsThrowRepeatingChannel) YAML::Node panels_desc; panels_desc["panels"] = panels; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->InitializeLEDPanels(panels_desc["panels"]); }, "Multiple panels with channel nr")); } @@ -195,7 +198,7 @@ TEST_F(TestLightsControllerNode, InitializeLEDSegmentsThrowRepeatingName) YAML::Node segments_desc; segments_desc["segments"] = segments; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->InitializeLEDSegments(segments_desc["segments"], 50.0); }, "Multiple segments with given name found")); } @@ -206,13 +209,13 @@ TEST_F(TestLightsControllerNode, LoadAnimationInvalidPriority) led_animation_desc["id"] = 11; led_animation_desc["priority"] = 0; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->LoadAnimation(led_animation_desc); }, "Invalid LED animation priority")); led_animation_desc["priority"] = 4; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->LoadAnimation(led_animation_desc); }, "Invalid LED animation priority")); } @@ -225,14 +228,14 @@ TEST_F(TestLightsControllerNode, LoadAnimationThrowRepeatingID) ASSERT_NO_THROW(lights_controller_node_->LoadAnimation(led_animation_desc)); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->LoadAnimation(led_animation_desc); }, "Animation with given ID already exists")); } TEST_F(TestLightsControllerNode, AddAnimationToQueueThrowBadAnimationID) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { lights_controller_node_->AddAnimationToQueue(99, false); }, "No animation with ID:")); } diff --git a/panther_lights/test/unit/test_lights_driver_node.cpp b/husarion_ugv_lights/test/unit/test_lights_driver_node.cpp similarity index 95% rename from panther_lights/test/unit/test_lights_driver_node.cpp rename to husarion_ugv_lights/test/unit/test_lights_driver_node.cpp index 09918acf..91fcc0c1 100644 --- a/panther_lights/test/unit/test_lights_driver_node.cpp +++ b/husarion_ugv_lights/test/unit/test_lights_driver_node.cpp @@ -25,15 +25,15 @@ #include "panther_msgs/srv/set_led_brightness.hpp" -#include "panther_lights/apa102.hpp" -#include "panther_lights/lights_driver_node.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_lights/apa102.hpp" +#include "husarion_ugv_lights/lights_driver_node.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" using ImageMsg = sensor_msgs::msg::Image; using SetBoolSrv = std_srvs::srv::SetBool; using SetLEDBrightnessSrv = panther_msgs::srv::SetLEDBrightness; -class MockAPA102 : public panther_lights::APA102Interface +class MockAPA102 : public husarion_ugv_lights::APA102Interface { public: MOCK_METHOD(void, SetGlobalBrightness, (const std::uint8_t brightness), (override)); @@ -44,7 +44,7 @@ class MockAPA102 : public panther_lights::APA102Interface }; // LightsDriverNode constructor implemented for testing purposes -panther_lights::LightsDriverNode::LightsDriverNode( +husarion_ugv_lights::LightsDriverNode::LightsDriverNode( APA102Interface::SharedPtr channel_1, APA102Interface::SharedPtr channel_2, const rclcpp::NodeOptions & options) : Node("lights_driver", options), @@ -60,7 +60,7 @@ panther_lights::LightsDriverNode::LightsDriverNode( frame_timeout_ = 0.1; }; -class DriverNodeWrapper : public panther_lights::LightsDriverNode +class DriverNodeWrapper : public husarion_ugv_lights::LightsDriverNode { public: DriverNodeWrapper( @@ -78,7 +78,7 @@ class DriverNodeWrapper : public panther_lights::LightsDriverNode } void FrameCB( - const ImageMsg::UniquePtr & msg, const panther_lights::APA102Interface::SharedPtr & panel, + const ImageMsg::UniquePtr & msg, const husarion_ugv_lights::APA102Interface::SharedPtr & panel, const rclcpp::Time & last_time, const std::string & panel_name) { return LightsDriverNode::FrameCB(msg, panel, last_time, panel_name); diff --git a/panther_localization/CHANGELOG.rst b/husarion_ugv_localization/CHANGELOG.rst similarity index 100% rename from panther_localization/CHANGELOG.rst rename to husarion_ugv_localization/CHANGELOG.rst diff --git a/panther_controller/CMakeLists.txt b/husarion_ugv_localization/CMakeLists.txt similarity index 82% rename from panther_controller/CMakeLists.txt rename to husarion_ugv_localization/CMakeLists.txt index c6489681..2ce65ec9 100644 --- a/panther_controller/CMakeLists.txt +++ b/husarion_ugv_localization/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_controller) +project(husarion_ugv_localization) find_package(ament_cmake REQUIRED) diff --git a/panther_localization/README.md b/husarion_ugv_localization/README.md similarity index 98% rename from panther_localization/README.md rename to husarion_ugv_localization/README.md index 416af897..c89705ea 100644 --- a/panther_localization/README.md +++ b/husarion_ugv_localization/README.md @@ -1,4 +1,4 @@ -# panther_localization +# husarion_ugv_localization The package is responsible for activating mods responsible for fusion of data related to the robot's location. diff --git a/panther_localization/config/enu_localization.yaml b/husarion_ugv_localization/config/enu_localization.yaml similarity index 99% rename from panther_localization/config/enu_localization.yaml rename to husarion_ugv_localization/config/enu_localization.yaml index afaee4e2..6b2668cc 100644 --- a/panther_localization/config/enu_localization.yaml +++ b/husarion_ugv_localization/config/enu_localization.yaml @@ -41,7 +41,7 @@ use_control: true control_timeout: 0.5 control_config: [true, true, false, false, false, true] - acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside panther_controller/config + acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside husarion_ugv_controller/config predict_to_current_time: true diff --git a/panther_localization/config/enu_localization_with_gps.yaml b/husarion_ugv_localization/config/enu_localization_with_gps.yaml similarity index 99% rename from panther_localization/config/enu_localization_with_gps.yaml rename to husarion_ugv_localization/config/enu_localization_with_gps.yaml index 96c60320..ef1fa6ff 100644 --- a/panther_localization/config/enu_localization_with_gps.yaml +++ b/husarion_ugv_localization/config/enu_localization_with_gps.yaml @@ -51,7 +51,7 @@ use_control: true control_timeout: 0.5 control_config: [true, true, false, false, false, true] - acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside panther_controller/config + acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside husarion_ugv_controller/config predict_to_current_time: true diff --git a/panther_localization/config/nmea_navsat_params.yaml b/husarion_ugv_localization/config/nmea_navsat_params.yaml similarity index 100% rename from panther_localization/config/nmea_navsat_params.yaml rename to husarion_ugv_localization/config/nmea_navsat_params.yaml diff --git a/panther_localization/config/relative_localization.yaml b/husarion_ugv_localization/config/relative_localization.yaml similarity index 99% rename from panther_localization/config/relative_localization.yaml rename to husarion_ugv_localization/config/relative_localization.yaml index 3e29fcdd..5f420735 100644 --- a/panther_localization/config/relative_localization.yaml +++ b/husarion_ugv_localization/config/relative_localization.yaml @@ -41,7 +41,7 @@ use_control: true control_timeout: 0.5 control_config: [true, true, false, false, false, true] - acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside panther_controller/config + acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside husarion_ugv_controller/config predict_to_current_time: true diff --git a/panther_localization/config/relative_localization_with_gps.yaml b/husarion_ugv_localization/config/relative_localization_with_gps.yaml similarity index 99% rename from panther_localization/config/relative_localization_with_gps.yaml rename to husarion_ugv_localization/config/relative_localization_with_gps.yaml index 0a98abcb..fa842675 100644 --- a/panther_localization/config/relative_localization_with_gps.yaml +++ b/husarion_ugv_localization/config/relative_localization_with_gps.yaml @@ -51,7 +51,7 @@ use_control: true control_timeout: 0.5 control_config: [true, true, false, false, false, true] - acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside panther_controller/config + acceleration_limits: [2.7, 1.5, 0.0, 0.0, 0.0, 5.7] # Values taken from WH01_controller.yaml and WH02_controller.yaml inside husarion_ugv_controller/config predict_to_current_time: true diff --git a/panther_localization/launch/localization.launch.py b/husarion_ugv_localization/launch/localization.launch.py similarity index 96% rename from panther_localization/launch/localization.launch.py rename to husarion_ugv_localization/launch/localization.launch.py index 2645a6b4..209aa702 100644 --- a/panther_localization/launch/localization.launch.py +++ b/husarion_ugv_localization/launch/localization.launch.py @@ -82,7 +82,7 @@ def generate_launch_description(): declare_localization_config_path_arg = DeclareLaunchArgument( "localization_config_path", default_value=PathJoinSubstitution( - [FindPackageShare("panther_localization"), "config", localization_config_filename] + [FindPackageShare("husarion_ugv_localization"), "config", localization_config_filename] ), description="Specify the path to the localization configuration file.", ) @@ -104,7 +104,7 @@ def generate_launch_description(): nmea_navsat_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( - [FindPackageShare("panther_localization"), "launch", "nmea_navsat.launch.py"] + [FindPackageShare("husarion_ugv_localization"), "launch", "nmea_navsat.launch.py"] ) ), launch_arguments={"namespace": namespace}.items(), diff --git a/panther_localization/launch/nmea_navsat.launch.py b/husarion_ugv_localization/launch/nmea_navsat.launch.py similarity index 96% rename from panther_localization/launch/nmea_navsat.launch.py rename to husarion_ugv_localization/launch/nmea_navsat.launch.py index 585438f2..9799a257 100644 --- a/panther_localization/launch/nmea_navsat.launch.py +++ b/husarion_ugv_localization/launch/nmea_navsat.launch.py @@ -37,7 +37,7 @@ def generate_launch_description(): declare_params_file_arg = DeclareLaunchArgument( "params_file", default_value=PathJoinSubstitution( - [FindPackageShare("panther_localization"), "config", "nmea_navsat_params.yaml"] + [FindPackageShare("husarion_ugv_localization"), "config", "nmea_navsat_params.yaml"] ), description="Path to the parameter file for the nmea_socket_driver node.", ) diff --git a/panther_localization/package.xml b/husarion_ugv_localization/package.xml similarity index 87% rename from panther_localization/package.xml rename to husarion_ugv_localization/package.xml index 7cef452a..3625e5d9 100644 --- a/panther_localization/package.xml +++ b/husarion_ugv_localization/package.xml @@ -1,9 +1,9 @@ - panther_localization + husarion_ugv_localization 2.1.1 - robot localization configuration for Panther + robot localization configuration for Husarion UGV robots Husarion Apache License 2.0 diff --git a/panther_manager/CHANGELOG.rst b/husarion_ugv_manager/CHANGELOG.rst similarity index 100% rename from panther_manager/CHANGELOG.rst rename to husarion_ugv_manager/CHANGELOG.rst diff --git a/panther_manager/CMakeLists.txt b/husarion_ugv_manager/CMakeLists.txt similarity index 95% rename from panther_manager/CMakeLists.txt rename to husarion_ugv_manager/CMakeLists.txt index fbf7fc92..29286611 100644 --- a/panther_manager/CMakeLists.txt +++ b/husarion_ugv_manager/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(panther_manager) +project(husarion_ugv_manager) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) @@ -12,7 +12,7 @@ set(PACKAGE_DEPENDENCIES behaviortree_ros2 libssh panther_msgs - panther_utils + husarion_ugv_utils rclcpp rclcpp_action sensor_msgs @@ -67,7 +67,7 @@ ament_target_dependencies( safety_manager_node behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs) @@ -80,7 +80,7 @@ ament_target_dependencies( lights_manager_node behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs) @@ -167,8 +167,9 @@ if(BUILD_TESTING) ${PROJECT_NAME}_test_behavior_tree_utils PUBLIC $ $) - ament_target_dependencies(${PROJECT_NAME}_test_behavior_tree_utils - behaviortree_cpp behaviortree_ros2 panther_utils) + ament_target_dependencies( + ${PROJECT_NAME}_test_behavior_tree_utils behaviortree_cpp behaviortree_ros2 + husarion_ugv_utils) ament_add_gtest( ${PROJECT_NAME}_test_behavior_tree_manager @@ -178,7 +179,7 @@ if(BUILD_TESTING) PUBLIC $ $) ament_target_dependencies(${PROJECT_NAME}_test_behavior_tree_manager - behaviortree_cpp panther_utils) + behaviortree_cpp husarion_ugv_utils) ament_add_gtest( ${PROJECT_NAME}_test_lights_manager_node test/test_lights_manager_node.cpp @@ -192,7 +193,7 @@ if(BUILD_TESTING) behaviortree_cpp behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs) @@ -210,7 +211,7 @@ if(BUILD_TESTING) behaviortree_cpp behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs) @@ -227,7 +228,7 @@ if(BUILD_TESTING) behaviortree_cpp behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs) @@ -245,7 +246,7 @@ if(BUILD_TESTING) behaviortree_cpp behaviortree_ros2 panther_msgs - panther_utils + husarion_ugv_utils rclcpp sensor_msgs std_msgs diff --git a/panther_manager/CONFIGURATION.md b/husarion_ugv_manager/CONFIGURATION.md similarity index 96% rename from panther_manager/CONFIGURATION.md rename to husarion_ugv_manager/CONFIGURATION.md index 6454c886..adc2337a 100644 --- a/panther_manager/CONFIGURATION.md +++ b/husarion_ugv_manager/CONFIGURATION.md @@ -1,4 +1,4 @@ -# panther_manager +# husarion_ugv_manager ## Shutdown Behavior @@ -39,7 +39,7 @@ ssh-copy-id username@10.15.20.XX ## Faults Handle -After receiving a message on the `battery/battery_status` topic, the `panther_manager` node makes decisions regarding safety measures. For more information regarding the power supply status, please refer to the [BatteryState](https://docs.ros2.org/latest/api/sensor_msgs/msg/BatteryState.html) message definition and [adc_battery.cpp](../panther_battery/src/battery/adc_battery.cpp) implementation. +After receiving a message on the `battery/battery_status` topic, the `husarion_ugv_manager` node makes decisions regarding safety measures. For more information regarding the power supply status, please refer to the [BatteryState](https://docs.ros2.org/latest/api/sensor_msgs/msg/BatteryState.html) message definition and [adc_battery.cpp](../husarion_ugv_battery/src/battery/adc_battery.cpp) implementation. | Power Supply Health | Procedure | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -204,7 +204,7 @@ To use your customized project, you can modify the `bt_project_file` ROS paramet ### Real-time Visualization -Groot2 also provides a real-time visualization tool that allows you to see and debug actively running trees. To use this tool with trees launched with the `panther_manager` package, you need to specify the port associated with the tree you want to visualize. The ports for each tree are listed below: +Groot2 also provides a real-time visualization tool that allows you to see and debug actively running trees. To use this tool with trees launched with the `husarion_ugv_manager` package, you need to specify the port associated with the tree you want to visualize. The ports for each tree are listed below: - Lights tree: `10.15.20.2:5555` - Safety tree: `10.15.20.2:6666` diff --git a/panther_manager/README.md b/husarion_ugv_manager/README.md similarity index 95% rename from panther_manager/README.md rename to husarion_ugv_manager/README.md index 718abece..bf7c8b00 100644 --- a/panther_manager/README.md +++ b/husarion_ugv_manager/README.md @@ -1,6 +1,6 @@ -# panther_manager +# husarion_ugv_manager -A package containing nodes responsible for high-level control of Husarion Panther robot. +A package containing nodes responsible for high-level control of Husarion UGV robots. ## Launch Files @@ -42,7 +42,7 @@ Node responsible for managing Bumper Lights animation scheduling. - `battery.percent.threshold.critical` [*float*, default: **0.1**]: If the Battery percentage drops below this value, an animation indicating a critical Battery state will start being displayed. - `battery.percent.threshold.low` [*float*, default: **0.4**]: If the Battery percentage drops below this value, the animation indicating a low Battery state will start being displayed. - `battery.percent.window_len` [*int*, default: **6**]: Moving average window length used to smooth out Battery percentage readings. -- `bt_project_path` [*string*, default: **$(find panther_manager)/config/PantherBT.btproj**]: Path to a BehaviorTree project. +- `bt_project_path` [*string*, default: **$(find husarion_ugv_manager)/config/PantherBT.btproj**]: Path to a BehaviorTree project. - `plugin_libs` [*list*, default: **Empty list**]: List with names of plugins that are used in the BT project. - `ros_communication_timeout.availability` [*float*, default: **1.0**]: Timeout **[s]** to wait for a service/action while initializing BT node. - `ros_communication_timeout.response` [*float*, default: **1.0**]: Timeout **[s]** to receive a service/action response after call. @@ -70,7 +70,7 @@ Node responsible for managing safety features, and software shutdown of componen #### Parameters - `battery.temp.window_len` [*int*, default: **6**]: Moving average window length used to smooth out temperature readings of the Battery. -- `bt_project_path` [*string*, default: **$(find panther_manager)/config/PantherBT.btproj**]: Path to a BehaviorTree project. +- `bt_project_path` [*string*, default: **$(find husarion_ugv_manager)/config/PantherBT.btproj**]: Path to a BehaviorTree project. - `cpu.temp.fan_off` [*float*, default: **60.0**]: Temperature in **[°C]** of the Built-in Computer's CPU, below which the fan is turned off. - `cpu.temp.fan_on` [*float*, default: **70.0**]: Temperature in **[°C]** of the Built-in Computer's CPU, above which the fan is turned on. - `cpu.temp.window_len` [*int*, default: **6**]: Moving average window length used to smooth out temperature readings of the Built-in Computer's CPU. diff --git a/panther_manager/behavior_trees/PantherLightsBT.btproj b/husarion_ugv_manager/behavior_trees/PantherLightsBT.btproj similarity index 100% rename from panther_manager/behavior_trees/PantherLightsBT.btproj rename to husarion_ugv_manager/behavior_trees/PantherLightsBT.btproj diff --git a/panther_manager/behavior_trees/PantherSafetyBT.btproj b/husarion_ugv_manager/behavior_trees/PantherSafetyBT.btproj similarity index 100% rename from panther_manager/behavior_trees/PantherSafetyBT.btproj rename to husarion_ugv_manager/behavior_trees/PantherSafetyBT.btproj diff --git a/panther_manager/behavior_trees/lights.xml b/husarion_ugv_manager/behavior_trees/lights.xml similarity index 100% rename from panther_manager/behavior_trees/lights.xml rename to husarion_ugv_manager/behavior_trees/lights.xml diff --git a/panther_manager/behavior_trees/safety.xml b/husarion_ugv_manager/behavior_trees/safety.xml similarity index 100% rename from panther_manager/behavior_trees/safety.xml rename to husarion_ugv_manager/behavior_trees/safety.xml diff --git a/panther_manager/behavior_trees/shutdown.xml b/husarion_ugv_manager/behavior_trees/shutdown.xml similarity index 100% rename from panther_manager/behavior_trees/shutdown.xml rename to husarion_ugv_manager/behavior_trees/shutdown.xml diff --git a/panther_manager/config/lights_manager.yaml b/husarion_ugv_manager/config/lights_manager.yaml similarity index 100% rename from panther_manager/config/lights_manager.yaml rename to husarion_ugv_manager/config/lights_manager.yaml diff --git a/panther_manager/config/safety_manager.yaml b/husarion_ugv_manager/config/safety_manager.yaml similarity index 100% rename from panther_manager/config/safety_manager.yaml rename to husarion_ugv_manager/config/safety_manager.yaml diff --git a/panther_manager/config/shutdown_hosts.yaml b/husarion_ugv_manager/config/shutdown_hosts.yaml similarity index 100% rename from panther_manager/config/shutdown_hosts.yaml rename to husarion_ugv_manager/config/shutdown_hosts.yaml diff --git a/panther_manager/include/panther_manager/behavior_tree_manager.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_manager.hpp similarity index 92% rename from panther_manager/include/panther_manager/behavior_tree_manager.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_manager.hpp index 24d6eed0..831a0c7b 100644 --- a/panther_manager/include/panther_manager/behavior_tree_manager.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_manager.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ -#define PANTHER_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ +#ifndef HUSARION_UGV_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ +#define HUSARION_UGV_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ #include #include @@ -24,7 +24,7 @@ #include "behaviortree_cpp/loggers/groot2_publisher.h" #include "rclcpp/rclcpp.hpp" -namespace panther_manager +namespace husarion_ugv_manager { /** @@ -93,6 +93,6 @@ class BehaviorTreeManager std::unique_ptr groot_publisher_; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ +#endif // HUSARION_UGV_MANAGER_BEHAVIOR_TREE_MANAGER_HPP_ diff --git a/panther_manager/include/panther_manager/behavior_tree_utils.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_utils.hpp similarity index 89% rename from panther_manager/include/panther_manager/behavior_tree_utils.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_utils.hpp index 360e174e..8d411136 100644 --- a/panther_manager/include/panther_manager/behavior_tree_utils.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/behavior_tree_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ -#define PANTHER_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ +#ifndef HUSARION_UGV_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ +#define HUSARION_UGV_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ #include #include @@ -26,7 +26,7 @@ #include "behaviortree_cpp/utils/shared_library.h" #include "behaviortree_ros2/plugins.hpp" -namespace panther_manager::behavior_tree_utils +namespace husarion_ugv_manager::behavior_tree_utils { /** @@ -73,9 +73,9 @@ inline void RegisterBehaviorTree( RegisterBehaviorTree(factory, bt_project_path, plugin_libs); } -} // namespace panther_manager::behavior_tree_utils +} // namespace husarion_ugv_manager::behavior_tree_utils -namespace panther_manager +namespace husarion_ugv_manager { // TODO: @pawelirh move to a separate file with an appropriate abstraction layer /** @@ -88,6 +88,6 @@ inline std::string GetLoggerPrefix(const std::string & bt_node_name) { return std::string("[" + bt_node_name + "] "); } -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ +#endif // HUSARION_UGV_MANAGER_BEHAVIOR_TREE_UTILS_HPP_ diff --git a/panther_manager/include/panther_manager/lights_manager_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/lights_manager_node.hpp similarity index 84% rename from panther_manager/include/panther_manager/lights_manager_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/lights_manager_node.hpp index 21937cd8..6fd54433 100644 --- a/panther_manager/include/panther_manager/lights_manager_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/lights_manager_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_LIGHTS_MANAGER_NODE_HPP_ -#define PANTHER_MANAGER_LIGHTS_MANAGER_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_LIGHTS_MANAGER_NODE_HPP_ +#define HUSARION_UGV_MANAGER_LIGHTS_MANAGER_NODE_HPP_ #include #include @@ -26,11 +26,11 @@ #include "panther_msgs/msg/led_animation.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -#include +#include -namespace panther_manager +namespace husarion_ugv_manager { using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -77,10 +77,10 @@ class LightsManagerNode : public rclcpp::Node rclcpp::Subscription::SharedPtr e_stop_sub_; rclcpp::TimerBase::SharedPtr lights_tree_timer_; - std::unique_ptr> battery_percent_ma_; + std::unique_ptr> battery_percent_ma_; BT::BehaviorTreeFactory factory_; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_LIGHTS_MANAGER_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_LIGHTS_MANAGER_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/action/call_set_bool_service_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp similarity index 81% rename from panther_manager/include/panther_manager/plugins/action/call_set_bool_service_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp index adafe1d4..f9bfae2e 100644 --- a/panther_manager/include/panther_manager/plugins/action/call_set_bool_service_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ #include @@ -22,7 +22,7 @@ #include "std_srvs/srv/set_bool.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class CallSetBoolService : public BT::RosServiceNode @@ -43,6 +43,6 @@ class CallSetBoolService : public BT::RosServiceNode virtual BT::NodeStatus onResponseReceived(const typename Response::SharedPtr & response) override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_SET_BOOL_SERVICE_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/action/call_set_led_animation_service_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp similarity index 82% rename from panther_manager/include/panther_manager/plugins/action/call_set_led_animation_service_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp index 38a915a5..4fa2f8f8 100644 --- a/panther_manager/include/panther_manager/plugins/action/call_set_led_animation_service_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_ACTION_CALL_SET_LED_ANIMATION_SERVICE_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_ACTION_CALL_SET_LED_ANIMATION_SERVICE_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_SET_LED_ANIMATION_SERVICE_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_SET_LED_ANIMATION_SERVICE_NODE_HPP_ #include @@ -22,7 +22,7 @@ #include "panther_msgs/srv/set_led_animation.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class CallSetLedAnimationService : public BT::RosServiceNode @@ -47,6 +47,6 @@ class CallSetLedAnimationService : public BT::RosServiceNode @@ -22,7 +22,7 @@ #include "std_srvs/srv/trigger.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class CallTriggerService : public BT::RosServiceNode @@ -40,6 +40,6 @@ class CallTriggerService : public BT::RosServiceNode virtual BT::NodeStatus onResponseReceived(const typename Response::SharedPtr & response) override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_ACTION_CALL_TRIGGER_SERVICE_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_ACTION_CALL_TRIGGER_SERVICE_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp similarity index 71% rename from panther_manager/include/panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp index 949565f6..10396a8c 100644 --- a/panther_manager/include/panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ #include #include @@ -22,11 +22,11 @@ #include "behaviortree_cpp/basic_types.h" #include "yaml-cpp/yaml.h" -#include "panther_manager/plugins/shutdown_host.hpp" -#include "panther_manager/plugins/shutdown_hosts_node.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/plugins/shutdown_hosts_node.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class ShutdownHostsFromFile : public ShutdownHosts @@ -49,6 +49,6 @@ class ShutdownHostsFromFile : public ShutdownHosts bool UpdateHosts(std::vector> & hosts) override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_HOST_FROM_FILE_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/action/shutdown_single_host_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp similarity index 78% rename from panther_manager/include/panther_manager/plugins/action/shutdown_single_host_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp index 630db650..be36a7f9 100644 --- a/panther_manager/include/panther_manager/plugins/action/shutdown_single_host_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ #include #include @@ -21,10 +21,10 @@ #include "behaviortree_cpp/basic_types.h" -#include "panther_manager/plugins/shutdown_host.hpp" -#include "panther_manager/plugins/shutdown_hosts_node.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/plugins/shutdown_hosts_node.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class ShutdownSingleHost : public ShutdownHosts @@ -52,6 +52,6 @@ class ShutdownSingleHost : public ShutdownHosts bool UpdateHosts(std::vector> & hosts) override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_ACTION_SHUTDOWN_SINGLE_HOST_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/action/signal_shutdown_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp similarity index 79% rename from panther_manager/include/panther_manager/plugins/action/signal_shutdown_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp index 7bc9709d..8e98387e 100644 --- a/panther_manager/include/panther_manager/plugins/action/signal_shutdown_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ #include @@ -21,7 +21,7 @@ #include "behaviortree_cpp/basic_types.h" #include "behaviortree_cpp/tree_node.h" -namespace panther_manager +namespace husarion_ugv_manager { class SignalShutdown : public BT::SyncActionNode @@ -42,6 +42,6 @@ class SignalShutdown : public BT::SyncActionNode virtual BT::NodeStatus tick() override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_ACTION_SIGNAL_SHUTDOWN_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/decorator/tick_after_timeout_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp similarity index 80% rename from panther_manager/include/panther_manager/plugins/decorator/tick_after_timeout_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp index 20a273e5..a453054f 100644 --- a/panther_manager/include/panther_manager/plugins/decorator/tick_after_timeout_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ #include #include @@ -22,7 +22,7 @@ #include "behaviortree_cpp/decorator_node.h" #include "behaviortree_cpp/tree_node.h" -namespace panther_manager +namespace husarion_ugv_manager { class TickAfterTimeout : public BT::DecoratorNode { @@ -40,6 +40,6 @@ class TickAfterTimeout : public BT::DecoratorNode BT::NodeStatus tick() override; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_DECORATOR_TICK_AFTER_TIMEOUT_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/shutdown_host.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_host.hpp similarity index 96% rename from panther_manager/include/panther_manager/plugins/shutdown_host.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_host.hpp index ce29367a..6f4729ba 100644 --- a/panther_manager/include/panther_manager/plugins/shutdown_host.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_host.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ -#define PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ #include #include @@ -25,7 +25,7 @@ #include "libssh/libsshpp.hpp" -namespace panther_manager +namespace husarion_ugv_manager { enum class ShutdownHostState { @@ -268,6 +268,6 @@ class ShutdownHost } }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOST_HPP_ diff --git a/panther_manager/include/panther_manager/plugins/shutdown_hosts_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_hosts_node.hpp similarity index 93% rename from panther_manager/include/panther_manager/plugins/shutdown_hosts_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_hosts_node.hpp index 004c94a4..5c7b11ad 100644 --- a/panther_manager/include/panther_manager/plugins/shutdown_hosts_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/plugins/shutdown_hosts_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ -#define PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ +#define HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ #include #include @@ -29,11 +29,11 @@ #include "behaviortree_cpp/tree_node.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" -#include "panther_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" -namespace panther_manager +namespace husarion_ugv_manager { class ShutdownHosts : public BT::StatefulActionNode @@ -177,6 +177,6 @@ class ShutdownHosts : public BT::StatefulActionNode } }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_PLUGINS_SHUTDOWN_HOSTS_NODE_HPP_ diff --git a/panther_manager/include/panther_manager/safety_manager_node.hpp b/husarion_ugv_manager/include/husarion_ugv_manager/safety_manager_node.hpp similarity index 84% rename from panther_manager/include/panther_manager/safety_manager_node.hpp rename to husarion_ugv_manager/include/husarion_ugv_manager/safety_manager_node.hpp index cde19e96..51dcb3e2 100644 --- a/panther_manager/include/panther_manager/safety_manager_node.hpp +++ b/husarion_ugv_manager/include/husarion_ugv_manager/safety_manager_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_SAFETY_MANAGER_NODE_HPP_ -#define PANTHER_MANAGER_SAFETY_MANAGER_NODE_HPP_ +#ifndef HUSARION_UGV_MANAGER_SAFETY_MANAGER_NODE_HPP_ +#define HUSARION_UGV_MANAGER_SAFETY_MANAGER_NODE_HPP_ #include #include @@ -29,11 +29,11 @@ #include "panther_msgs/msg/robot_driver_state.hpp" #include "panther_msgs/msg/system_status.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -#include +#include -namespace panther_manager +namespace husarion_ugv_manager { using BatteryStateMsg = sensor_msgs::msg::BatteryState; @@ -96,12 +96,12 @@ class SafetyManagerNode : public rclcpp::Node rclcpp::Subscription::SharedPtr system_status_sub_; rclcpp::TimerBase::SharedPtr safety_tree_timer_; - std::unique_ptr> battery_temp_ma_; - std::unique_ptr> cpu_temp_ma_; + std::unique_ptr> battery_temp_ma_; + std::unique_ptr> cpu_temp_ma_; - std::map>> driver_temp_ma_; + std::map>> driver_temp_ma_; }; -} // namespace panther_manager +} // namespace husarion_ugv_manager -#endif // PANTHER_MANAGER_SAFETY_MANAGER_NODE_HPP_ +#endif // HUSARION_UGV_MANAGER_SAFETY_MANAGER_NODE_HPP_ diff --git a/panther_manager/launch/manager.launch.py b/husarion_ugv_manager/launch/manager.launch.py similarity index 86% rename from panther_manager/launch/manager.launch.py rename to husarion_ugv_manager/launch/manager.launch.py index 0aaf5385..9b44bf23 100644 --- a/panther_manager/launch/manager.launch.py +++ b/husarion_ugv_manager/launch/manager.launch.py @@ -28,13 +28,13 @@ def generate_launch_description(): - panther_manager_dir = FindPackageShare("panther_manager") + husarion_ugv_manager_dir = FindPackageShare("husarion_ugv_manager") lights_bt_project_path = LaunchConfiguration("lights_bt_project_path") declare_lights_bt_project_path_arg = DeclareLaunchArgument( "lights_bt_project_path", default_value=PathJoinSubstitution( - [panther_manager_dir, "behavior_trees", "PantherLightsBT.btproj"] + [husarion_ugv_manager_dir, "behavior_trees", "PantherLightsBT.btproj"] ), description="Path to BehaviorTree project file, responsible for lights management.", ) @@ -50,7 +50,7 @@ def generate_launch_description(): declare_safety_bt_project_path_arg = DeclareLaunchArgument( "safety_bt_project_path", default_value=PathJoinSubstitution( - [panther_manager_dir, "behavior_trees", "PantherSafetyBT.btproj"] + [husarion_ugv_manager_dir, "behavior_trees", "PantherSafetyBT.btproj"] ), description="Path to BehaviorTree project file, responsible for safety and shutdown management.", ) @@ -60,7 +60,7 @@ def generate_launch_description(): "shutdown_hosts_config_path", default_value=PathJoinSubstitution( [ - FindPackageShare("panther_manager"), + FindPackageShare("husarion_ugv_manager"), "config", "shutdown_hosts.yaml", ] @@ -76,11 +76,11 @@ def generate_launch_description(): ) lights_manager_node = Node( - package="panther_manager", + package="husarion_ugv_manager", executable="lights_manager_node", name="lights_manager", parameters=[ - PathJoinSubstitution([panther_manager_dir, "config", "lights_manager.yaml"]), + PathJoinSubstitution([husarion_ugv_manager_dir, "config", "lights_manager.yaml"]), {"bt_project_path": lights_bt_project_path}, ], namespace=namespace, @@ -88,11 +88,11 @@ def generate_launch_description(): ) safety_manager_node = Node( - package="panther_manager", + package="husarion_ugv_manager", executable="safety_manager_node", name="safety_manager", parameters=[ - PathJoinSubstitution([panther_manager_dir, "config", "safety_manager.yaml"]), + PathJoinSubstitution([husarion_ugv_manager_dir, "config", "safety_manager.yaml"]), { "bt_project_path": safety_bt_project_path, "shutdown_hosts_path": shutdown_hosts_config_path, diff --git a/panther_manager/package.xml b/husarion_ugv_manager/package.xml similarity index 92% rename from panther_manager/package.xml rename to husarion_ugv_manager/package.xml index 8310427d..c36c5adf 100644 --- a/panther_manager/package.xml +++ b/husarion_ugv_manager/package.xml @@ -1,10 +1,10 @@ - panther_manager + husarion_ugv_manager 2.1.1 - Set of nodes used for high level management of Husarion Panther robot + Set of nodes used for high level management of Husarion UGV robots Husarion Apache License 2.0 @@ -19,11 +19,11 @@ behaviortree_cpp behaviortree_ros2 + husarion_ugv_utils iputils-ping libboost-dev libssh-dev panther_msgs - panther_utils rclcpp rclcpp_action std_srvs diff --git a/panther_manager/src/behavior_tree_manager.cpp b/husarion_ugv_manager/src/behavior_tree_manager.cpp similarity index 94% rename from panther_manager/src/behavior_tree_manager.cpp rename to husarion_ugv_manager/src/behavior_tree_manager.cpp index f39a3646..c5beb1a4 100644 --- a/panther_manager/src/behavior_tree_manager.cpp +++ b/husarion_ugv_manager/src/behavior_tree_manager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include #include @@ -24,7 +24,7 @@ #include "behaviortree_cpp/loggers/groot2_publisher.h" #include "rclcpp/rclcpp.hpp" -namespace panther_manager +namespace husarion_ugv_manager { void BehaviorTreeManager::Initialize(BT::BehaviorTreeFactory & factory) @@ -66,4 +66,4 @@ BT::NodeConfig BehaviorTreeManager::CreateBTConfig( return config; } -} // namespace panther_manager +} // namespace husarion_ugv_manager diff --git a/panther_manager/src/lights_manager_node.cpp b/husarion_ugv_manager/src/lights_manager_node.cpp similarity index 94% rename from panther_manager/src/lights_manager_node.cpp rename to husarion_ugv_manager/src/lights_manager_node.cpp index 53ff612b..7601abe7 100644 --- a/panther_manager/src/lights_manager_node.cpp +++ b/husarion_ugv_manager/src/lights_manager_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/lights_manager_node.hpp" +#include "husarion_ugv_manager/lights_manager_node.hpp" #include #include @@ -26,12 +26,12 @@ #include "behaviortree_ros2/ros_node_params.hpp" #include "rclcpp/rclcpp.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -#include -#include +#include +#include -namespace panther_manager +namespace husarion_ugv_manager { LightsManagerNode::LightsManagerNode( @@ -45,7 +45,7 @@ LightsManagerNode::LightsManagerNode( const auto battery_percent_window_len = this->get_parameter("battery.percent.window_len").as_int(); - battery_percent_ma_ = std::make_unique>( + battery_percent_ma_ = std::make_unique>( battery_percent_window_len, 1.0); const auto initial_blackboard = CreateLightsInitialBlackboard(); @@ -81,9 +81,9 @@ void LightsManagerNode::Initialize() void LightsManagerNode::DeclareParameters() { - const auto panther_manager_pkg_path = - ament_index_cpp::get_package_share_directory("panther_manager"); - const std::string default_bt_project_path = panther_manager_pkg_path + + const auto husarion_ugv_manager_pkg_path = + ament_index_cpp::get_package_share_directory("husarion_ugv_manager"); + const std::string default_bt_project_path = husarion_ugv_manager_pkg_path + "/behavior_trees/PantherLightsBT.btproj"; const std::vector default_plugin_libs = {}; @@ -232,4 +232,4 @@ bool LightsManagerNode::SystemReady() return true; } -} // namespace panther_manager +} // namespace husarion_ugv_manager diff --git a/panther_manager/src/lights_manager_node_main.cpp b/husarion_ugv_manager/src/lights_manager_node_main.cpp similarity index 86% rename from panther_manager/src/lights_manager_node_main.cpp rename to husarion_ugv_manager/src/lights_manager_node_main.cpp index 92a2738b..9fbbc3c8 100644 --- a/panther_manager/src/lights_manager_node_main.cpp +++ b/husarion_ugv_manager/src/lights_manager_node_main.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/lights_manager_node.hpp" +#include "husarion_ugv_manager/lights_manager_node.hpp" #include #include @@ -22,7 +22,8 @@ int main(int argc, char ** argv) { rclcpp::init(argc, argv); - auto lights_manager_node = std::make_shared("lights_manager"); + auto lights_manager_node = + std::make_shared("lights_manager"); lights_manager_node->Initialize(); try { diff --git a/panther_manager/src/plugins/action/call_set_bool_service_node.cpp b/husarion_ugv_manager/src/plugins/action/call_set_bool_service_node.cpp similarity index 84% rename from panther_manager/src/plugins/action/call_set_bool_service_node.cpp rename to husarion_ugv_manager/src/plugins/action/call_set_bool_service_node.cpp index 561e2a5f..b51b58b8 100644 --- a/panther_manager/src/plugins/action/call_set_bool_service_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/call_set_bool_service_node.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/call_set_bool_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp" -#include "panther_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" -namespace panther_manager +namespace husarion_ugv_manager { bool CallSetBoolService::setRequest(typename Request::SharedPtr & request) @@ -42,7 +42,7 @@ BT::NodeStatus CallSetBoolService::onResponseReceived(const typename Response::S return BT::NodeStatus::SUCCESS; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_ros2/plugins.hpp" -CreateRosNodePlugin(panther_manager::CallSetBoolService, "CallSetBoolService"); +CreateRosNodePlugin(husarion_ugv_manager::CallSetBoolService, "CallSetBoolService"); diff --git a/panther_manager/src/plugins/action/call_set_led_animation_service_node.cpp b/husarion_ugv_manager/src/plugins/action/call_set_led_animation_service_node.cpp similarity index 86% rename from panther_manager/src/plugins/action/call_set_led_animation_service_node.cpp rename to husarion_ugv_manager/src/plugins/action/call_set_led_animation_service_node.cpp index b0f22dd8..70c07642 100644 --- a/panther_manager/src/plugins/action/call_set_led_animation_service_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/call_set_led_animation_service_node.cpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/call_set_led_animation_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp" #include #include "behaviortree_cpp/basic_types.h" -#include "panther_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" -namespace panther_manager +namespace husarion_ugv_manager { bool CallSetLedAnimationService::setRequest(typename Request::SharedPtr & request) @@ -62,7 +62,7 @@ BT::NodeStatus CallSetLedAnimationService::onResponseReceived( return BT::NodeStatus::SUCCESS; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_ros2/plugins.hpp" -CreateRosNodePlugin(panther_manager::CallSetLedAnimationService, "CallSetLedAnimationService"); +CreateRosNodePlugin(husarion_ugv_manager::CallSetLedAnimationService, "CallSetLedAnimationService"); diff --git a/panther_manager/src/plugins/action/call_trigger_service_node.cpp b/husarion_ugv_manager/src/plugins/action/call_trigger_service_node.cpp similarity index 83% rename from panther_manager/src/plugins/action/call_trigger_service_node.cpp rename to husarion_ugv_manager/src/plugins/action/call_trigger_service_node.cpp index e24b8463..73c70856 100644 --- a/panther_manager/src/plugins/action/call_trigger_service_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/call_trigger_service_node.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/call_trigger_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_trigger_service_node.hpp" #include "behaviortree_cpp/basic_types.h" -#include "panther_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" -namespace panther_manager +namespace husarion_ugv_manager { bool CallTriggerService::setRequest(typename Request::SharedPtr & /*request*/) { return true; } @@ -37,7 +37,7 @@ BT::NodeStatus CallTriggerService::onResponseReceived(const typename Response::S return BT::NodeStatus::SUCCESS; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_ros2/plugins.hpp" -CreateRosNodePlugin(panther_manager::CallTriggerService, "CallTriggerService"); +CreateRosNodePlugin(husarion_ugv_manager::CallTriggerService, "CallTriggerService"); diff --git a/panther_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp b/husarion_ugv_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp similarity index 71% rename from panther_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp rename to husarion_ugv_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp index 270c67a5..a8dcfb38 100644 --- a/panther_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/shutdown_hosts_from_file_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp" #include #include @@ -24,10 +24,10 @@ #include "behaviortree_cpp/tree_node.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/behavior_tree_utils.hpp" -#include "panther_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" -namespace panther_manager +namespace husarion_ugv_manager { bool ShutdownHostsFromFile::UpdateHosts(std::vector> & hosts) @@ -59,13 +59,13 @@ bool ShutdownHostsFromFile::UpdateHosts(std::vector(host, "ip"); - const auto username = panther_utils::GetYAMLKeyValue(host, "username"); - const auto port = panther_utils::GetYAMLKeyValue(host, "port", 22); - const auto command = panther_utils::GetYAMLKeyValue( + const auto ip = husarion_ugv_utils::GetYAMLKeyValue(host, "ip"); + const auto username = husarion_ugv_utils::GetYAMLKeyValue(host, "username"); + const auto port = husarion_ugv_utils::GetYAMLKeyValue(host, "port", 22); + const auto command = husarion_ugv_utils::GetYAMLKeyValue( host, "command", "sudo shutdown now"); - const auto timeout = panther_utils::GetYAMLKeyValue(host, "timeout", 5.0); - const auto ping_for_success = panther_utils::GetYAMLKeyValue( + const auto timeout = husarion_ugv_utils::GetYAMLKeyValue(host, "timeout", 5.0); + const auto ping_for_success = husarion_ugv_utils::GetYAMLKeyValue( host, "ping_for_success", true); hosts.push_back( std::make_shared(ip, username, port, command, timeout, ping_for_success)); @@ -77,10 +77,10 @@ bool ShutdownHostsFromFile::UpdateHosts(std::vector("ShutdownHostsFromFile"); + factory.registerNodeType("ShutdownHostsFromFile"); } diff --git a/panther_manager/src/plugins/action/shutdown_single_host_node.cpp b/husarion_ugv_manager/src/plugins/action/shutdown_single_host_node.cpp similarity index 86% rename from panther_manager/src/plugins/action/shutdown_single_host_node.cpp rename to husarion_ugv_manager/src/plugins/action/shutdown_single_host_node.cpp index 5c4f7eae..a2dbabb9 100644 --- a/panther_manager/src/plugins/action/shutdown_single_host_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/shutdown_single_host_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/shutdown_single_host_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp" #include #include @@ -21,10 +21,10 @@ #include "behaviortree_cpp/exceptions.h" #include "behaviortree_cpp/tree_node.h" -#include "panther_manager/behavior_tree_utils.hpp" -#include "panther_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" -namespace panther_manager +namespace husarion_ugv_manager { bool ShutdownSingleHost::UpdateHosts(std::vector> & hosts) @@ -71,10 +71,10 @@ bool ShutdownSingleHost::UpdateHosts(std::vector> return true; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_cpp/bt_factory.h" BT_REGISTER_NODES(factory) { - factory.registerNodeType("ShutdownSingleHost"); + factory.registerNodeType("ShutdownSingleHost"); } diff --git a/panther_manager/src/plugins/action/signal_shutdown_node.cpp b/husarion_ugv_manager/src/plugins/action/signal_shutdown_node.cpp similarity index 83% rename from panther_manager/src/plugins/action/signal_shutdown_node.cpp rename to husarion_ugv_manager/src/plugins/action/signal_shutdown_node.cpp index 8d674def..d9a5fd02 100644 --- a/panther_manager/src/plugins/action/signal_shutdown_node.cpp +++ b/husarion_ugv_manager/src/plugins/action/signal_shutdown_node.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/action/signal_shutdown_node.hpp" +#include "husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp" #include #include #include "behaviortree_cpp/basic_types.h" -namespace panther_manager +namespace husarion_ugv_manager { BT::NodeStatus SignalShutdown::tick() @@ -34,10 +34,10 @@ BT::NodeStatus SignalShutdown::tick() return BT::NodeStatus::SUCCESS; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_cpp/bt_factory.h" BT_REGISTER_NODES(factory) { - factory.registerNodeType("SignalShutdown"); + factory.registerNodeType("SignalShutdown"); } diff --git a/panther_manager/src/plugins/decorator/tick_after_timeout_node.cpp b/husarion_ugv_manager/src/plugins/decorator/tick_after_timeout_node.cpp similarity index 87% rename from panther_manager/src/plugins/decorator/tick_after_timeout_node.cpp rename to husarion_ugv_manager/src/plugins/decorator/tick_after_timeout_node.cpp index 8a746ec3..e89ebb9a 100644 --- a/panther_manager/src/plugins/decorator/tick_after_timeout_node.cpp +++ b/husarion_ugv_manager/src/plugins/decorator/tick_after_timeout_node.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/plugins/decorator/tick_after_timeout_node.hpp" +#include "husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp" -namespace panther_manager +namespace husarion_ugv_manager { TickAfterTimeout::TickAfterTimeout(const std::string & name, const BT::NodeConfig & conf) @@ -53,10 +53,10 @@ BT::NodeStatus TickAfterTimeout::tick() return child_status; } -} // namespace panther_manager +} // namespace husarion_ugv_manager #include "behaviortree_cpp/bt_factory.h" BT_REGISTER_NODES(factory) { - factory.registerNodeType("TickAfterTimeout"); + factory.registerNodeType("TickAfterTimeout"); } diff --git a/panther_manager/src/safety_manager_node.cpp b/husarion_ugv_manager/src/safety_manager_node.cpp similarity index 94% rename from panther_manager/src/safety_manager_node.cpp rename to husarion_ugv_manager/src/safety_manager_node.cpp index b0500684..424724c3 100644 --- a/panther_manager/src/safety_manager_node.cpp +++ b/husarion_ugv_manager/src/safety_manager_node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/safety_manager_node.hpp" +#include "husarion_ugv_manager/safety_manager_node.hpp" #include #include @@ -28,12 +28,12 @@ #include "behaviortree_ros2/ros_node_params.hpp" #include "rclcpp/rclcpp.hpp" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" -#include -#include +#include +#include -namespace panther_manager +namespace husarion_ugv_manager { SafetyManagerNode::SafetyManagerNode( @@ -48,8 +48,8 @@ SafetyManagerNode::SafetyManagerNode( const auto cpu_temp_window_len = this->get_parameter("cpu.temp.window_len").as_int(); battery_temp_ma_ = - std::make_unique>(battery_temp_window_len); - cpu_temp_ma_ = std::make_unique>(cpu_temp_window_len); + std::make_unique>(battery_temp_window_len); + cpu_temp_ma_ = std::make_unique>(cpu_temp_window_len); const auto safety_initial_blackboard = CreateSafetyInitialBlackboard(); safety_tree_manager_ = std::make_unique( @@ -108,9 +108,9 @@ void SafetyManagerNode::Initialize() void SafetyManagerNode::DeclareParameters() { - const auto panther_manager_pkg_path = - ament_index_cpp::get_package_share_directory("panther_manager"); - const std::string default_bt_project_path = panther_manager_pkg_path + + const auto husarion_ugv_manager_pkg_path = + ament_index_cpp::get_package_share_directory("husarion_ugv_manager"); + const std::string default_bt_project_path = husarion_ugv_manager_pkg_path + "/behavior_trees/PantherSafetyBT.btproj"; const std::vector default_plugin_libs = {}; @@ -223,7 +223,7 @@ void SafetyManagerNode::RobotDriverStateCB(const RobotDriverStateMsg::SharedPtr this->get_logger(), "Creating moving average for driver '%s'", driver.name.c_str()); const auto driver_temp_window_len = this->get_parameter("driver.temp.window_len").as_int(); driver_temp_ma_[driver.name] = - std::make_unique>(driver_temp_window_len); + std::make_unique>(driver_temp_window_len); } driver_temp_ma_[driver.name]->Roll(driver.state.temperature); @@ -322,4 +322,4 @@ void SafetyManagerNode::ShutdownRobot(const std::string & reason) rclcpp::shutdown(); } -} // namespace panther_manager +} // namespace husarion_ugv_manager diff --git a/panther_manager/src/safety_manager_node_main.cpp b/husarion_ugv_manager/src/safety_manager_node_main.cpp similarity index 86% rename from panther_manager/src/safety_manager_node_main.cpp rename to husarion_ugv_manager/src/safety_manager_node_main.cpp index 3ad34404..68486c86 100644 --- a/panther_manager/src/safety_manager_node_main.cpp +++ b/husarion_ugv_manager/src/safety_manager_node_main.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "panther_manager/safety_manager_node.hpp" +#include "husarion_ugv_manager/safety_manager_node.hpp" #include #include @@ -22,7 +22,8 @@ int main(int argc, char ** argv) { rclcpp::init(argc, argv); - auto safety_manager_node = std::make_shared("safety_manager"); + auto safety_manager_node = + std::make_shared("safety_manager"); safety_manager_node->Initialize(); try { diff --git a/panther_manager/test/plugins/action/test_call_set_bool_service_node.cpp b/husarion_ugv_manager/test/plugins/action/test_call_set_bool_service_node.cpp similarity index 85% rename from panther_manager/test/plugins/action/test_call_set_bool_service_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_call_set_bool_service_node.cpp index c9526698..e359bc59 100644 --- a/panther_manager/test/plugins/action/test_call_set_bool_service_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_call_set_bool_service_node.cpp @@ -20,10 +20,10 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/call_set_bool_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp" #include "utils/plugin_test_utils.hpp" -class TestCallSetBoolService : public panther_manager::plugin_test_utils::PluginTestUtils +class TestCallSetBoolService : public husarion_ugv_manager::plugin_test_utils::PluginTestUtils { public: void ServiceCallback( @@ -47,7 +47,7 @@ TEST_F(TestCallSetBoolService, GoodLoadingCallSetBoolServicePlugin) { std::map service = {{"service_name", "set_bool"}, {"data", "true"}}; - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); ASSERT_NO_THROW({ CreateTree("CallSetBoolService", service); }); } @@ -56,7 +56,7 @@ TEST_F(TestCallSetBoolService, WrongPluginNameLoadingCallSetBoolServicePlugin) { std::map service = {{"service_name", "set_bool"}, {"data", "true"}}; - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); EXPECT_THROW({ CreateTree("WrongCallSetBoolService", service); }, BT::RuntimeError); } @@ -65,7 +65,7 @@ TEST_F(TestCallSetBoolService, WrongCallSetBoolServiceServiceServerNotInitialize { std::map service = {{"service_name", "set_bool"}, {"data", "true"}}; - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); CreateTree("CallSetBoolService", service); @@ -86,7 +86,7 @@ TEST_F(TestCallSetBoolService, GoodSetBoolCallServiceSuccessWithTrueValue) ServiceCallback(request, response, true, true); }); - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); CreateTree("CallSetBoolService", service); auto & tree = GetTree(); @@ -106,7 +106,7 @@ TEST_F(TestCallSetBoolService, GoodSetBoolCallServiceSuccessWithFalseValue) ServiceCallback(request, response, true, false); }); - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); CreateTree("CallSetBoolService", service); auto & tree = GetTree(); @@ -126,7 +126,7 @@ TEST_F(TestCallSetBoolService, WrongSetBoolCallServiceFailure) ServiceCallback(request, response, false, false); }); - RegisterNodeWithParams("CallSetBoolService"); + RegisterNodeWithParams("CallSetBoolService"); CreateTree("CallSetBoolService", service); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp b/husarion_ugv_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp similarity index 86% rename from panther_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp index d44ff4ec..1708ef7d 100644 --- a/panther_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_call_set_led_animation_service_node.cpp @@ -20,10 +20,11 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/call_set_led_animation_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp" #include "utils/plugin_test_utils.hpp" -class TestCallSetLedAnimationService : public panther_manager::plugin_test_utils::PluginTestUtils +class TestCallSetLedAnimationService +: public husarion_ugv_manager::plugin_test_utils::PluginTestUtils { public: void ServiceCallback( @@ -54,7 +55,8 @@ TEST_F(TestCallSetLedAnimationService, GoodLoadingCallSetLedAnimationServicePlug std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); ASSERT_NO_THROW({ CreateTree("CallSetLedAnimationService", service); }); } @@ -64,7 +66,8 @@ TEST_F(TestCallSetLedAnimationService, WrongPluginNameLoadingCallSetLedAnimation std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); EXPECT_THROW({ CreateTree("WrongCallSetLedAnimationService", service); }, BT::RuntimeError); } @@ -74,7 +77,8 @@ TEST_F(TestCallSetLedAnimationService, WrongCallSetLedAnimationServiceServiceSer std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); CreateTree("CallSetLedAnimationService", service); auto & tree = GetTree(); @@ -88,7 +92,8 @@ TEST_F(TestCallSetLedAnimationService, GoodSetLedAnimationCallServiceSuccessWith std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); CreateTree("CallSetLedAnimationService", service); auto & tree = GetTree(); @@ -110,7 +115,8 @@ TEST_F(TestCallSetLedAnimationService, GoodSetLedAnimationCallServiceSuccessWith std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "false"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); CreateTree("CallSetLedAnimationService", service); auto & tree = GetTree(); @@ -132,7 +138,8 @@ TEST_F(TestCallSetLedAnimationService, GoodSetLedAnimationCallServiceSuccessWith std::map service = { {"service_name", "set_led_animation"}, {"id", "5"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); CreateTree("CallSetLedAnimationService", service); auto & tree = GetTree(); @@ -154,7 +161,8 @@ TEST_F(TestCallSetLedAnimationService, WrongSetLedAnimationCallServiceFailure) std::map service = { {"service_name", "set_led_animation"}, {"id", "0"}, {"param", ""}, {"repeating", "true"}}; - RegisterNodeWithParams("CallSetLedAnimationService"); + RegisterNodeWithParams( + "CallSetLedAnimationService"); CreateTree("CallSetLedAnimationService", service); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/action/test_call_trigger_service_node.cpp b/husarion_ugv_manager/test/plugins/action/test_call_trigger_service_node.cpp similarity index 84% rename from panther_manager/test/plugins/action/test_call_trigger_service_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_call_trigger_service_node.cpp index e0aa3050..a130e530 100644 --- a/panther_manager/test/plugins/action/test_call_trigger_service_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_call_trigger_service_node.cpp @@ -21,10 +21,10 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/call_trigger_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_trigger_service_node.hpp" #include "utils/plugin_test_utils.hpp" -class TestCallTriggerService : public panther_manager::plugin_test_utils::PluginTestUtils +class TestCallTriggerService : public husarion_ugv_manager::plugin_test_utils::PluginTestUtils { public: void ServiceCallback( @@ -45,7 +45,7 @@ TEST_F(TestCallTriggerService, GoodLoadingCallTriggerServicePlugin) { std::map service = {{"service_name", "trigger"}}; - RegisterNodeWithParams("CallTriggerService"); + RegisterNodeWithParams("CallTriggerService"); ASSERT_NO_THROW({ CreateTree("CallTriggerService", service); }); } @@ -54,7 +54,7 @@ TEST_F(TestCallTriggerService, WrongPluginNameLoadingCallTriggerServicePlugin) { std::map service = {{"service_name", "trigger"}}; - RegisterNodeWithParams("CallTriggerService"); + RegisterNodeWithParams("CallTriggerService"); EXPECT_THROW({ CreateTree("WrongCallTriggerService", service); }, BT::RuntimeError); } @@ -63,7 +63,7 @@ TEST_F(TestCallTriggerService, WrongCallTriggerServiceServiceServerNotInitialize { std::map service = {{"service_name", "trigger"}}; - RegisterNodeWithParams("CallTriggerService"); + RegisterNodeWithParams("CallTriggerService"); CreateTree("CallTriggerService", service); auto & tree = GetTree(); @@ -76,7 +76,7 @@ TEST_F(TestCallTriggerService, GoodTriggerCallServiceSuccess) { std::map service = {{"service_name", "trigger"}}; - RegisterNodeWithParams("CallTriggerService"); + RegisterNodeWithParams("CallTriggerService"); CreateTree("CallTriggerService", service); auto & tree = GetTree(); @@ -97,7 +97,7 @@ TEST_F(TestCallTriggerService, WrongTriggerCallServiceFailure) { std::map service = {{"service_name", "trigger"}}; - RegisterNodeWithParams("CallTriggerService"); + RegisterNodeWithParams("CallTriggerService"); CreateTree("CallTriggerService", service); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp b/husarion_ugv_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp similarity index 77% rename from panther_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp index edece3f6..980f9e0a 100644 --- a/panther_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_shutdown_hosts_from_file_node.cpp @@ -22,16 +22,16 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp" #include "utils/plugin_test_utils.hpp" -typedef panther_manager::plugin_test_utils::PluginTestUtils TestShutdownHostsFromFile; +typedef husarion_ugv_manager::plugin_test_utils::PluginTestUtils TestShutdownHostsFromFile; TEST_F(TestShutdownHostsFromFile, GoodLoadingShutdownHostsFromFilePlugin) { const std::map service = {{"shutdown_hosts_file", "dummy_file"}}; - RegisterNodeWithoutParams("ShutdownHostsFromFile"); + RegisterNodeWithoutParams("ShutdownHostsFromFile"); ASSERT_NO_THROW({ CreateTree("ShutdownHostsFromFile", service); }); } @@ -40,7 +40,7 @@ TEST_F(TestShutdownHostsFromFile, WrongPluginNameLoadingShutdownHostsFromFilePlu { const std::map service = {{"shutdown_hosts_file", "dummy_file"}}; - RegisterNodeWithoutParams("ShutdownHostsFromFile"); + RegisterNodeWithoutParams("ShutdownHostsFromFile"); EXPECT_THROW({ CreateTree("WrongShutdownHostsFromFile", service); }, BT::RuntimeError); } @@ -48,10 +48,11 @@ TEST_F(TestShutdownHostsFromFile, WrongPluginNameLoadingShutdownHostsFromFilePlu TEST_F(TestShutdownHostsFromFile, WrongCannotFindFileShutdownHostsFromFile) { const std::string file_path = - testing::TempDir() + "test_panther_manager_wrong_cannot_find_file_shutdown_hosts_from_file"; + testing::TempDir() + + "test_husarion_ugv_manager_wrong_cannot_find_file_shutdown_hosts_from_file"; const std::map service = {{"shutdown_hosts_file", file_path}}; - RegisterNodeWithoutParams("ShutdownHostsFromFile"); + RegisterNodeWithoutParams("ShutdownHostsFromFile"); CreateTree("ShutdownHostsFromFile", service); auto & tree = GetTree(); @@ -62,10 +63,10 @@ TEST_F(TestShutdownHostsFromFile, WrongCannotFindFileShutdownHostsFromFile) TEST_F(TestShutdownHostsFromFile, GoodShutdownHostsFromFile) { - const std::string config_file_path = testing::TempDir() + - "test_panther_manager_good_shutdown_hosts_from_file_config"; + const std::string config_file_path = + testing::TempDir() + "test_husarion_ugv_manager_good_shutdown_hosts_from_file_config"; const std::string test_file_path = testing::TempDir() + - "test_panther_manager_good_shutdown_hosts_from_file"; + "test_husarion_ugv_manager_good_shutdown_hosts_from_file"; std::filesystem::remove(test_file_path); std::filesystem::remove(config_file_path); @@ -89,7 +90,7 @@ TEST_F(TestShutdownHostsFromFile, GoodShutdownHostsFromFile) config_file.close(); const std::map service = {{"shutdown_hosts_file", config_file_path}}; - RegisterNodeWithoutParams("ShutdownHostsFromFile"); + RegisterNodeWithoutParams("ShutdownHostsFromFile"); auto & tree = GetTree(); CreateTree("ShutdownHostsFromFile", service); diff --git a/panther_manager/test/plugins/action/test_shutdown_single_host_node.cpp b/husarion_ugv_manager/test/plugins/action/test_shutdown_single_host_node.cpp similarity index 81% rename from panther_manager/test/plugins/action/test_shutdown_single_host_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_shutdown_single_host_node.cpp index b174b7dc..5ed922dc 100644 --- a/panther_manager/test/plugins/action/test_shutdown_single_host_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_shutdown_single_host_node.cpp @@ -22,10 +22,10 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/shutdown_single_host_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp" #include "utils/plugin_test_utils.hpp" -typedef panther_manager::plugin_test_utils::PluginTestUtils TestShutdownSingleHost; +typedef husarion_ugv_manager::plugin_test_utils::PluginTestUtils TestShutdownSingleHost; TEST_F(TestShutdownSingleHost, GoodLoadingShutdownSingleHostPlugin) { @@ -34,7 +34,7 @@ TEST_F(TestShutdownSingleHost, GoodLoadingShutdownSingleHostPlugin) {"port", "22"}, {"timeout", "5.0"}, {"username", "husarion"}, }; - RegisterNodeWithoutParams("ShutdownSingleHost"); + RegisterNodeWithoutParams("ShutdownSingleHost"); ASSERT_NO_THROW({ CreateTree("ShutdownSingleHost", service); }); } @@ -46,13 +46,13 @@ TEST_F(TestShutdownSingleHost, WrongPluginNameLoadingShutdownSingleHostPlugin) {"port", "22"}, {"timeout", "5.0"}, {"username", "husarion"}, }; - RegisterNodeWithoutParams("ShutdownSingleHost"); + RegisterNodeWithoutParams("ShutdownSingleHost"); EXPECT_THROW({ CreateTree("WrongShutdownSingleHost", service); }, BT::RuntimeError); } TEST_F(TestShutdownSingleHost, GoodTouchCommand) { - std::string test_file_path = testing::TempDir() + "test_panther_manager_good_touch_command"; + std::string test_file_path = testing::TempDir() + "test_husarion_ugv_manager_good_touch_command"; std::filesystem::remove(test_file_path); EXPECT_FALSE(std::filesystem::exists(test_file_path)); std::map service = { @@ -63,7 +63,7 @@ TEST_F(TestShutdownSingleHost, GoodTouchCommand) {"timeout", "5.0"}, {"username", "husarion"}, }; - RegisterNodeWithoutParams("ShutdownSingleHost"); + RegisterNodeWithoutParams("ShutdownSingleHost"); CreateTree("ShutdownSingleHost", service); auto & tree = GetTree(); @@ -80,7 +80,7 @@ TEST_F(TestShutdownSingleHost, Timeout) {"command", "sleep 0.5"}, {"ip", "localhost"}, {"ping_for_success", "false"}, {"port", "22"}, {"timeout", "0.1"}, {"username", "husarion"}, }; - RegisterNodeWithoutParams("ShutdownSingleHost"); + RegisterNodeWithoutParams("ShutdownSingleHost"); CreateTree("ShutdownSingleHost", service); auto & tree = GetTree(); @@ -98,7 +98,7 @@ TEST_F(TestShutdownSingleHost, WrongUser) {"timeout", "0.2"}, {"username", "wrong_user"}, }; - RegisterNodeWithoutParams("ShutdownSingleHost"); + RegisterNodeWithoutParams("ShutdownSingleHost"); CreateTree("ShutdownSingleHost", service); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/action/test_signal_shutdown_node.cpp b/husarion_ugv_manager/test/plugins/action/test_signal_shutdown_node.cpp similarity index 85% rename from panther_manager/test/plugins/action/test_signal_shutdown_node.cpp rename to husarion_ugv_manager/test/plugins/action/test_signal_shutdown_node.cpp index 9fd109c2..3b0a383b 100644 --- a/panther_manager/test/plugins/action/test_signal_shutdown_node.cpp +++ b/husarion_ugv_manager/test/plugins/action/test_signal_shutdown_node.cpp @@ -21,16 +21,16 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/action/signal_shutdown_node.hpp" +#include "husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp" #include "utils/plugin_test_utils.hpp" -typedef panther_manager::plugin_test_utils::PluginTestUtils TestSignalShutdown; +typedef husarion_ugv_manager::plugin_test_utils::PluginTestUtils TestSignalShutdown; TEST_F(TestSignalShutdown, GoodLoadingSignalShutdownPlugin) { std::map service = {{"reason", "Test shutdown."}}; - RegisterNodeWithoutParams("SignalShutdown"); + RegisterNodeWithoutParams("SignalShutdown"); ASSERT_NO_THROW({ CreateTree("SignalShutdown", service); }); } @@ -46,7 +46,7 @@ TEST_F(TestSignalShutdown, GoodCheckReasonBlackboardValue) { std::map service = {{"reason", "Test shutdown."}}; - RegisterNodeWithoutParams("SignalShutdown"); + RegisterNodeWithoutParams("SignalShutdown"); CreateTree("SignalShutdown", service); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp b/husarion_ugv_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp similarity index 89% rename from panther_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp rename to husarion_ugv_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp index deba7db9..fb2eca46 100644 --- a/panther_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp +++ b/husarion_ugv_manager/test/plugins/decorator/test_tick_after_timeout_node.cpp @@ -21,10 +21,10 @@ #include "behaviortree_cpp/bt_factory.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/plugins/decorator/tick_after_timeout_node.hpp" +#include "husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp" #include "utils/plugin_test_utils.hpp" -class TestTickAfterTimeout : public panther_manager::plugin_test_utils::PluginTestUtils +class TestTickAfterTimeout : public husarion_ugv_manager::plugin_test_utils::PluginTestUtils { public: virtual std::string BuildBehaviorTree( @@ -51,7 +51,7 @@ std::string TestTickAfterTimeout::BuildBehaviorTree( TEST_F(TestTickAfterTimeout, GoodTickAfterTimeout) { - RegisterNodeWithoutParams("TickAfterTimeout"); + RegisterNodeWithoutParams("TickAfterTimeout"); CreateTree("", {}); auto & tree = GetTree(); diff --git a/panther_manager/test/plugins/test_shutdown_host.cpp b/husarion_ugv_manager/test/plugins/test_shutdown_host.cpp similarity index 64% rename from panther_manager/test/plugins/test_shutdown_host.cpp rename to husarion_ugv_manager/test/plugins/test_shutdown_host.cpp index 25317ee5..cd48e27d 100644 --- a/panther_manager/test/plugins/test_shutdown_host.cpp +++ b/husarion_ugv_manager/test/plugins/test_shutdown_host.cpp @@ -16,7 +16,7 @@ #include "gtest/gtest.h" -#include "panther_manager/plugins/shutdown_host.hpp" +#include "husarion_ugv_manager/plugins/shutdown_host.hpp" class TestShutdownHost : public testing::Test { @@ -26,18 +26,18 @@ class TestShutdownHost : public testing::Test const float timeout, const bool ping_for_success); bool IsAvailable(); void Call(); - panther_manager::ShutdownHostState GetState() const; + husarion_ugv_manager::ShutdownHostState GetState() const; std::string GetResponse() const; private: - std::unique_ptr shutdown_host; + std::unique_ptr shutdown_host; }; void TestShutdownHost::Create( const std::string ip, const std::string user, const int port, const std::string command, const float timeout, const bool ping_for_success) { - shutdown_host = std::make_unique( + shutdown_host = std::make_unique( ip, user, port, command, timeout, ping_for_success); } @@ -45,7 +45,7 @@ bool TestShutdownHost::IsAvailable() { return shutdown_host->IsAvailable(); } void TestShutdownHost::Call() { shutdown_host->Call(); } -panther_manager::ShutdownHostState TestShutdownHost::GetState() const +husarion_ugv_manager::ShutdownHostState TestShutdownHost::GetState() const { return shutdown_host->GetState(); } @@ -56,7 +56,7 @@ TEST_F(TestShutdownHost, GoodCheckIsAvailable) { Create("127.0.0.1", "husarion", 22, "echo HelloWorld", 0.1, true); EXPECT_TRUE(IsAvailable()); - EXPECT_EQ(GetState(), panther_manager::ShutdownHostState::IDLE); + EXPECT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::IDLE); } TEST_F(TestShutdownHost, WrongCheckIsAvailable) @@ -70,32 +70,32 @@ TEST_F(TestShutdownHost, GoodCommandExecute) Create("127.0.0.1", "husarion", 22, "echo HelloWorld", 0.1, false); ASSERT_TRUE(IsAvailable()); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::IDLE); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::IDLE); Call(); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::COMMAND_EXECUTED); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::COMMAND_EXECUTED); // Wait for response - while (GetState() == panther_manager::ShutdownHostState::COMMAND_EXECUTED) { + while (GetState() == husarion_ugv_manager::ShutdownHostState::COMMAND_EXECUTED) { Call(); } - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::RESPONSE_RECEIVED); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::RESPONSE_RECEIVED); const auto response = GetResponse(); EXPECT_EQ(response, "HelloWorld\n"); Call(); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::PINGING); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::PINGING); Call(); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::SUCCESS); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::SUCCESS); } TEST_F(TestShutdownHost, WrongHostPing) { Create("1.45.23.26", "husarion", 22, "echo HelloWorld", 0.1, true); - EXPECT_EQ(GetState(), panther_manager::ShutdownHostState::IDLE); + EXPECT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::IDLE); Call(); - EXPECT_EQ(GetState(), panther_manager::ShutdownHostState::SKIPPED); + EXPECT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::SKIPPED); } TEST_F(TestShutdownHost, CheckTimeout) @@ -103,14 +103,14 @@ TEST_F(TestShutdownHost, CheckTimeout) Create("127.0.0.1", "husarion", 22, "sleep 0.2", 0.1, false); ASSERT_TRUE(IsAvailable()); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::IDLE); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::IDLE); Call(); - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::COMMAND_EXECUTED); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::COMMAND_EXECUTED); // Wait for response - while (GetState() == panther_manager::ShutdownHostState::COMMAND_EXECUTED) { + while (GetState() == husarion_ugv_manager::ShutdownHostState::COMMAND_EXECUTED) { Call(); } - ASSERT_EQ(GetState(), panther_manager::ShutdownHostState::FAILURE); + ASSERT_EQ(GetState(), husarion_ugv_manager::ShutdownHostState::FAILURE); } int main(int argc, char ** argv) diff --git a/panther_manager/test/plugins/test_shutdown_hosts_node.cpp b/husarion_ugv_manager/test/plugins/test_shutdown_hosts_node.cpp similarity index 63% rename from panther_manager/test/plugins/test_shutdown_hosts_node.cpp rename to husarion_ugv_manager/test/plugins/test_shutdown_hosts_node.cpp index 1395f439..eb797110 100644 --- a/panther_manager/test/plugins/test_shutdown_hosts_node.cpp +++ b/husarion_ugv_manager/test/plugins/test_shutdown_hosts_node.cpp @@ -16,24 +16,26 @@ #include "gtest/gtest.h" -#include "panther_manager/plugins/shutdown_hosts_node.hpp" +#include "husarion_ugv_manager/plugins/shutdown_hosts_node.hpp" -class ShutdownHostsNodeWrapper : public panther_manager::ShutdownHosts +class ShutdownHostsNodeWrapper : public husarion_ugv_manager::ShutdownHosts { public: ShutdownHostsNodeWrapper(const std::string & name, const BT::NodeConfig & conf) - : panther_manager::ShutdownHosts(name, conf) + : husarion_ugv_manager::ShutdownHosts(name, conf) { } - void RemoveDuplicatedHosts(std::vector> & hosts); - std::vector> & GetHosts(); + void RemoveDuplicatedHosts( + std::vector> & hosts); + std::vector> & GetHosts(); BT::NodeStatus onRunning(); BT::NodeStatus onStart(); virtual bool UpdateHosts( - std::vector> & hosts) override final; + std::vector> & hosts) override final; void SetHostsAndSuccess( - std::vector> hosts, const bool returned_status); + std::vector> hosts, + const bool returned_status); static BT::PortsList providedPorts() { @@ -43,40 +45,42 @@ class ShutdownHostsNodeWrapper : public panther_manager::ShutdownHosts } private: - std::vector> hosts_to_set; + std::vector> hosts_to_set; bool update_hosts_success_ = true; }; void ShutdownHostsNodeWrapper::RemoveDuplicatedHosts( - std::vector> & hosts) + std::vector> & hosts) { - panther_manager::ShutdownHosts::RemoveDuplicatedHosts(hosts); + husarion_ugv_manager::ShutdownHosts::RemoveDuplicatedHosts(hosts); } -std::vector> & ShutdownHostsNodeWrapper::GetHosts() +std::vector> & +ShutdownHostsNodeWrapper::GetHosts() { return hosts_; } BT::NodeStatus ShutdownHostsNodeWrapper::onRunning() { - return panther_manager::ShutdownHosts::onRunning(); + return husarion_ugv_manager::ShutdownHosts::onRunning(); } BT::NodeStatus ShutdownHostsNodeWrapper::onStart() { - return panther_manager::ShutdownHosts::onStart(); + return husarion_ugv_manager::ShutdownHosts::onStart(); } bool ShutdownHostsNodeWrapper::UpdateHosts( - std::vector> & hosts) + std::vector> & hosts) { hosts = hosts_to_set; return update_hosts_success_; } void ShutdownHostsNodeWrapper::SetHostsAndSuccess( - std::vector> hosts, const bool returned_status) + std::vector> hosts, + const bool returned_status) { hosts_to_set = hosts; update_hosts_success_ = returned_status; @@ -86,14 +90,14 @@ class ShutdownHostsNodeTest : public testing::Test { public: void CreateWrapper( - std::vector> hosts, const bool success); + std::vector> hosts, const bool success); protected: std::unique_ptr wrapper; }; void ShutdownHostsNodeTest::CreateWrapper( - std::vector> hosts, const bool success) + std::vector> hosts, const bool success) { BT::NodeConfig conf; wrapper = std::make_unique("Duplicated hosts", conf); @@ -103,14 +107,14 @@ void ShutdownHostsNodeTest::CreateWrapper( TEST_F(ShutdownHostsNodeTest, GoodRemovingDuplicatedHosts) { CreateWrapper( - {std::make_shared( + {std::make_shared( "127.0.0.1", "husarion", 22, "echo HelloWorld", 1.0, true), - std::make_shared( + std::make_shared( "localhost", "husarion", 22, "echo HelloWorld", 1.0, true), - std::make_shared( + std::make_shared( "localhost", "husarion", 22, "echo HelloWorld", 1.0, true)}, true); - std::vector> hosts; + std::vector> hosts; ASSERT_TRUE(wrapper->UpdateHosts(hosts)); ASSERT_EQ(hosts.size(), 3); wrapper->RemoveDuplicatedHosts(hosts); @@ -120,7 +124,7 @@ TEST_F(ShutdownHostsNodeTest, GoodRemovingDuplicatedHosts) TEST_F(ShutdownHostsNodeTest, FailedWhenUpdateHostReturnsFalse) { CreateWrapper( - {std::make_shared( + {std::make_shared( "127.0.0.1", "husarion", 22, "echo HelloWorld", 1.0, true)}, false); @@ -139,7 +143,7 @@ TEST_F(ShutdownHostsNodeTest, FailedWhenHostsAreEmpty) TEST_F(ShutdownHostsNodeTest, CheckFailedHosts) { CreateWrapper( - {std::make_shared( + {std::make_shared( "127.0.0.1", "husarion", 22, "echo HelloWorld", 1.0, true)}, true); auto status = wrapper->onStart(); diff --git a/panther_manager/test/test_behavior_tree_manager.cpp b/husarion_ugv_manager/test/test_behavior_tree_manager.cpp similarity index 91% rename from panther_manager/test/test_behavior_tree_manager.cpp rename to husarion_ugv_manager/test/test_behavior_tree_manager.cpp index ca6925e2..80807d0e 100644 --- a/panther_manager/test/test_behavior_tree_manager.cpp +++ b/husarion_ugv_manager/test/test_behavior_tree_manager.cpp @@ -25,10 +25,10 @@ #include "behaviortree_cpp/tree_node.h" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/behavior_tree_manager.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_manager.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" -class BehaviorTreeManagerWrapper : public panther_manager::BehaviorTreeManager +class BehaviorTreeManagerWrapper : public husarion_ugv_manager::BehaviorTreeManager { public: BehaviorTreeManagerWrapper( @@ -69,7 +69,7 @@ TEST_F(TestBehaviorTreeManager, CreateBTConfigInvalidItem) { const std::map bb_values = {{"value", 1l}}; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { behavior_tree_manager_->CreateBTConfig(bb_values); }, "Invalid type for blackboard entry.")); } @@ -109,7 +109,7 @@ TEST_F(TestBehaviorTreeManager, InitializeInvalidTreeName) )"; ASSERT_NO_THROW(factory_.registerBehaviorTreeFromText(tree_xml)); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( [&]() { behavior_tree_manager_->Initialize(factory_); }, "Can't find a tree with name: " + std::string(kTreeName))); } diff --git a/panther_manager/test/test_behavior_tree_utils.cpp b/husarion_ugv_manager/test/test_behavior_tree_utils.cpp similarity index 90% rename from panther_manager/test/test_behavior_tree_utils.cpp rename to husarion_ugv_manager/test/test_behavior_tree_utils.cpp index 75b0cb0a..ac32b59e 100644 --- a/panther_manager/test/test_behavior_tree_utils.cpp +++ b/husarion_ugv_manager/test/test_behavior_tree_utils.cpp @@ -26,8 +26,8 @@ #include "behaviortree_ros2/ros_node_params.hpp" #include "rclcpp/rclcpp.hpp" -#include "panther_manager/behavior_tree_utils.hpp" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_manager/behavior_tree_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" class TestRegisterBT : public testing::Test { @@ -74,7 +74,7 @@ TEST_F(TestRegisterBT, RegisterBehaviorTreeInvalidPlugin) BT::BehaviorTreeFactory factory; EXPECT_THROW( - panther_manager::behavior_tree_utils::RegisterBehaviorTree( + husarion_ugv_manager::behavior_tree_utils::RegisterBehaviorTree( factory, bt_project_path_, {"invalid_bt_node"}), BT::RuntimeError); } @@ -83,7 +83,7 @@ TEST_F(TestRegisterBT, RegisterBehaviorTree) { BT::BehaviorTreeFactory factory; - EXPECT_NO_THROW(panther_manager::behavior_tree_utils::RegisterBehaviorTree( + EXPECT_NO_THROW(husarion_ugv_manager::behavior_tree_utils::RegisterBehaviorTree( factory, bt_project_path_, {"tick_after_timeout_bt_node", "signal_shutdown_bt_node"})); // check if nodes were registered @@ -105,7 +105,7 @@ TEST_F(TestRegisterBT, RegisterBehaviorTreeROS) BT::RosNodeParams params; params.nh = std::make_shared("test_node"); - EXPECT_NO_THROW(panther_manager::behavior_tree_utils::RegisterBehaviorTree( + EXPECT_NO_THROW(husarion_ugv_manager::behavior_tree_utils::RegisterBehaviorTree( factory, bt_project_path_, {}, params, {"call_trigger_service_bt_node", "call_set_bool_service_bt_node"})); diff --git a/panther_manager/test/test_lights_behavior_tree.cpp b/husarion_ugv_manager/test/test_lights_behavior_tree.cpp similarity index 98% rename from panther_manager/test/test_lights_behavior_tree.cpp rename to husarion_ugv_manager/test/test_lights_behavior_tree.cpp index e96bce13..4a9f342d 100644 --- a/panther_manager/test/test_lights_behavior_tree.cpp +++ b/husarion_ugv_manager/test/test_lights_behavior_tree.cpp @@ -31,7 +31,7 @@ #include "panther_msgs/msg/led_animation.hpp" #include "panther_msgs/srv/set_led_animation.hpp" -#include +#include #include using BoolMsg = std_msgs::msg::Bool; @@ -39,7 +39,7 @@ using BatteryStateMsg = sensor_msgs::msg::BatteryState; using SetLEDAnimationSrv = panther_msgs::srv::SetLEDAnimation; using LEDAnimationMsg = panther_msgs::msg::LEDAnimation; -class LightsManagerNodeWrapper : public panther_manager::LightsManagerNode +class LightsManagerNodeWrapper : public husarion_ugv_manager::LightsManagerNode { public: LightsManagerNodeWrapper( diff --git a/panther_manager/test/test_lights_manager_node.cpp b/husarion_ugv_manager/test/test_lights_manager_node.cpp similarity index 94% rename from panther_manager/test/test_lights_manager_node.cpp rename to husarion_ugv_manager/test/test_lights_manager_node.cpp index ea60e529..cb3ef5b0 100644 --- a/panther_manager/test/test_lights_manager_node.cpp +++ b/husarion_ugv_manager/test/test_lights_manager_node.cpp @@ -29,13 +29,13 @@ #include "sensor_msgs/msg/battery_state.hpp" #include "std_msgs/msg/bool.hpp" -#include -#include "panther_utils/test/ros_test_utils.hpp" +#include +#include "husarion_ugv_utils/test/ros_test_utils.hpp" using BoolMsg = std_msgs::msg::Bool; using BatteryStateMsg = sensor_msgs::msg::BatteryState; -class LightsManagerNodeWrapper : public panther_manager::LightsManagerNode +class LightsManagerNodeWrapper : public husarion_ugv_manager::LightsManagerNode { public: LightsManagerNodeWrapper( @@ -146,7 +146,7 @@ TEST_F(TestLightsManagerNode, BatteryCBBlackboardUpdate) battery_state.power_supply_status = expected_status; battery_state.power_supply_health = expected_health; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( lights_manager_node_, "battery/battery_status", battery_state); auto blackboard = lights_manager_node_->GetLightsTreeBlackboard(); @@ -162,7 +162,7 @@ TEST_F(TestLightsManagerNode, EStopCBBlackboardUpdate) auto bool_msg = std_msgs::msg::Bool(); bool_msg.data = expected_state; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( lights_manager_node_, "hardware/e_stop", bool_msg, rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable()); diff --git a/panther_manager/test/test_safety_behavior_tree.cpp b/husarion_ugv_manager/test/test_safety_behavior_tree.cpp similarity index 98% rename from panther_manager/test/test_safety_behavior_tree.cpp rename to husarion_ugv_manager/test/test_safety_behavior_tree.cpp index 50a93343..6f9540bf 100644 --- a/panther_manager/test/test_safety_behavior_tree.cpp +++ b/husarion_ugv_manager/test/test_safety_behavior_tree.cpp @@ -33,7 +33,7 @@ #include "panther_msgs/msg/io_state.hpp" #include "panther_msgs/msg/system_status.hpp" -#include +#include #include using BoolMsg = std_msgs::msg::Bool; @@ -43,7 +43,7 @@ using SystemStatusMsg = panther_msgs::msg::SystemStatus; using SetBoolSrv = std_srvs::srv::SetBool; using TriggerSrv = std_srvs::srv::Trigger; -class SafetyManagerNodeWrapper : public panther_manager::SafetyManagerNode +class SafetyManagerNodeWrapper : public husarion_ugv_manager::SafetyManagerNode { public: SafetyManagerNodeWrapper( diff --git a/panther_manager/test/test_safety_manager_node.cpp b/husarion_ugv_manager/test/test_safety_manager_node.cpp similarity index 94% rename from panther_manager/test/test_safety_manager_node.cpp rename to husarion_ugv_manager/test/test_safety_manager_node.cpp index afd85de9..036ccdfe 100644 --- a/panther_manager/test/test_safety_manager_node.cpp +++ b/husarion_ugv_manager/test/test_safety_manager_node.cpp @@ -29,13 +29,13 @@ #include "sensor_msgs/msg/battery_state.hpp" #include "std_msgs/msg/bool.hpp" -#include -#include "panther_utils/test/ros_test_utils.hpp" +#include +#include "husarion_ugv_utils/test/ros_test_utils.hpp" using BoolMsg = std_msgs::msg::Bool; using BatteryStateMsg = sensor_msgs::msg::BatteryState; -class SafetyManagerNodeWrapper : public panther_manager::SafetyManagerNode +class SafetyManagerNodeWrapper : public husarion_ugv_manager::SafetyManagerNode { public: SafetyManagerNodeWrapper( @@ -167,7 +167,7 @@ TEST_F(TestSafetyManagerNode, BatteryCBBlackboardUpdate) battery_state.power_supply_health = expected_health; battery_state.temperature = expected_temp; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( safety_manager_node_, "battery/battery_status", battery_state); auto blackboard = safety_manager_node_->GetSafetyTreeBlackboard(); @@ -183,7 +183,7 @@ TEST_F(TestSafetyManagerNode, EStopCBBlackboardUpdate) auto bool_msg = std_msgs::msg::Bool(); bool_msg.data = expected_state; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( safety_manager_node_, "hardware/e_stop", bool_msg, transient_local_qos); auto blackboard = safety_manager_node_->GetSafetyTreeBlackboard(); @@ -200,7 +200,7 @@ TEST_F(TestSafetyManagerNode, DriverStateCBBlackboardUpdate) auto driver_state_msg = panther_msgs::msg::RobotDriverState(); driver_state_msg.driver_states.push_back(driver_state); - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( safety_manager_node_, "hardware/robot_driver_state", driver_state_msg); auto blackboard = safety_manager_node_->GetSafetyTreeBlackboard(); @@ -216,7 +216,7 @@ TEST_F(TestSafetyManagerNode, IOStateCBBlackboardUpdate) io_state_msg.aux_power = expected_aux_state; io_state_msg.fan = expected_fan_state; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( safety_manager_node_, "hardware/io_state", io_state_msg, transient_local_qos); auto blackboard = safety_manager_node_->GetSafetyTreeBlackboard(); @@ -231,7 +231,7 @@ TEST_F(TestSafetyManagerNode, SystemStatusCBBlackboardUpdate) auto system_status_msg = panther_msgs::msg::SystemStatus(); system_status_msg.cpu_temp = expected_temp; - panther_utils::test_utils::PublishAndSpin( + husarion_ugv_utils::test_utils::PublishAndSpin( safety_manager_node_, "system_status", system_status_msg); auto blackboard = safety_manager_node_->GetSafetyTreeBlackboard(); diff --git a/panther_manager/test/utils/behavior_tree_test_utils.hpp b/husarion_ugv_manager/test/utils/behavior_tree_test_utils.hpp similarity index 88% rename from panther_manager/test/utils/behavior_tree_test_utils.hpp rename to husarion_ugv_manager/test/utils/behavior_tree_test_utils.hpp index 2a739811..05162ce8 100644 --- a/panther_manager/test/utils/behavior_tree_test_utils.hpp +++ b/husarion_ugv_manager/test/utils/behavior_tree_test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ -#define PANTHER_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ +#define HUSARION_UGV_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ #include #include @@ -57,4 +57,4 @@ bool SpinWhileRunning( } // namespace behavior_tree::test_utils -#endif // PANTHER_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ +#endif // HUSARION_UGV_MANAGER_TEST_UTILS_BEHAVIOR_TREE_TEST_UTILS_HPP_ diff --git a/panther_manager/test/utils/plugin_test_utils.hpp b/husarion_ugv_manager/test/utils/plugin_test_utils.hpp similarity index 80% rename from panther_manager/test/utils/plugin_test_utils.hpp rename to husarion_ugv_manager/test/utils/plugin_test_utils.hpp index 16a4a605..f9d4af87 100644 --- a/panther_manager/test/utils/plugin_test_utils.hpp +++ b/husarion_ugv_manager/test/utils/plugin_test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_MANAGER_PLUGIN_TEST_UTILS_HPP_ -#define PANTHER_MANAGER_PLUGIN_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_MANAGER_PLUGIN_TEST_UTILS_HPP_ +#define HUSARION_UGV_MANAGER_PLUGIN_TEST_UTILS_HPP_ #include #include @@ -32,15 +32,15 @@ #include "panther_msgs/srv/set_led_animation.hpp" -#include "panther_manager/plugins/action/call_set_bool_service_node.hpp" -#include "panther_manager/plugins/action/call_set_led_animation_service_node.hpp" -#include "panther_manager/plugins/action/call_trigger_service_node.hpp" -#include "panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp" -#include "panther_manager/plugins/action/shutdown_single_host_node.hpp" -#include "panther_manager/plugins/action/signal_shutdown_node.hpp" -#include "panther_manager/plugins/decorator/tick_after_timeout_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_bool_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_set_led_animation_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/call_trigger_service_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_hosts_from_file_node.hpp" +#include "husarion_ugv_manager/plugins/action/shutdown_single_host_node.hpp" +#include "husarion_ugv_manager/plugins/action/signal_shutdown_node.hpp" +#include "husarion_ugv_manager/plugins/decorator/tick_after_timeout_node.hpp" -namespace panther_manager::plugin_test_utils +namespace husarion_ugv_manager::plugin_test_utils { struct BehaviorTreePluginDescription @@ -55,7 +55,7 @@ class PluginTestUtils : public testing::Test PluginTestUtils() { rclcpp::init(0, nullptr); - bt_node_ = std::make_shared("test_panther_manager_node"); + bt_node_ = std::make_shared("test_husarion_ugv_manager_node"); } ~PluginTestUtils() @@ -153,5 +153,5 @@ class PluginTestUtils : public testing::Test )"; }; -} // namespace panther_manager::plugin_test_utils -#endif // PANTHER_MANAGER_PLUGIN_TEST_UTILS_HPP_ +} // namespace husarion_ugv_manager::plugin_test_utils +#endif // HUSARION_UGV_MANAGER_PLUGIN_TEST_UTILS_HPP_ diff --git a/panther_utils/CHANGELOG.rst b/husarion_ugv_utils/CHANGELOG.rst similarity index 100% rename from panther_utils/CHANGELOG.rst rename to husarion_ugv_utils/CHANGELOG.rst diff --git a/panther_utils/CMakeLists.txt b/husarion_ugv_utils/CMakeLists.txt similarity index 99% rename from panther_utils/CMakeLists.txt rename to husarion_ugv_utils/CMakeLists.txt index 9fbca544..6753ec7c 100644 --- a/panther_utils/CMakeLists.txt +++ b/husarion_ugv_utils/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2) -project(panther_utils) +project(husarion_ugv_utils) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) diff --git a/panther_utils/README.md b/husarion_ugv_utils/README.md similarity index 52% rename from panther_utils/README.md rename to husarion_ugv_utils/README.md index 78fbdf34..62ae9140 100644 --- a/panther_utils/README.md +++ b/husarion_ugv_utils/README.md @@ -1,3 +1,3 @@ -# panther_utils +# husarion_ugv_utils -Package containing commonly used functions, classes, and configurations for the Husarion Panther system. +Package containing commonly used functions, classes, and configurations for the Husarion UGV system. diff --git a/panther_utils/panther_utils/__init__.py b/husarion_ugv_utils/husarion_ugv_utils/__init__.py similarity index 100% rename from panther_utils/panther_utils/__init__.py rename to husarion_ugv_utils/husarion_ugv_utils/__init__.py diff --git a/panther_utils/panther_utils/integration_test_utils.py b/husarion_ugv_utils/husarion_ugv_utils/integration_test_utils.py similarity index 100% rename from panther_utils/panther_utils/integration_test_utils.py rename to husarion_ugv_utils/husarion_ugv_utils/integration_test_utils.py diff --git a/panther_utils/panther_utils/messages.py b/husarion_ugv_utils/husarion_ugv_utils/messages.py similarity index 100% rename from panther_utils/panther_utils/messages.py rename to husarion_ugv_utils/husarion_ugv_utils/messages.py diff --git a/panther_utils/include/panther_utils/common_utilities.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/common_utilities.hpp similarity index 93% rename from panther_utils/include/panther_utils/common_utilities.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/common_utilities.hpp index 237f24b5..a82b0927 100644 --- a/panther_utils/include/panther_utils/common_utilities.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/common_utilities.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_COMMON_UTILITIES_HPP_ -#define PANTHER_UTILS_COMMON_UTILITIES_HPP_ +#ifndef HUSARION_UGV_UTILS_COMMON_UTILITIES_HPP_ +#define HUSARION_UGV_UTILS_COMMON_UTILITIES_HPP_ #include #include @@ -21,7 +21,7 @@ #include #include -namespace panther_utils::common_utilities +namespace husarion_ugv_utils::common_utilities { /** @@ -121,6 +121,6 @@ inline bool MeetsVersionRequirement(const float version, const float required_ve return version >= required_version - std::numeric_limits::epsilon(); } -} // namespace panther_utils::common_utilities +} // namespace husarion_ugv_utils::common_utilities -#endif // PANTHER_UTILS_COMMON_UTILITIES_HPP_ +#endif // HUSARION_UGV_UTILS_COMMON_UTILITIES_HPP_ diff --git a/panther_utils/include/panther_utils/configure_rt.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/configure_rt.hpp similarity index 87% rename from panther_utils/include/panther_utils/configure_rt.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/configure_rt.hpp index 1d6d58ae..6420b6bf 100644 --- a/panther_utils/include/panther_utils/configure_rt.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/configure_rt.hpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_CONFIGURE_RT_HPP_ -#define PANTHER_UTILS_CONFIGURE_RT_HPP_ +#ifndef HUSARION_UGV_UTILS_CONFIGURE_RT_HPP_ +#define HUSARION_UGV_UTILS_CONFIGURE_RT_HPP_ #include #include "realtime_tools/thread_priority.hpp" -namespace panther_utils +namespace husarion_ugv_utils { /** * @brief Configures thread that calls this function to FIFO scheduler with RT priority @@ -44,6 +44,6 @@ inline void ConfigureRT(const unsigned priority) } } -} // namespace panther_utils +} // namespace husarion_ugv_utils -#endif // PANTHER_UTILS_CONFIGURE_RT_HPP_ +#endif // HUSARION_UGV_UTILS_CONFIGURE_RT_HPP_ diff --git a/panther_utils/include/panther_utils/diagnostics.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/diagnostics.hpp similarity index 88% rename from panther_utils/include/panther_utils/diagnostics.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/diagnostics.hpp index 937a8fc2..f1278f4c 100644 --- a/panther_utils/include/panther_utils/diagnostics.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/diagnostics.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_DIAGNOSTICS_HPP_ -#define PANTHER_UTILS_DIAGNOSTICS_HPP_ +#ifndef HUSARION_UGV_UTILS_DIAGNOSTICS_HPP_ +#define HUSARION_UGV_UTILS_DIAGNOSTICS_HPP_ #include #include #include "diagnostic_updater/diagnostic_status_wrapper.hpp" -namespace panther_utils::diagnostics +namespace husarion_ugv_utils::diagnostics { /** @@ -49,6 +49,6 @@ void AddKeyValueIfTrue( } } -} // namespace panther_utils::diagnostics +} // namespace husarion_ugv_utils::diagnostics -#endif // PANTHER_UTILS_DIAGNOSTICS_HPP_ +#endif // HUSARION_UGV_UTILS_DIAGNOSTICS_HPP_ diff --git a/panther_utils/include/panther_utils/moving_average.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/moving_average.hpp similarity index 86% rename from panther_utils/include/panther_utils/moving_average.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/moving_average.hpp index 7575c562..0a6c7636 100644 --- a/panther_utils/include/panther_utils/moving_average.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/moving_average.hpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_MOVING_AVERAGE_HPP_ -#define PANTHER_UTILS_MOVING_AVERAGE_HPP_ +#ifndef HUSARION_UGV_UTILS_MOVING_AVERAGE_HPP_ +#define HUSARION_UGV_UTILS_MOVING_AVERAGE_HPP_ #include -namespace panther_utils +namespace husarion_ugv_utils { template @@ -61,6 +61,6 @@ class MovingAverage T sum_; }; -} // namespace panther_utils +} // namespace husarion_ugv_utils -#endif // PANTHER_UTILS_MOVING_AVERAGE_HPP_ +#endif // HUSARION_UGV_UTILS_MOVING_AVERAGE_HPP_ diff --git a/panther_utils/include/panther_utils/ros_utils.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/ros_utils.hpp similarity index 94% rename from panther_utils/include/panther_utils/ros_utils.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/ros_utils.hpp index d8157bc1..6d226ca7 100644 --- a/panther_utils/include/panther_utils/ros_utils.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/ros_utils.hpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS__ROS_UTILS_HPP_ -#define PANTHER_UTILS__ROS_UTILS_HPP_ +#ifndef HUSARION_UGV_UTILS__ROS_UTILS_HPP_ +#define HUSARION_UGV_UTILS__ROS_UTILS_HPP_ #include #include "std_msgs/msg/header.hpp" -namespace panther_utils::ros +namespace husarion_ugv_utils::ros { /** @@ -105,6 +105,6 @@ std::string AddNamespaceToFrameID(const std::string & frame_id, const std::strin return tf_prefix + frame_id; } -} // namespace panther_utils::ros +} // namespace husarion_ugv_utils::ros -#endif // PANTHER_UTILS__ROS_UTILS_HPP_ +#endif // HUSARION_UGV_UTILS__ROS_UTILS_HPP_ diff --git a/panther_utils/include/panther_utils/test/ros_test_utils.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/test/ros_test_utils.hpp similarity index 93% rename from panther_utils/include/panther_utils/test/ros_test_utils.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/test/ros_test_utils.hpp index c6a6b728..aaef6de1 100644 --- a/panther_utils/include/panther_utils/test/ros_test_utils.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/test/ros_test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_TEST_UTILS_HPP_ -#define PANTHER_UTILS_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_UTILS_TEST_UTILS_HPP_ +#define HUSARION_UGV_UTILS_TEST_UTILS_HPP_ #include #include @@ -22,7 +22,7 @@ #include "rclcpp/rclcpp.hpp" -namespace panther_utils::test_utils +namespace husarion_ugv_utils::test_utils { /** @@ -100,6 +100,6 @@ void PublishAndSpin( std::this_thread::sleep_for(std::chrono::milliseconds(10)); } -} // namespace panther_utils::test_utils +} // namespace husarion_ugv_utils::test_utils -#endif // PANTHER_UTILS_TEST_UTILS_HPP_ +#endif // HUSARION_UGV_UTILS_TEST_UTILS_HPP_ diff --git a/panther_utils/include/panther_utils/test/test_utils.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/test/test_utils.hpp similarity index 90% rename from panther_utils/include/panther_utils/test/test_utils.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/test/test_utils.hpp index a71322c0..1346f5f4 100644 --- a/panther_utils/include/panther_utils/test/test_utils.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/test/test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_TEST_UTILS_HPP_ -#define PANTHER_UTILS_TEST_UTILS_HPP_ +#ifndef HUSARION_UGV_UTILS_TEST_UTILS_HPP_ +#define HUSARION_UGV_UTILS_TEST_UTILS_HPP_ #include #include @@ -22,7 +22,7 @@ #include #include -namespace panther_utils::test_utils +namespace husarion_ugv_utils::test_utils { /** @@ -69,6 +69,6 @@ bool IsMessageThrown(const Func & func, const std::string & error_msg) return false; } -} // namespace panther_utils::test_utils +} // namespace husarion_ugv_utils::test_utils -#endif // PANTHER_UTILS_TEST_UTILS_HPP_ +#endif // HUSARION_UGV_UTILS_TEST_UTILS_HPP_ diff --git a/panther_utils/include/panther_utils/yaml_utils.hpp b/husarion_ugv_utils/include/husarion_ugv_utils/yaml_utils.hpp similarity index 91% rename from panther_utils/include/panther_utils/yaml_utils.hpp rename to husarion_ugv_utils/include/husarion_ugv_utils/yaml_utils.hpp index e6137bda..8d32559a 100644 --- a/panther_utils/include/panther_utils/yaml_utils.hpp +++ b/husarion_ugv_utils/include/husarion_ugv_utils/yaml_utils.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PANTHER_UTILS_YAML_UTILS_HPP_ -#define PANTHER_UTILS_YAML_UTILS_HPP_ +#ifndef HUSARION_UGV_UTILS_YAML_UTILS_HPP_ +#define HUSARION_UGV_UTILS_YAML_UTILS_HPP_ #include #include #include "yaml-cpp/yaml.h" -namespace panther_utils +namespace husarion_ugv_utils { /** @@ -69,6 +69,6 @@ T GetYAMLKeyValue(const YAML::Node & description, const std::string & key, const } } -} // namespace panther_utils +} // namespace husarion_ugv_utils -#endif // PANTHER_UTILS_YAML_UTILS_HPP_ +#endif // HUSARION_UGV_UTILS_YAML_UTILS_HPP_ diff --git a/panther_utils/package.xml b/husarion_ugv_utils/package.xml similarity index 97% rename from panther_utils/package.xml rename to husarion_ugv_utils/package.xml index aad717ec..9c5c4fd9 100644 --- a/panther_utils/package.xml +++ b/husarion_ugv_utils/package.xml @@ -1,7 +1,7 @@ - panther_utils + husarion_ugv_utils 2.1.1 Package for commonly used functions, classes, and configurations Husarion diff --git a/panther_utils/test/test_common_utilities.cpp b/husarion_ugv_utils/test/test_common_utilities.cpp similarity index 67% rename from panther_utils/test/test_common_utilities.cpp rename to husarion_ugv_utils/test/test_common_utilities.cpp index 031dd043..fe374936 100644 --- a/panther_utils/test/test_common_utilities.cpp +++ b/husarion_ugv_utils/test/test_common_utilities.cpp @@ -20,14 +20,14 @@ #include "gtest/gtest.h" -#include "panther_utils/common_utilities.hpp" +#include "husarion_ugv_utils/common_utilities.hpp" TEST(TestSetPrecision, TwoDigitPrecision) { float value = 3.14159; float expected_result = 3.14; - float result = panther_utils::common_utilities::SetPrecision(value, 2); + float result = husarion_ugv_utils::common_utilities::SetPrecision(value, 2); EXPECT_FLOAT_EQ(expected_result, result); } @@ -37,7 +37,7 @@ TEST(TestSetPrecision, ZeroDigitPrecision) float value = 3.54159; float expected_result = 4.0; - float result = panther_utils::common_utilities::SetPrecision(value, 0); + float result = husarion_ugv_utils::common_utilities::SetPrecision(value, 0); EXPECT_FLOAT_EQ(expected_result, result); } @@ -46,7 +46,7 @@ TEST(TestSetPrecision, NegativeValue) { float value = -3.14159; float expected_result = -3.14; - float result = panther_utils::common_utilities::SetPrecision(value, 2); + float result = husarion_ugv_utils::common_utilities::SetPrecision(value, 2); EXPECT_FLOAT_EQ(expected_result, result); } @@ -54,7 +54,7 @@ TEST(TestSetPrecision, LargeValue) { float value = 123456.789; float expected_result = 123456.79; - float result = panther_utils::common_utilities::SetPrecision(value, 2); + float result = husarion_ugv_utils::common_utilities::SetPrecision(value, 2); EXPECT_FLOAT_EQ(expected_result, result); } @@ -64,7 +64,7 @@ TEST(TestCountPercentage, ValidValues) int total = 100; float expected_result = 25.00; - float result = panther_utils::common_utilities::CountPercentage(value, total); + float result = husarion_ugv_utils::common_utilities::CountPercentage(value, total); EXPECT_FLOAT_EQ(expected_result, result); } @@ -75,7 +75,7 @@ TEST(TestCountPercentage, ZeroTotal) int total = 0; EXPECT_THROW( - panther_utils::common_utilities::CountPercentage(value, total), std::invalid_argument); + husarion_ugv_utils::common_utilities::CountPercentage(value, total), std::invalid_argument); } TEST(TestCountPercentage, ZeroValue) @@ -84,7 +84,7 @@ TEST(TestCountPercentage, ZeroValue) int total = 100; float expected_result = 0.00; - float result = panther_utils::common_utilities::CountPercentage(value, total); + float result = husarion_ugv_utils::common_utilities::CountPercentage(value, total); EXPECT_FLOAT_EQ(expected_result, result); } @@ -95,7 +95,7 @@ TEST(TestPrefixMapKeys, CorrectlyPrefixesKeys) std::string prefix = "prefix_"; std::map expected_map = {{"prefix_key1", 1}, {"prefix_key2", 2}}; - auto result_map = panther_utils::common_utilities::PrefixMapKeys(input_map, prefix); + auto result_map = husarion_ugv_utils::common_utilities::PrefixMapKeys(input_map, prefix); EXPECT_EQ(result_map, expected_map); } @@ -106,7 +106,7 @@ TEST(TestPrefixMapKeys, HandlesEmptyPrefix) std::string prefix = ""; std::map expected_map = input_map; // The maps should be identical - auto result_map = panther_utils::common_utilities::PrefixMapKeys(input_map, prefix); + auto result_map = husarion_ugv_utils::common_utilities::PrefixMapKeys(input_map, prefix); EXPECT_EQ(result_map, expected_map); } @@ -117,7 +117,7 @@ TEST(TestPrefixMapKeys, HandlesEmptyMap) std::string prefix = "prefix_"; std::map expected_map; - auto result_map = panther_utils::common_utilities::PrefixMapKeys(input_map, prefix); + auto result_map = husarion_ugv_utils::common_utilities::PrefixMapKeys(input_map, prefix); EXPECT_EQ(result_map, expected_map); } @@ -128,14 +128,14 @@ TEST(TestPrefixMapKeys, HandlesNonAlphanumericPrefix) std::string prefix = "prefix_@#"; std::map expected_map = {{"prefix_@#key1", 1}, {"prefix_@#key2", 2}}; - auto result_map = panther_utils::common_utilities::PrefixMapKeys(input_map, prefix); + auto result_map = husarion_ugv_utils::common_utilities::PrefixMapKeys(input_map, prefix); EXPECT_EQ(result_map, expected_map); } TEST(TestOpenFile, HandleOpenFile) { - std::string path = testing::TempDir() + "test_panther_utils_open_file"; + std::string path = testing::TempDir() + "test_husarion_ugv_utils_open_file"; // Make sure that there is no random file. std::filesystem::remove(path); @@ -143,26 +143,27 @@ TEST(TestOpenFile, HandleOpenFile) std::ofstream ofs(path); ofs.close(); - EXPECT_NO_THROW({ panther_utils::common_utilities::OpenFile(path, std::ios_base::out); }); + EXPECT_NO_THROW({ husarion_ugv_utils::common_utilities::OpenFile(path, std::ios_base::out); }); std::filesystem::remove(path); } TEST(TestOpenFile, HandleOpenFileThrow) { - std::string path = testing::TempDir() + "test_panther_utils_open_file"; + std::string path = testing::TempDir() + "test_husarion_ugv_utils_open_file"; // Make sure that there is no random file. std::filesystem::remove(path); EXPECT_THROW( - { panther_utils::common_utilities::OpenFile(path, std::ios_base::in); }, std::runtime_error); + { husarion_ugv_utils::common_utilities::OpenFile(path, std::ios_base::in); }, + std::runtime_error); } TEST(TestMeetsVersionRequirement, SameVersion) { float version = 1.06; - auto is_met = panther_utils::common_utilities::MeetsVersionRequirement(version, 1.06); + auto is_met = husarion_ugv_utils::common_utilities::MeetsVersionRequirement(version, 1.06); EXPECT_TRUE(is_met); } @@ -171,7 +172,7 @@ TEST(TestMeetsVersionRequirement, LowerVersion) { float version = 1.2; - auto is_met = panther_utils::common_utilities::MeetsVersionRequirement(version, 1.06); + auto is_met = husarion_ugv_utils::common_utilities::MeetsVersionRequirement(version, 1.06); EXPECT_TRUE(is_met); } @@ -180,7 +181,7 @@ TEST(TestMeetsVersionRequirement, HigherVersion) { float version = 1.0; - auto is_met = panther_utils::common_utilities::MeetsVersionRequirement(version, 1.06); + auto is_met = husarion_ugv_utils::common_utilities::MeetsVersionRequirement(version, 1.06); EXPECT_FALSE(is_met); } @@ -189,7 +190,7 @@ TEST(TestMeetsVersionRequirement, NaNVersionRequired) { float version = std::numeric_limits::quiet_NaN(); - auto is_met = panther_utils::common_utilities::MeetsVersionRequirement(version, 1.06); + auto is_met = husarion_ugv_utils::common_utilities::MeetsVersionRequirement(version, 1.06); EXPECT_FALSE(is_met); } diff --git a/panther_utils/test/test_diagnostics.cpp b/husarion_ugv_utils/test/test_diagnostics.cpp similarity index 84% rename from panther_utils/test/test_diagnostics.cpp rename to husarion_ugv_utils/test/test_diagnostics.cpp index c09eddc4..993275d8 100644 --- a/panther_utils/test/test_diagnostics.cpp +++ b/husarion_ugv_utils/test/test_diagnostics.cpp @@ -20,14 +20,14 @@ #include "diagnostic_updater/diagnostic_status_wrapper.hpp" -#include "panther_utils/diagnostics.hpp" +#include "husarion_ugv_utils/diagnostics.hpp" TEST(TestAddKeyValueIfTrue, HandlesBoolean) { diagnostic_updater::DiagnosticStatusWrapper status; std::map kv_map = {{"key1", true}, {"key2", false}, {"key3", true}}; - panther_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); ASSERT_EQ(2, status.values.size()); EXPECT_EQ("key1", status.values.at(0).key); @@ -40,7 +40,7 @@ TEST(TestAddKeyValueIfTrue, HandlesSmartPointer) std::map> kv_map = { {"key1", nullptr}, {"key2", nullptr}, {"key3", std::make_shared(1)}}; - panther_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); ASSERT_EQ(1, status.values.size()); EXPECT_EQ("key3", status.values.at(0).key); @@ -51,7 +51,7 @@ TEST(TestAddKeyValueIfTrue, HandlesInteger) diagnostic_updater::DiagnosticStatusWrapper status; std::map kv_map = {{"key1", 0}, {"key2", 1}, {"key3", 2}}; - panther_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); ASSERT_EQ(2, status.values.size()); EXPECT_EQ("key2", status.values.at(0).key); @@ -63,7 +63,7 @@ TEST(TestAddKeyValueIfTrue, HandlesEmptyMap) diagnostic_updater::DiagnosticStatusWrapper status; std::map kv_map; - panther_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue(status, kv_map); ASSERT_EQ(0, status.values.size()); } @@ -73,7 +73,7 @@ TEST(TestAddKeyValueIfTrue, HandlesPrefixAndSuffix) diagnostic_updater::DiagnosticStatusWrapper status; std::map kv_map = {{"key1", true}, {"key2", false}, {"key3", true}}; - panther_utils::diagnostics::AddKeyValueIfTrue(status, kv_map, "prefix_", "_suffix"); + husarion_ugv_utils::diagnostics::AddKeyValueIfTrue(status, kv_map, "prefix_", "_suffix"); ASSERT_EQ(2, status.values.size()); EXPECT_EQ("prefix_key1_suffix", status.values.at(0).key); diff --git a/panther_utils/test/test_moving_average.cpp b/husarion_ugv_utils/test/test_moving_average.cpp similarity index 80% rename from panther_utils/test/test_moving_average.cpp rename to husarion_ugv_utils/test/test_moving_average.cpp index f102a7b2..653483ce 100644 --- a/panther_utils/test/test_moving_average.cpp +++ b/husarion_ugv_utils/test/test_moving_average.cpp @@ -14,29 +14,29 @@ #include "gtest/gtest.h" -#include "panther_utils/moving_average.hpp" +#include "husarion_ugv_utils/moving_average.hpp" TEST(TestMovingAverage, TestDefaultInitialValue) { - panther_utils::MovingAverage ma(4); + husarion_ugv_utils::MovingAverage ma(4); EXPECT_EQ(0.0, ma.GetAverage()); } TEST(TestMovingAverage, TestIntialValue) { - panther_utils::MovingAverage ma(4, 1.0); + husarion_ugv_utils::MovingAverage ma(4, 1.0); EXPECT_EQ(1.0, ma.GetAverage()); - panther_utils::MovingAverage ma_1(10, 3.7); + husarion_ugv_utils::MovingAverage ma_1(10, 3.7); EXPECT_EQ(3.7, ma_1.GetAverage()); - panther_utils::MovingAverage ma_2(3, 4); + husarion_ugv_utils::MovingAverage ma_2(3, 4); EXPECT_EQ(4, ma_2.GetAverage()); } TEST(TestMovingAverage, TestOutputValues) { - panther_utils::MovingAverage ma(4); + husarion_ugv_utils::MovingAverage ma(4); ma.Roll(1.0); ASSERT_EQ(1.0, ma.GetAverage()); @@ -57,7 +57,7 @@ TEST(TestMovingAverage, TestOutputValues) TEST(TestMovingAverage, TestHighOverload) { const std::size_t window_len = 1000; - panther_utils::MovingAverage ma(window_len); + husarion_ugv_utils::MovingAverage ma(window_len); double sum = 0.0; for (std::size_t i = 1; i <= window_len * 10; i++) { @@ -74,7 +74,7 @@ TEST(TestMovingAverage, TestHighOverload) TEST(TestMovingAverage, TestIntFloorRound) { - panther_utils::MovingAverage ma; + husarion_ugv_utils::MovingAverage ma; ma.Roll(1); ma.Roll(2); EXPECT_EQ(1, ma.GetAverage()); @@ -82,7 +82,7 @@ TEST(TestMovingAverage, TestIntFloorRound) TEST(TestMovingAverage, TestReset) { - panther_utils::MovingAverage ma(4); + husarion_ugv_utils::MovingAverage ma(4); ma.Roll(1.0); ma.Roll(2.0); ma.Roll(1.0); @@ -99,7 +99,7 @@ TEST(TestMovingAverage, TestReset) TEST(TestMovingAverage, TestResetToInitialValue) { - panther_utils::MovingAverage ma(4, 7.0); + husarion_ugv_utils::MovingAverage ma(4, 7.0); ma.Roll(1.0); ma.Roll(2.0); EXPECT_EQ(1.5, ma.GetAverage()); diff --git a/panther_utils/test/test_ros_test_utils.cpp b/husarion_ugv_utils/test/test_ros_test_utils.cpp similarity index 84% rename from panther_utils/test/test_ros_test_utils.cpp rename to husarion_ugv_utils/test/test_ros_test_utils.cpp index d47d2d13..04ea84ac 100644 --- a/panther_utils/test/test_ros_test_utils.cpp +++ b/husarion_ugv_utils/test/test_ros_test_utils.cpp @@ -21,7 +21,7 @@ #include "std_msgs/msg/empty.hpp" -#include "panther_utils/test/ros_test_utils.hpp" +#include "husarion_ugv_utils/test/ros_test_utils.hpp" TEST(TestROSTestUtils, WaitForMessage) { @@ -34,11 +34,11 @@ TEST(TestROSTestUtils, WaitForMessage) topic_name, 10, [&](const std_msgs::msg::Empty::SharedPtr msg) { empty_msg = msg; }); EXPECT_FALSE( - panther_utils::test_utils::WaitForMsg(node, empty_msg, std::chrono::milliseconds(1000))); + husarion_ugv_utils::test_utils::WaitForMsg(node, empty_msg, std::chrono::milliseconds(1000))); pub->publish(std_msgs::msg::Empty()); EXPECT_TRUE( - panther_utils::test_utils::WaitForMsg(node, empty_msg, std::chrono::milliseconds(1000))); + husarion_ugv_utils::test_utils::WaitForMsg(node, empty_msg, std::chrono::milliseconds(1000))); } TEST(TestROSTestUtils, PublishAndSpin) @@ -53,7 +53,7 @@ TEST(TestROSTestUtils, PublishAndSpin) EXPECT_FALSE(received_msg); - panther_utils::test_utils::PublishAndSpin(node, topic_name, published_msg); + husarion_ugv_utils::test_utils::PublishAndSpin(node, topic_name, published_msg); EXPECT_TRUE(received_msg); } diff --git a/panther_utils/test/test_ros_utils.cpp b/husarion_ugv_utils/test/test_ros_utils.cpp similarity index 76% rename from panther_utils/test/test_ros_utils.cpp rename to husarion_ugv_utils/test/test_ros_utils.cpp index 5832388a..eb3e470d 100644 --- a/panther_utils/test/test_ros_utils.cpp +++ b/husarion_ugv_utils/test/test_ros_utils.cpp @@ -17,7 +17,7 @@ #include -#include "panther_utils/ros_utils.hpp" +#include "husarion_ugv_utils/ros_utils.hpp" using HeaderMsg = std_msgs::msg::Header; @@ -32,7 +32,8 @@ TEST(TestVerifyTimestampGap, TimestampGapOk) header_2.stamp.nanosec = 500000000; auto max_timestamp_gap = std::chrono::seconds(2); - EXPECT_NO_THROW(panther_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap)); + EXPECT_NO_THROW( + husarion_ugv_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap)); } TEST(TestVerifyTimestampGap, TimestampGapExceeding) @@ -48,7 +49,7 @@ TEST(TestVerifyTimestampGap, TimestampGapExceeding) auto max_timestamp_gap = std::chrono::seconds(1); EXPECT_THROW( - panther_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap), + husarion_ugv_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap), std::runtime_error); } @@ -60,7 +61,7 @@ TEST(TestVerifyTimestampGap, TimestampNotSet) auto max_timestamp_gap = std::chrono::seconds(1); EXPECT_THROW( - panther_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap), + husarion_ugv_utils::ros::VerifyTimestampGap(header_1, header_2, max_timestamp_gap), std::runtime_error); } @@ -74,7 +75,7 @@ TEST(TestMergeHeaders, SameFrameIds) HeaderMsg merged_header; - EXPECT_NO_THROW(merged_header = panther_utils::ros::MergeHeaders(header_1, header_2)); + EXPECT_NO_THROW(merged_header = husarion_ugv_utils::ros::MergeHeaders(header_1, header_2)); EXPECT_STREQ("frame", merged_header.frame_id.c_str()); } @@ -86,7 +87,7 @@ TEST(TestMergeHeaders, DifferentFrameIds) HeaderMsg header_2; header_2.frame_id = "frame_2"; - EXPECT_THROW(panther_utils::ros::MergeHeaders(header_1, header_2), std::runtime_error); + EXPECT_THROW(husarion_ugv_utils::ros::MergeHeaders(header_1, header_2), std::runtime_error); } TEST(TestMergeHeaders, EarlierTimestampNanosec) @@ -99,7 +100,7 @@ TEST(TestMergeHeaders, EarlierTimestampNanosec) header_2.stamp.sec = 10; header_2.stamp.nanosec = 500000000; - auto merged_header = panther_utils::ros::MergeHeaders(header_1, header_2); + auto merged_header = husarion_ugv_utils::ros::MergeHeaders(header_1, header_2); EXPECT_EQ(merged_header.stamp.sec, 10); EXPECT_EQ(merged_header.stamp.nanosec, 200000000); @@ -115,7 +116,7 @@ TEST(TestMergeHeaders, EarlierTimestampSec) header_2.stamp.sec = 10; header_2.stamp.nanosec = 500000000; - auto merged_header = panther_utils::ros::MergeHeaders(header_1, header_2); + auto merged_header = husarion_ugv_utils::ros::MergeHeaders(header_1, header_2); EXPECT_EQ(merged_header.stamp.sec, 9); EXPECT_EQ(merged_header.stamp.nanosec, 500000000); @@ -131,7 +132,7 @@ TEST(TestMergeHeaders, LaterTimestamp) header_2.stamp.sec = 9; header_2.stamp.nanosec = 500000000; - auto merged_header = panther_utils::ros::MergeHeaders(header_1, header_2); + auto merged_header = husarion_ugv_utils::ros::MergeHeaders(header_1, header_2); EXPECT_EQ(merged_header.stamp.sec, 9); EXPECT_EQ(merged_header.stamp.nanosec, 500000000); @@ -142,7 +143,7 @@ TEST(TestAddNamespaceToFrameID, WithoutNamespace) std::string frame_id = "frame"; std::string ns = ""; - auto result = panther_utils::ros::AddNamespaceToFrameID(frame_id, ns); + auto result = husarion_ugv_utils::ros::AddNamespaceToFrameID(frame_id, ns); EXPECT_EQ(result, "frame"); } @@ -151,7 +152,7 @@ TEST(TestAddNamespaceToFrameID, WithSlashNamespace) std::string frame_id = "frame"; std::string ns = "/"; - auto result = panther_utils::ros::AddNamespaceToFrameID(frame_id, ns); + auto result = husarion_ugv_utils::ros::AddNamespaceToFrameID(frame_id, ns); EXPECT_EQ(result, "frame"); } @@ -160,7 +161,7 @@ TEST(TestAddNamespaceToFrameID, WithSlashedNamespace) std::string frame_id = "frame"; std::string ns = "/namespace"; - auto result = panther_utils::ros::AddNamespaceToFrameID(frame_id, ns); + auto result = husarion_ugv_utils::ros::AddNamespaceToFrameID(frame_id, ns); EXPECT_EQ(result, "namespace/frame"); } @@ -169,7 +170,7 @@ TEST(TestAddNamespaceToFrameID, WithNamespace) std::string frame_id = "frame"; std::string ns = "namespace"; - auto result = panther_utils::ros::AddNamespaceToFrameID(frame_id, ns); + auto result = husarion_ugv_utils::ros::AddNamespaceToFrameID(frame_id, ns); EXPECT_EQ(result, "namespace/frame"); } diff --git a/panther_utils/test/test_test_utils.cpp b/husarion_ugv_utils/test/test_test_utils.cpp similarity index 66% rename from panther_utils/test/test_test_utils.cpp rename to husarion_ugv_utils/test/test_test_utils.cpp index 4f319edc..fd9b0a36 100644 --- a/panther_utils/test/test_test_utils.cpp +++ b/husarion_ugv_utils/test/test_test_utils.cpp @@ -18,15 +18,15 @@ #include "gtest/gtest.h" -#include "panther_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" template void TestCheckNaNVector() { std::vector vector(10, std::numeric_limits::quiet_NaN()); - EXPECT_TRUE(panther_utils::test_utils::CheckNaNVector(vector)); + EXPECT_TRUE(husarion_ugv_utils::test_utils::CheckNaNVector(vector)); vector.push_back(1.0); - EXPECT_FALSE(panther_utils::test_utils::CheckNaNVector(vector)); + EXPECT_FALSE(husarion_ugv_utils::test_utils::CheckNaNVector(vector)); } TEST(TestTestUtils, CheckNanVector) @@ -39,46 +39,46 @@ TEST(TestTestUtils, CheckNanVector) TEST(TestTestUtils, IsMessageThrownTrue) { - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "Example exception")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::out_of_range("Example exception"); }, "Example exception")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::invalid_argument("Example exception"); }, "Example exception")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "Example")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "exception")); } TEST(TestTestUtils, IsMessageThrownDifferentException) { - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::out_of_range("Example exception"); }, "Example exception")); - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::invalid_argument("Example exception"); }, "Example exception")); - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "Example exception")); } TEST(TestTestUtils, IsMessageThrownDifferentMessage) { - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "Different exception message")); - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { throw std::runtime_error("Example exception"); }, "Example exception ")); } TEST(TestTestUtils, IsMessageThrownNoThrow) { - EXPECT_FALSE(panther_utils::test_utils::IsMessageThrown( + EXPECT_FALSE(husarion_ugv_utils::test_utils::IsMessageThrown( []() { return; }, "Example exception")); } diff --git a/panther_utils/test/test_yaml_utils.cpp b/husarion_ugv_utils/test/test_yaml_utils.cpp similarity index 53% rename from panther_utils/test/test_yaml_utils.cpp rename to husarion_ugv_utils/test/test_yaml_utils.cpp index 8f853350..2f4c62fb 100644 --- a/panther_utils/test/test_yaml_utils.cpp +++ b/husarion_ugv_utils/test/test_yaml_utils.cpp @@ -15,14 +15,14 @@ #include "gtest/gtest.h" #include "yaml-cpp/yaml.h" -#include "panther_utils/test/test_utils.hpp" -#include "panther_utils/yaml_utils.hpp" +#include "husarion_ugv_utils/test/test_utils.hpp" +#include "husarion_ugv_utils/yaml_utils.hpp" TEST(TestGetYAMLKeyValue, MissingKey) { YAML::Node desc; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [desc]() { panther_utils::GetYAMLKeyValue(desc, "key_name"); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [desc]() { husarion_ugv_utils::GetYAMLKeyValue(desc, "key_name"); }, "Missing 'key_name' in description")); } @@ -34,17 +34,19 @@ TEST(TestGetYAMLKeyValue, ConversionFailure) desc["string_key"] = "string"; desc["int_vector_key"] = "[1 2 3]"; - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [&]() { panther_utils::GetYAMLKeyValue(desc, "float_key"); }, "Failed to convert")); + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [&]() { husarion_ugv_utils::GetYAMLKeyValue(desc, "float_key"); }, "Failed to convert")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [&]() { panther_utils::GetYAMLKeyValue(desc, "string_key"); }, "Failed to convert")); + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [&]() { husarion_ugv_utils::GetYAMLKeyValue(desc, "string_key"); }, + "Failed to convert")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [&]() { panther_utils::GetYAMLKeyValue(desc, "int_vector_key"); }, "Failed to convert")); + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [&]() { husarion_ugv_utils::GetYAMLKeyValue(desc, "int_vector_key"); }, + "Failed to convert")); - EXPECT_TRUE(panther_utils::test_utils::IsMessageThrown( - [&]() { panther_utils::GetYAMLKeyValue>(desc, "string_key"); }, + EXPECT_TRUE(husarion_ugv_utils::test_utils::IsMessageThrown( + [&]() { husarion_ugv_utils::GetYAMLKeyValue>(desc, "string_key"); }, "Failed to convert")); } @@ -56,13 +58,13 @@ TEST(TestGetYAMLKeyValue, GetKey) desc["float_key"] = 1.5; desc["string_key"] = "string"; - const auto int_value = panther_utils::GetYAMLKeyValue(desc, "int_key"); + const auto int_value = husarion_ugv_utils::GetYAMLKeyValue(desc, "int_key"); EXPECT_EQ(2, int_value); - const auto float_value = panther_utils::GetYAMLKeyValue(desc, "float_key"); + const auto float_value = husarion_ugv_utils::GetYAMLKeyValue(desc, "float_key"); EXPECT_EQ(1.5, float_value); - const auto str_value = panther_utils::GetYAMLKeyValue(desc, "string_key"); + const auto str_value = husarion_ugv_utils::GetYAMLKeyValue(desc, "string_key"); EXPECT_EQ("string", str_value); } @@ -72,7 +74,7 @@ TEST(TestGetYAMLKeyValue, GetVectorKey) desc["int_vector_key"] = std::vector(5, 147); - const auto value_vector = panther_utils::GetYAMLKeyValue>( + const auto value_vector = husarion_ugv_utils::GetYAMLKeyValue>( desc, "int_vector_key"); for (auto value : value_vector) { EXPECT_EQ(147, value); @@ -84,7 +86,7 @@ TEST(TestGetYAMLKeyValue, GetKeyDefaultValue) YAML::Node desc; const int default_value = 54; - const auto value = panther_utils::GetYAMLKeyValue(desc, "key_name", default_value); + const auto value = husarion_ugv_utils::GetYAMLKeyValue(desc, "key_name", default_value); EXPECT_EQ(default_value, value); } diff --git a/lynx_description/launch/load_urdf.launch.py b/lynx_description/launch/load_urdf.launch.py index 6e048f9c..cc3e6dbf 100644 --- a/lynx_description/launch/load_urdf.launch.py +++ b/lynx_description/launch/load_urdf.launch.py @@ -72,14 +72,14 @@ def generate_launch_description(): "controller_config_path", default_value=PathJoinSubstitution( [ - FindPackageShare("panther_controller"), + FindPackageShare("husarion_ugv_controller"), "config", PythonExpression(["'", wheel_type, "_controller.yaml'"]), ] ), description=( "Path to controller configuration file. By default, it is located in" - " 'panther_controller/config/{wheel_type}_controller.yaml'. You can also specify" + " 'husarion_ugv_controller/config/{wheel_type}_controller.yaml'. You can also specify" " the path to your custom controller configuration file here. " ), ) diff --git a/lynx_description/urdf/lynx.urdf.xacro b/lynx_description/urdf/lynx.urdf.xacro index 557b8eae..8a78c117 100644 --- a/lynx_description/urdf/lynx.urdf.xacro +++ b/lynx_description/urdf/lynx.urdf.xacro @@ -10,7 +10,7 @@ + default="$(find husarion_ugv_controller)/config/WH05_controller.yaml" /> diff --git a/lynx_description/urdf/lynx_macro.urdf.xacro b/lynx_description/urdf/lynx_macro.urdf.xacro index 4e1fdf17..c7baa4e8 100644 --- a/lynx_description/urdf/lynx_macro.urdf.xacro +++ b/lynx_description/urdf/lynx_macro.urdf.xacro @@ -57,12 +57,12 @@ - panther_gazebo/GzPantherSystem + husarion_ugv_gazebo/EStopSystem true - panther_hardware_interfaces/LynxSystem + husarion_ugv_hardware_interfaces/LynxSystem 1600 @@ -143,7 +143,7 @@ - panther_hardware_interfaces/PantherImuSensor + husarion_ugv_hardware_interfaces/PantherImuSensor -1 0 8 diff --git a/panther/README.md b/panther/README.md deleted file mode 100644 index abc2f7d2..00000000 --- a/panther/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# panther - -ROS 2 Metapackage composing basic functionalities of the Husarion Panther robot with VCS Tool yaml files directing to external robot dependencies. diff --git a/panther_controller/CONFIGURATION.md b/panther_controller/CONFIGURATION.md deleted file mode 100644 index f541b872..00000000 --- a/panther_controller/CONFIGURATION.md +++ /dev/null @@ -1,9 +0,0 @@ -# panther_controller - -## Changing Velocity Smoothing Parameters - -The Panther by default uses [diff_drive_controller](https://control.ros.org/master/doc/ros2_controllers/diff_drive_controller/doc/userdoc.html) from [ros2 control](https://control.ros.org/master/index.html) or [mecanum_drive_controller](https://github.com/husarion/husarion_controllers/tree/main/mecanum_drive_controller). This controller can be customized, among others: by modifying the robot's dynamic parameters (e.g. smooth the speed or limit the robot's speed and acceleration). Its parameters can be found in the [panther_controller](https://github.com/husarion/panther_ros/tree/ros2-devel/panther_controller/config). By default, these values correspond to the upper limits of the robot's velocities and accelerations. - -## Changing Wheel Type - -Changing wheel types is possible and can be done for both the real robot and the simulation. By default, three types of wheels are supported using the launch argument `wheel_type`. If you want to use custom wheels, all you need to do is point to the new wheel and controller configuration files using the `wheel_config_path` and `controller_config_path` parameters. These files should be based on the default files, i.e. [WH01_controller.yaml](./config/WH01_controller.yaml) and [WH01.yaml](../panther_description/config/WH01.yaml). diff --git a/panther_description/launch/load_urdf.launch.py b/panther_description/launch/load_urdf.launch.py index 8a0f8ee6..1297f7c1 100644 --- a/panther_description/launch/load_urdf.launch.py +++ b/panther_description/launch/load_urdf.launch.py @@ -71,14 +71,14 @@ def generate_launch_description(): "controller_config_path", default_value=PathJoinSubstitution( [ - FindPackageShare("panther_controller"), + FindPackageShare("husarion_ugv_controller"), "config", PythonExpression(["'", wheel_type, "_controller.yaml'"]), ] ), description=( "Path to controller configuration file. By default, it is located in" - " 'panther_controller/config/{wheel_type}_controller.yaml'. You can also specify" + " 'husarion_ugv_controller/config/{wheel_type}_controller.yaml'. You can also specify" " the path to your custom controller configuration file here. " ), ) diff --git a/panther_description/urdf/gazebo.urdf.xacro b/panther_description/urdf/gazebo.urdf.xacro index 29e3558f..2d520a1c 100644 --- a/panther_description/urdf/gazebo.urdf.xacro +++ b/panther_description/urdf/gazebo.urdf.xacro @@ -109,7 +109,7 @@ - + ${name} ${topic} ${namespace} diff --git a/panther_description/urdf/panther.urdf.xacro b/panther_description/urdf/panther.urdf.xacro index 1c167186..a60b84e9 100644 --- a/panther_description/urdf/panther.urdf.xacro +++ b/panther_description/urdf/panther.urdf.xacro @@ -9,7 +9,7 @@ + default="$(find husarion_ugv_controller)/config/WH01_controller.yaml" /> diff --git a/panther_description/urdf/panther_macro.urdf.xacro b/panther_description/urdf/panther_macro.urdf.xacro index de7f32ef..ffc93fc7 100644 --- a/panther_description/urdf/panther_macro.urdf.xacro +++ b/panther_description/urdf/panther_macro.urdf.xacro @@ -56,12 +56,12 @@ - panther_gazebo/GzPantherSystem + husarion_ugv_gazebo/EStopSystem true - panther_hardware_interfaces/PantherSystem + husarion_ugv_hardware_interfaces/PantherSystem 1600 @@ -143,7 +143,7 @@ - panther_hardware_interfaces/PantherImuSensor + husarion_ugv_hardware_interfaces/PantherImuSensor -1 0 8 diff --git a/panther_lights/plugins.xml b/panther_lights/plugins.xml deleted file mode 100644 index 11f0ed75..00000000 --- a/panther_lights/plugins.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Animation processed from an image - - - Charging animation representing percentage of battery - -