CLEARPATH Turtlebot4 User Manual page 115

Table of Contents

Advertisement

Subscribe to the Create® 3 interface buttons
Our next step is to subscribe to the Create® 3 interface buttons topic to receive button presses.
We will need to create a
The callback function will be called every time we receive a message on the interface buttons
topic.
def __init__(self):
super().__init__('turtlebot4_first_python_node')
# Interface buttons subscription callback
def interface_buttons_callback(self, create3_buttons_msg: InterfaceButtons):
Notice that the
interface_buttons_subscriber
quality of service is qos_profile_sensor_data. These parameters must match the topic,
otherwise the subscription will fail. If you are unsure what message type or QoS a topic is using,
you can use the ROS2 CLI to find this information.
Call
ros2 topic info /<topic> --verbose
rclpy.Subscription
as well as a callback function for the subscription.
to get the full details.
uses the
InterfaceButtons
message type, and the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Turtlebot4 and is the answer not in the manual?

This manual is also suitable for:

Turtlebot 4 lite

Table of Contents