add test print
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -328,3 +328,5 @@ tags
|
|||||||
.ionide
|
.ionide
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/ros2,ros,cmake,c++,python,visualstudiocode,vim
|
# End of https://www.toptal.com/developers/gitignore/api/ros2,ros,cmake,c++,python,visualstudiocode,vim
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#include <chrono> //time measurement
|
#include <chrono> //time measurement
|
||||||
|
#include <iostream> // reading from serial port
|
||||||
|
|
||||||
#include "rclcpp/rclcpp.hpp"
|
#include "rclcpp/rclcpp.hpp"
|
||||||
#include "std_msgs/msg/string.hpp"
|
#include "std_msgs/msg/string.hpp"
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals; // for time measurements
|
||||||
|
|
||||||
class HeightSensorPublisher : public rclcpp::Node
|
class HeightSensorPublisher : public rclcpp::Node
|
||||||
{
|
{
|
||||||
@@ -13,6 +14,7 @@ class HeightSensorPublisher : public rclcpp::Node
|
|||||||
publisher_ = this->create_publisher<std_msgs::msg::String>("height_sensor", 10);
|
publisher_ = this->create_publisher<std_msgs::msg::String>("height_sensor", 10);
|
||||||
timer_ = this->create_wall_timer(
|
timer_ = this->create_wall_timer(
|
||||||
500ms, std::bind(&HeightSensorPublisher::timer_callback, this));
|
500ms, std::bind(&HeightSensorPublisher::timer_callback, this));
|
||||||
|
RCLCPP_INFO(this->get_logger(), "Constructor of height sensor publisher");
|
||||||
|
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user