34 #include <opencv2/highgui/highgui.hpp>
40 #include <boost/format.hpp>
42 #include <std_srvs/Empty.h>
43 #include <std_srvs/Trigger.h>
52 bool service(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res) {
65 std_srvs::Trigger::Response &res)
67 ROS_INFO(
"Received start saving request");
76 std_srvs::Trigger::Response &res)
78 ROS_INFO(
"Received end saving request");
152 ROS_ERROR(
"Unable to convert %s image to %s", image_msg->encoding.c_str(),
encoding.c_str());
156 if (!image.empty()) {
170 std::stringstream ss;
172 std::string timestamp_str = ss.str();
184 ROS_WARN(
"Couldn't save image, no data!");
198 int main(
int argc,
char** argv)
215 std::string format_string;
216 local_nh.
param(
"filename_format", format_string, std::string(
"left%04i.%s"));
225 ROS_WARN(
"'request_start_end' is true, so overwriting 'save_all_image' as true");