CLEARPATH Turtlebot4 User Manual page 102

Table of Contents

Advertisement

ROS2 topic information
Test Create® 3 Button 1
Now that we are subscribed, lets test out our node by printing a message every time button 1 is
pressed.
Edit the
interface_buttons_callback
// Interface buttons subscription callback
void
interface_buttons_callback(
const irobot_create_msgs::msg::InterfaceButtons::SharedPtr create3_buttons_msg)
{
// Button 1 is pressed
if (create3_buttons_msg->button_1.is_pressed) {
RCLCPP_INFO(this->get_logger(),
}
}
function to look like this:
"Button 1
Pressed!");

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Turtlebot 4 lite

Table of Contents