laser_ortho_projector.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, 2011, Ivan Dryanovski, William Morris
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the CCNY Robotics Lab nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef LASER_ORTHO_PROJECTOR_LASER_ORTHO_PROJECTOR_H
31 #define LASER_ORTHO_PROJECTOR_LASER_ORTHO_PROJECTOR_H
32 
33 #include <limits>
34 #include <ros/ros.h>
35 #include <geometry_msgs/Point32.h>
36 #include <geometry_msgs/PoseStamped.h>
37 #include <sensor_msgs/LaserScan.h>
38 #include <sensor_msgs/Imu.h>
39 #include <sensor_msgs/PointCloud2.h>
40 #include <tf/transform_listener.h>
42 #include <tf/message_filter.h>
44 #include <pcl/io/pcd_io.h>
45 #include <pcl/point_types.h>
46 #include <pcl/point_cloud.h>
47 #include <pcl_ros/point_cloud.h>
48 
49 namespace scan_tools {
50 
52 {
53  typedef pcl::PointXYZ PointT;
54  typedef pcl::PointCloud<PointT> PointCloudT;
55 
56  typedef geometry_msgs::PoseStamped PoseMsg;
57  typedef sensor_msgs::Imu ImuMsg;
58 
59  public:
60 
62  virtual ~ LaserOrthoProjector ();
63 
64  private:
65 
66  // **** ROS-related
67 
70 
72 
76 
79 
80  // **** paramaters
81 
82  std::string world_frame_;
83  std::string base_frame_;
84  std::string ortho_frame_;
85 
87  bool use_pose_;
88  bool use_imu_;
89 
90  // **** state variables
91 
93 
94  std::vector<double> a_sin_;
95  std::vector<double> a_cos_;
96 
97  PointT nan_point_;
98 
99  tf::Transform base_to_laser_; // static, cached
100  tf::Transform ortho_to_laser_; // computed from b2l, w2b, w2o
101 
102  void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_msg);
103  void poseCallback (const PoseMsg::ConstPtr& pose_msg);
104  void imuCallback (const ImuMsg::ConstPtr& imu_msg);
105  void getOrthoTf(const tf::Transform& world_to_base, tf::Transform& world_to_ortho);
106  bool getBaseToLaserTf (const sensor_msgs::LaserScan::ConstPtr& scan_msg);
107  void createCache (const sensor_msgs::LaserScan::ConstPtr& scan_msg);
108 
109 
110 };
111 
112 } // namespace scan_tools
113 
114 #endif // LASER_ORTHO_PROJECTOR_LASER_ORTHO_PROJECTOR_H
bool getBaseToLaserTf(const sensor_msgs::LaserScan::ConstPtr &scan_msg)
pcl::PointCloud< PointT > PointCloudT
void scanCallback(const sensor_msgs::LaserScan::ConstPtr &scan_msg)
void getOrthoTf(const tf::Transform &world_to_base, tf::Transform &world_to_ortho)
tf::TransformBroadcaster tf_broadcaster_
geometry_msgs::PoseStamped PoseMsg
LaserOrthoProjector(ros::NodeHandle nh, ros::NodeHandle nh_private)
void createCache(const sensor_msgs::LaserScan::ConstPtr &scan_msg)
void imuCallback(const ImuMsg::ConstPtr &imu_msg)
void poseCallback(const PoseMsg::ConstPtr &pose_msg)


laser_ortho_projector
Author(s): Ivan Dryanovski, William Morris
autogenerated on Mon Jun 10 2019 15:08:37