11 #include <ros/console.h> 19 const size_t N = msg.points.size();
23 for (
size_t i = 0; i < N; i++)
24 obj.
insertPoint(msg.points[i].x, msg.points[i].y, msg.points[i].z);
31 sensor_msgs::PointCloud& msg)
34 msg.header = msg_header;
37 const size_t N = obj.
size();
39 for (
size_t i = 0; i < N; i++)
41 geometry_msgs::Point32& pt = msg.points[i];
void clear()
Erase all the contents of the map.
void getPoint(size_t index, float &x, float &y, float &z) const
Access to a given point from map, as a 2D point.
void reserve(size_t newLength) override
Reserves memory for a given number of points: the size of the map does not change, it only reserves the memory.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
void insertPoint(float x, float y, float z=0)
Provides a way to insert (append) individual points into the map: the missing fields of child classes...
bool toROS(const mrpt::obs::CObservationGPS &obj, const std_msgs::Header &msg_header, sensor_msgs::NavSatFix &msg)
Convert mrpt::obs::CObservationGPS -> sensor_msgs/NavSatFix The user must supply the "msg_header" fie...
ROS message: http://docs.ros.org/api/sensor_msgs/html/msg/NavSatFix.html MRPT message: https://github...
bool fromROS(const sensor_msgs::NavSatFix &msg, mrpt::obs::CObservationGPS &obj)
Convert sensor_msgs/NavSatFix -> mrpt::obs::CObservationGPS.
size_t size() const
Save the point cloud as a PCL PCD file, in either ASCII or binary format.