EasyManua.ls Logo

CLEARPATH Turtlebot4 - Page 125

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 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
# Lights are currently on
else:
# Disable system override. The system will take back control of the lightring.
lightring_msg.override_system = False
# Publish the message
self.lightring_publisher.publish(lightring_msg)
# Toggle the lights on status
self.lights_on_ = not self.lights_on_
def main(args=None):
rclpy.init(args=args)
node = TurtleBot4FirstNode()
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()