3 #include "sensor_msgs/Image.h" 5 int main(
int argc,
char** argv )
15 sensor_msgs::Image red_image;
16 red_image.header.frame_id =
"/base_link";
18 red_image.height = 100;
19 red_image.width = 100;
20 red_image.encoding =
"rgb8";
21 red_image.step = 3 * red_image.height;
23 red_image.data.resize(3 * red_image.height * red_image.width);
24 for (uint32_t i = 0; i < 3 * red_image.height * red_image.width; ++i)
28 red_image.data[i] = 255;
32 red_image.data[i] = 0;
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)