Slide 14
Slide 14 text
MJTUFOFSDQQ
void chatterCallback(const std_msgs::msg::String::SharedPtr msg) {
std::cout << "I heard: [" << msg->data << "]" << std::endl;
}
int main(int argc, char * argv[]) {
rclcpp::init(argc, argv);
auto node = rclcpp::Node::make_shared("listener");
auto topic = std::string("chatter");
auto sub = node->create_subscription(
topic, chatterCallback, rmw_qos_profile_default);
rclcpp::spin(node);
return 0;
}
IUUQTHJUIVCDPNSPTEFNPTCMPCNBTUFS
EFNP@OPEFT@DQQTSDUPQJDTMJTUFOFSDQQ