ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

To publish an image, please allocate the shared pointer yourself. I.e.

#include <boost make_shared.hpp="">

sensor_msgs::ImagePtr image = boost::make_shared<sensor_msgs::image> (); image->field = something; // fill your fields. pub.publish (image);

Please prefer std::copy over memcpy. It has as efficient and behave properly on all C++ types unlike memcpy.

To publish an image, please allocate the shared pointer yourself. I.e.

#include <boost make_shared.hpp="">

<boost/make_shared.hpp>

sensor_msgs::ImagePtr image = boost::make_shared<sensor_msgs::image> boost::make_shared<sensor_msgs::Image> (); image->field = something; // fill your fields. pub.publish (image);

(image);

Please prefer std::copy over memcpy. It has as efficient and behave properly on all C++ types unlike memcpy.