Skip to content

Commit

Permalink
updated LEDAnimation message
Browse files Browse the repository at this point in the history
  • Loading branch information
BOOTCFG committed Feb 7, 2025
1 parent b536d02 commit 298281f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 37 deletions.
14 changes: 7 additions & 7 deletions husarion_ugv_lights/config/panther_animations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ led_animations:
image_mirrored: true
position_mirrored: true

- id: 9
- id: 8
name: CHARGER_INSERTED
priority: 1
animations:
Expand All @@ -190,7 +190,7 @@ led_animations:
image: $(find husarion_ugv_lights)/animations/panther/charger_inserted_rear.png
duration: 8

- id: 10
- id: 9
name: BATTERY_NOMINAL
priority: 2
animations:
Expand All @@ -201,7 +201,7 @@ led_animations:
duration: 1
repeat: 1

- id: 11
- id: 10
name: AUTONOMOUS_READY
priority: 3
animations:
Expand All @@ -217,7 +217,7 @@ led_animations:
duration: 10


- id: 12
- id: 11
name: AUTONOMOUS_ACTION
priority: 3
animations:
Expand All @@ -232,7 +232,7 @@ led_animations:
image: $(find husarion_ugv_lights)/animations/panther/autonomous_action_rear.png
duration: 10

- id: 13
- id: 12
name: GOAL_ACHIEVED
priority: 1
animations:
Expand All @@ -249,7 +249,7 @@ led_animations:



- id: 14
- id: 13
name: BLINKER_LEFT
priority: 1
animations:
Expand All @@ -266,7 +266,7 @@ led_animations:
image_mirrored: true
position_mirrored: true

- id: 15
- id: 14
name: BLINKER_RIGHT
priority: 1
animations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "husarion_ugv_msgs/msg/led_animation.hpp"

#include "lights_manager_parameters.hpp"
#include <husarion_ugv_manager/lights_manager_parameters.hpp>

#include "husarion_ugv_utils/moving_average.hpp"

Expand Down
38 changes: 15 additions & 23 deletions husarion_ugv_manager/src/lights_manager_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,29 +132,21 @@ std::map<std::string, std::any> LightsManagerNode::CreateLightsInitialBlackboard
{"LOW_BATTERY_ANIM_PERIOD", low_battery_anim_period},
{"LOW_BATTERY_THRESHOLD_PERCENT", low_battery_threshold_percent},
// anim constants
// {"E_STOP_ANIM_ID", unsigned(LEDAnimationMsg::E_STOP)},
// {"READY_ANIM_ID", unsigned(LEDAnimationMsg::READY)},
// {"ERROR_ANIM_ID", unsigned(LEDAnimationMsg::ERROR)},
// {"MANUAL_ACTION_ANIM_ID", unsigned(LEDAnimationMsg::MANUAL_ACTION)},
// {"AUTONOMOUS_ACTION_ANIM_ID", unsigned(LEDAnimationMsg::AUTONOMOUS_ACTION)},
// {"GOAL_ACHIEVED_ANIM_ID", unsigned(LEDAnimationMsg::GOAL_ACHIEVED)},
// {"LOW_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::LOW_BATTERY)},
// {"CRITICAL_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::CRITICAL_BATTERY)},
// {"BATTERY_STATE_ANIM_ID", unsigned(LEDAnimationMsg::BATTERY_STATE)},
// {"CHARGING_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::CHARGING_BATTERY)},
{"E_STOP_ANIM_ID", unsigned(0)}, // FIXME: temporary solution
{"READY_ANIM_ID", unsigned(1)},
{"ERROR_ANIM_ID", unsigned(2)},
{"MANUAL_ACTION_ANIM_ID", unsigned(3)},
{"LOW_BATTERY_ANIM_ID", unsigned(4)},
{"CRITICAL_BATTERY_ANIM_ID", unsigned(5)},
{"CHARGING_BATTERY_ANIM_ID", unsigned(6)},
{"BATTERY_CHARGED_ANIM_ID", unsigned(7)},
{"CHARGER_INSERTED_ANIM_ID", unsigned(9)},
{"BATTERY_NOMINAL_ANIM_ID", unsigned(10)},
{"AUTONOMOUS_READY_ANIM_ID", unsigned(11)},
{"AUTONOMOUS_ACTION_ANIM_ID", unsigned(12)},
{"GOAL_ACHIEVED_ANIM_ID", unsigned(13)},
{"E_STOP_ANIM_ID", unsigned(LEDAnimationMsg::E_STOP)},
{"READY_ANIM_ID", unsigned(LEDAnimationMsg::READY)},
{"ERROR_ANIM_ID", unsigned(LEDAnimationMsg::ERROR)},
{"MANUAL_ACTION_ANIM_ID", unsigned(LEDAnimationMsg::MANUAL_ACTION)},
{"LOW_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::LOW_BATTERY)},
{"CRITICAL_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::CRITICAL_BATTERY)},
{"CHARGING_BATTERY_ANIM_ID", unsigned(LEDAnimationMsg::CHARGING_BATTERY)},
{"BATTERY_CHARGED_ANIM_ID", unsigned(LEDAnimationMsg::BATTERY_CHARGED)},
{"CHARGER_INSERTED_ANIM_ID", unsigned(LEDAnimationMsg::CHARGER_INSERTED)},
{"BATTERY_NOMINAL_ANIM_ID", unsigned(LEDAnimationMsg::BATTERY_NOMINAL)},
{"AUTONOMOUS_READY_ANIM_ID", unsigned(LEDAnimationMsg::AUTONOMOUS_READY)},
{"AUTONOMOUS_ACTION_ANIM_ID", unsigned(LEDAnimationMsg::AUTONOMOUS_ACTION)},
{"GOAL_ACHIEVED_ANIM_ID", unsigned(LEDAnimationMsg::GOAL_ACHIEVED)},
{"BLINKER_LEFT_ANIM_ID", unsigned(LEDAnimationMsg::BLINKER_LEFT)},
{"BLINKER_RIGHT_ANIM_ID", unsigned(LEDAnimationMsg::BLINKER_RIGHT)},
// battery status constants
{"POWER_SUPPLY_STATUS_UNKNOWN", unsigned(BatteryStateMsg::POWER_SUPPLY_STATUS_UNKNOWN)},
{"POWER_SUPPLY_STATUS_CHARGING", unsigned(BatteryStateMsg::POWER_SUPPLY_STATUS_CHARGING)},
Expand Down
17 changes: 11 additions & 6 deletions husarion_ugv_msgs/msg/LEDAnimation.msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ uint16 E_STOP = 0
uint16 READY = 1
uint16 ERROR = 2
uint16 MANUAL_ACTION = 3
uint16 AUTONOMOUS_ACTION = 4
uint16 GOAL_ACHIEVED = 5
uint16 LOW_BATTERY = 6
uint16 CRITICAL_BATTERY = 7
uint16 BATTERY_STATE = 8
uint16 CHARGING_BATTERY = 9
uint16 LOW_BATTERY = 4
uint16 CRITICAL_BATTERY = 5
uint16 CHARGING_BATTERY = 6
uint16 BATTERY_CHARGED = 7
uint16 CHARGER_INSERTED = 8
uint16 BATTERY_NOMINAL = 9
uint16 AUTONOMOUS_READY = 10
uint16 AUTONOMOUS_ACTION = 11
uint16 GOAL_ACHIEVED = 12
uint16 BLINKER_LEFT = 13
uint16 BLINKER_RIGHT = 14

uint16 id
string param

0 comments on commit 298281f

Please sign in to comment.