Skip to content

Commit

Permalink
Print message to logger when publishing starts
Browse files Browse the repository at this point in the history
  • Loading branch information
OZiad committed Feb 27, 2024
1 parent db07c3a commit 485fed1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Empty file removed new-code/src/gps/COLCON_IGNORE
Empty file.
2 changes: 1 addition & 1 deletion new-code/src/gps/src/gpsPublisherNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
gpsPublisherNode::gpsPublisherNode(const std::string& gpsTopic) : Node("gpsPublisherNode")
{
publisher_ = this->create_publisher<NavSatFix>(gpsTopic, 10);
RCLCPP_INFO(this->get_logger(), "Started publishing GPS data to %s", gpsTopic.c_str());
timer_ =
this->create_wall_timer(std::chrono::milliseconds(500), std::bind(&gpsPublisherNode::publishGpsData, this));

}

void gpsPublisherNode::publishGpsData()
Expand Down
3 changes: 3 additions & 0 deletions new-code/src/gps/src/gpsPublisherNode.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#pragma once

#include <string>
#include <chrono>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "sensor_msgs/msg/nav_sat_fix.hpp"
Expand Down

0 comments on commit 485fed1

Please sign in to comment.