Creating sensor_msgs::image from scratch
Hi all,
Since OpenCV is not compiling right on my machine, I want to create and fill a sensor_msgs::Image ( http://docs.ros.org/api/sensor_msgs/h... ) from scratch without using the cv_bridge.
I have 3 pointers to a unsigned char array for each channel:
unsigned char* image_pointer_red
unsigned char* image_pointer_green
unsigned char* image_pointer_blue
I have no idea how to fill the fields appropriately in the sensor_msgs::Image message:
string encoding # Encoding of pixels -- channel meaning, ordering, size
# taken from the list of strings in include/sensor_msgs/image_encodings.h
uint8 is_bigendian # is this data bigendian?
uint32 step # Full row length in bytes
uint8[] data # actual matrix data, size is (step * rows)
How should the 'encoding' string be encoded? What is meant by bigendian? What does the full row length in bytes imply? How do I fill the data field appropriately?
I tried searching for examples, there aren't any. They all refer to use the cv_bridge package.
Best, Ruud