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

Revision history [back]

click to hide/show revision 1
initial version

push_back expects the pushed data to be of the type defined by the std::vector<type> that handle the array. PointCloud points array is defined as an array of geometry_msgs/Point32 so you have to use it instead of your custom data structure.

PointCloud doc : http://docs.ros.org/api/sensor_msgs/html/msg/PointCloud.html

push_back expects the pushed data to be of the type defined by the std::vector<type> that handle the array. PointCloud points array is defined as an array of geometry_msgs/Point32 so you have to use it instead of your custom data structure.

PointCloud doc : http://docs.ros.org/api/sensor_msgs/html/msg/PointCloud.html

EDIT : If you want to display several markers, you may look at MarkerArray message. If you just want to convert from Point to Point32, you may just fill fields with the corresponding data (the structure are the same), and checking that your conversion doesn't lose data (from float64 to float32)

You should really have a look at message documentation : http://wiki.ros.org/geometry_msgs, http://wiki.ros.org/sensor_msgs, ... so that you can choose the relevant message for you application.