From 6a9821bf398f9bfdbd5c89c69092f596744c201a Mon Sep 17 00:00:00 2001 From: yul Date: Mon, 5 Feb 2024 06:15:02 +0100 Subject: [PATCH] . --- src/tutorial_pkg/src/my_first_node.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tutorial_pkg/src/my_first_node.cpp b/src/tutorial_pkg/src/my_first_node.cpp index 44c2b9c..864288a 100644 --- a/src/tutorial_pkg/src/my_first_node.cpp +++ b/src/tutorial_pkg/src/my_first_node.cpp @@ -1,9 +1,10 @@ #include #include #include -#include "std_srvs/Empty.h" +#include ros::Publisher brightness_pub; +ros::ServiceClient client; void imageCallback(const sensor_msgs::ImageConstPtr &image) { @@ -38,6 +39,7 @@ int main(int argc, char **argv) ros::Subscriber sub = n.subscribe("/camera/color/image_raw", 10, imageCallback); brightness_pub = n.advertise("brightness", 1); ros::Timer timer = n.createTimer(ros::Duration(timer_period_s), timerCallback); + client = n.serviceClient("/image_saver/save"); ROS_INFO("Node started!"); ros::spin();