add more printfs

This commit is contained in:
Sem van der Hoeven
2023-04-13 16:30:42 +02:00
parent 54fc6cae86
commit 0391f1f3ec

View File

@@ -10,6 +10,7 @@ class BeaconPositioningPublisher : public rclcpp::Node
{
public:
BeaconPositioningPublisher() : Node("beacon_positioning_publisher") {
printf("Constructor of beacon positioning publisher\n");
publisher_ = this->create_publisher<std_msgs::msg::String>("beacon_positioning", 10);
timer_ = this->create_wall_timer(
500ms, std::bind(&BeaconPositioningPublisher::timer_callback, this));
@@ -20,6 +21,7 @@ class BeaconPositioningPublisher : public rclcpp::Node
message.data = "Hello beacons!";
RCLCPP_INFO(this->get_logger(), "Publishing: '%s'", message.data.c_str());
publisher_->publish(message);
printf("published message yeet");
}
rclcpp::TimerBase::SharedPtr timer_; // timer to trigger the
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_; // pointer to publisher object
@@ -34,6 +36,8 @@ int main(int argc, char ** argv)
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<BeaconPositioningPublisher>());
printf("spun node");
rclcpp::shutdown();
printf("shut down rclcpp");
return 0;
}