EasyManua.ls Logo

CLEARPATH Turtlebot4 - Page 119

Default Icon
153 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
# LED 1
lightring_msg.leds[1].red = 0
lightring_msg.leds[1].blue = 255
lightring_msg.leds[1].green = 0
# LED 2
lightring_msg.leds[2].red = 0
lightring_msg.leds[2].blue = 0
lightring_msg.leds[2].green = 255
# LED 3
lightring_msg.leds[3].red = 255
lightring_msg.leds[3].blue = 255
lightring_msg.leds[3].green = 0
# LED 4
lightring_msg.leds[4].red = 255
lightring_msg.leds[4].blue = 0
lightring_msg.leds[4].green = 255
# LED 5
lightring_msg.leds[5].red = 0
lightring_msg.leds[5].blue = 255
lightring_msg.leds[5].green = 255
# Publish the message
self.lightring_publisher.publish(lightring_msg)
This function creates a LightringLeds message and populates the parameters.
We first stamp the message with the current time:
lightring_msg.header.stamp = self.get_clock().now().to_msg()
Then we set the override_system parameter to True so that our command overrides whatever
commands the Create® 3 is sending to the lightring.
lightring_msg.override_system = True