Lighting Effects

The API of the lighting effects can fully control 104 LED beads of the entire machine, allowing you to exchange colors, gradient effects, and so on.

API Details

Front Light Effects Control

Function Overview:Control the Front Light Effects via Topic

Topic:interaction/light_control/head_light_control

Msg type:tita_interaction_msgs::msg::HeadLightControl

Code Example:

Control:ros2 topic pub /[namespace]/interaction/light_control/head_light_control tita_interaction_msgs/msg/HeadLightControl "{is_control: true, select_light_effect: 0, rgbl_value: [0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff]}" -1

Inquiry:

ros2 topic echo /[namespace]/interaction/light_control/head_light_control

Value Range:Bool is_control, uin8_t select_light_effect, uint32 rgbl_value[48]

The is_control parameter should be set to true when control is needed and to false when control is relinquished.

The select_light_effect currently only takes the value 0, which represents a constant brightness.

In the uint32_t type rgbl[48] array, each element represents the red, green, blue, and brightness values for an individual LED bead. For example, a color value of 0xfe00ff80U for a certain LED bead indicates red: 254 (0xfeU), green: 0 (0x00U), blue: 255 (0xffU), and brightness: 128 (0x80U), which together present a specific color.

Rear Light Effects Control

Function Overview:Control the Rear Light Effects via Topic

Topic:interaction/light_control/tail_light_control

Msg Type:tita_interaction_msgs::msg::TailLightControl

Code Example:

Control:ros2 topic pub /[namespace]/interaction/light_control/tail_light_control tita_interaction_msgs/msg/TailLightControl "{is_control: true, select_light_effect: 0, rgbl_value: [0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff]}" -1

Inquiry:

ros2 topic echo /[namespace]/interaction/light_control/tail_light_control

Value Range:Bool is_control,,uint8_t select_light_effect,uin32_t rgbl_value[36]

Leg Light Effects Control

Function Overview:Control the Leg Light Effects via Topic

Topic:interaction/light_control/leg_light_control

Msg Type:tita_interaction_msgs::msg::LegLightControl

Code Example:

Control:ros2 topic pub /[namespace]/interaction/light_control/leg_light_control tita_interaction_msgs/msg/LegLightControl "{select_leg_board: 1, is_control: true, select_light_effect: 0, rgb_value: [0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff, 0xff00ffff, 0x00ffffff,0xffff00ff]}" -1

Inquiry:ros2 topic echo /[namespace]action/light_control/leg_light_control

Value Range:uint8 select_leg_board,bool is_control,uint8 select_light_effect, uint32[10] rgb_value

The basic control is the same as mentioned earlier. Set select_leg_board to 1 for the robot's left leg and to 2 for the right leg.

The select_light_effect currently as a default value of 0, which represents a constant brightness.

Please note that the uint32_t rgb_value[10] only represents the red, green, and blue values, without brightness, as it is just a placeholder to fill the uint32_t. For example, a color value of 0xfe00ff80U for a certain LED bead indicates red: 254 (0xfeU), green: 0 (0x00U), blue: 255 (0xffU), and brightness: (default value is meaningless) for the overall presented color. For the LED beads on the legs, the higher the values of red, green, and blue you set, the brighter the corresponding LED bead will be, and vice versa, the lower the values, the dimmer the LED bead will be.

Lighting Effects Switch

Function Overview:You can control the power of the entire machine's light boards.

Topic:interaction/light_control/light_power_switch

Msg Type:tita_interaction_msgs::msg::LightPowerSwitch

Code Example:

Control:ros2 topic pub /[namespace]/interaction/light_control/light_power_switch tita_interaction_msgs/msg/LightPowerSwitch "{is_head_light_power_on: true, is_tail_light_power_on: true, is_left_light_power_on: true, is_right_light_power_on: true}" -1

Inquiry:ros2 topic echo /titaxxxxx(对应的tita ID)/interaction/light_control/light_power_switch

Value Range:

bool is_head_light_power_on

bool is_tail_light_power_on

bool is_left_light_power_on

bool is_right_light_power_on

The default setting is true for all. Wherever you want to turn off the lights, set it to false.

All machine lighting effect control

Function Overview:Control the state pointer of the entire machine's light board state machine.

Topic:interaction/light_control/light_fsm_control

Msg Type:tita_interaction_msgs::msg::LightFsmControl

Code Example:

Control:ros2 topic pub /[namespace]/interaction/light_control/light_fsm_control tita_interaction_msgs/msg/LightFsmControl "{head_light_fsm: 1, tail_light_fsm: 1, left_leg_light_fsm: 1, right_leg_light_fsm: 1, head_fsm_lock: false, tail_fsm_lock: false, left_leg_fsm_lock: false, right_leg_fsm_lock: false}" -1

Inquiry:ros2 topic echo /[namespace]/interaction/light_control/light_fsm_control tita_interaction_msgs/msg/LightFsmControl

Value Range:

  1. head_light_fsm,tail_light_fsm,left_leg_light_fsm,right_leg_fsm, value:0~255

  2. head_fsm_lock,tail_fsm_lock,left_fsm_lock,right_fsm_lock, all bool

General inquiries are fine; control is used for debugging.

The fsm_lock is used to lock the current state of the state machine, causing the robot to repeat the lighting effect for debugging purposes.

Last updated