30 #ifndef LASER_SCAN_UTILS_LASERSCAN_H 31 #define LASER_SCAN_UTILS_LASERSCAN_H 37 #include "boost/numeric/ublas/matrix.hpp" 38 #include "boost/thread/mutex.hpp" 43 #include "sensor_msgs/LaserScan.h" 44 #include "sensor_msgs/PointCloud.h" 45 #include "sensor_msgs/PointCloud.h" 48 #include <sensor_msgs/PointCloud2.h> 54 #ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries 55 #ifdef laser_geometry_EXPORTS // we are building a shared lib/dll 56 #define LASER_GEOMETRY_DECL ROS_HELPER_EXPORT 57 #else // we are using shared lib/dll 58 #define LASER_GEOMETRY_DECL ROS_HELPER_IMPORT 60 #else // ros is being built around static libraries 61 #define LASER_GEOMETRY_DECL 71 namespace channel_option
140 sensor_msgs::PointCloud& cloud_out,
141 double range_cutoff = -1.0,
144 return projectLaser_ (scan_in, cloud_out, range_cutoff,
false, channel_options);
164 sensor_msgs::PointCloud2 &cloud_out,
165 double range_cutoff = -1.0,
168 projectLaser_(scan_in, cloud_out, range_cutoff, channel_options);
194 const sensor_msgs::LaserScan& scan_in,
195 sensor_msgs::PointCloud& cloud_out,
200 return transformLaserScanToPointCloud_ (target_frame, cloud_out, scan_in, tf, range_cutoff, channel_options);
223 const sensor_msgs::LaserScan& scan_in,
224 sensor_msgs::PointCloud& cloud_out,
228 return transformLaserScanToPointCloud_ (target_frame, cloud_out, scan_in, tf, -1.0, channel_options);
254 const sensor_msgs::LaserScan &scan_in,
255 sensor_msgs::PointCloud2 &cloud_out,
257 double range_cutoff = -1.0,
260 transformLaserScanToPointCloud_(target_frame, scan_in, cloud_out, tf, range_cutoff, channel_options);
286 const sensor_msgs::LaserScan &scan_in,
287 sensor_msgs::PointCloud2 &cloud_out,
289 double range_cutoff = -1.0,
292 transformLaserScanToPointCloud_(target_frame, scan_in, cloud_out, tf, range_cutoff, channel_options);
303 const boost::numeric::ublas::matrix<double>& getUnitVectors_(
double angle_min,
305 double angle_increment,
311 void projectLaser_ (
const sensor_msgs::LaserScan& scan_in,
312 sensor_msgs::PointCloud& cloud_out,
315 int channel_options);
318 void projectLaser_ (
const sensor_msgs::LaserScan& scan_in,
319 sensor_msgs::PointCloud2 &cloud_out,
321 int channel_options);
324 void transformLaserScanToPointCloud_ (
const std::string& target_frame,
325 sensor_msgs::PointCloud& cloud_out,
326 const sensor_msgs::LaserScan& scan_in,
329 int channel_options);
332 void transformLaserScanToPointCloud_ (
const std::string &target_frame,
333 const sensor_msgs::LaserScan &scan_in,
334 sensor_msgs::PointCloud2 &cloud_out,
337 int channel_options);
340 void transformLaserScanToPointCloud_ (
const std::string &target_frame,
341 const sensor_msgs::LaserScan &scan_in,
342 sensor_msgs::PointCloud2 &cloud_out,
345 int channel_options);
348 void transformLaserScanToPointCloud_ (
const std::string &target_frame,
349 const sensor_msgs::LaserScan &scan_in,
350 sensor_msgs::PointCloud2 &cloud_out,
352 tf2::Vector3 origin_start,
354 tf2::Vector3 origin_end,
356 int channel_options);
368 #endif //LASER_SCAN_UTILS_LASERSCAN_H void projectLaser(const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, double range_cutoff=-1.0, int channel_options=channel_option::Default)
Project a sensor_msgs::LaserScan into a sensor_msgs::PointCloud.
void projectLaser(const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud2 &cloud_out, double range_cutoff=-1.0, int channel_options=channel_option::Default)
Project a sensor_msgs::LaserScan into a sensor_msgs::PointCloud2.
#define LASER_GEOMETRY_DECL
A Class to Project Laser Scan.
const float LASER_SCAN_INVALID
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud2 &cloud_out, tf::Transformer &tf, double range_cutoff=-1.0, int channel_options=channel_option::Default)
Transform a sensor_msgs::LaserScan into a sensor_msgs::PointCloud2 in target frame.
std::map< std::string, boost::numeric::ublas::matrix< double > * > unit_vector_map_
Internal map of pointers to stored values.
Eigen::ArrayXXd co_sine_map_
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud2 &cloud_out, tf2::BufferCore &tf, double range_cutoff=-1.0, int channel_options=channel_option::Default)
Transform a sensor_msgs::LaserScan into a sensor_msgs::PointCloud2 in target frame.
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, tf::Transformer &tf, int channel_options=channel_option::Default)
Transform a sensor_msgs::LaserScan into a sensor_msgs::PointCloud in target frame.
Enable "intensities" and "index" channels.
ChannelOption
Enumerated output channels options.
Enable "viewpoint" channel.
const float LASER_SCAN_MAX_RANGE
const float LASER_SCAN_MIN_RANGE
Enable "intensities" channel.
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
Enable "distances" channel.
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, tf::Transformer &tf, double range_cutoff, int channel_options=channel_option::Default)
Transform a sensor_msgs::LaserScan into a sensor_msgs::PointCloud in target frame.