Go to the documentation of this file. 1 #include <ros/console.h>
2 #include <ros/duration.h>
4 #include <ros/master.h>
6 #include <ros/node_handle.h>
16 #include <std_msgs/String.h>
28 ros::NodeHandle nh_private(
"~");
29 nh_private.getParam(
"rate",
rate_);
46 ros::WallTime last_master_check = ros::WallTime::now();
51 if (ros::WallTime::now() >= last_master_check + ros::WallDuration(1))
53 last_master_check = ros::WallTime::now();
54 if (!ros::master::check())
56 ROS_FATAL(
"Lost connection to master");
90 int main(
int argc,
char **argv)
92 ros::init(argc, argv,
"rgbd_to_shm");
bool nextImage(Image &image)
Get a new Image. If no new image has been received since the last call, no image will be written and ...
std::string get_hostname()
Get the hostname of the current machine.
const std::string server_name_
void pubHostnameThreadFunc(ros::NodeHandle &nh, const std::string server_name, const std::string hostname, const float frequency)
const std::string host_name_
void send(const Image &image)
send Write a new image to the shared memory
bool initialize(const std::string &server_name)
Initialize the client.
Client which subscribes to RGBD topic.
void initialize(const std::string &name)
initialize Initialize shared memory server
int main(int argc, char **argv)
Server which uses shared memory, this only works for clients on the same machine.
std::unique_ptr< std::thread > pub_hostname_thread_ptr_