10 #include <sensor_msgs/PointCloud2.h> 12 #include <nav_msgs/Odometry.h> 18 #include <pcl/point_cloud.h> 19 #include <pcl/point_types.h> 59 m_tfGlobal.reset(
new geometry_msgs::TransformStamped());
71 ROS_INFO(
"Exact Synchronization Policy chosen");
76 ROS_INFO(
"Approximate Synchronization Policy chosen");
84 const sensor_msgs::PointCloud2ConstPtr & edges_msg,
85 const sensor_msgs::PointCloud2ConstPtr & surfaces_msg)
88 pcl::PointCloud<pcl::PointXYZ>::Ptr pointcloud_surf_in(
new pcl::PointCloud<pcl::PointXYZ>());
89 pcl::PointCloud<pcl::PointXYZ>::Ptr pointcloud_edge_in(
new pcl::PointCloud<pcl::PointXYZ>());
94 ros::Time pointcloud_time = edges_msg->header.stamp;
102 std::chrono::time_point<std::chrono::system_clock>
start, end;
103 start = std::chrono::system_clock::now();
105 end = std::chrono::system_clock::now();
107 std::chrono::duration<float> elapsed_seconds = end - start;
109 float time_temp = elapsed_seconds.count() * 1000;
126 m_tfGlobal->header.stamp = edges_msg->header.stamp;
131 nav_msgs::Odometry lidarOdometry;
133 lidarOdometry.child_frame_id =
m_frameId;
134 lidarOdometry.header.stamp = pointcloud_time;
135 lidarOdometry.pose.pose.orientation.x =
m_tfGlobal->transform.rotation.x;
136 lidarOdometry.pose.pose.orientation.y =
m_tfGlobal->transform.rotation.y;
137 lidarOdometry.pose.pose.orientation.z =
m_tfGlobal->transform.rotation.z;
138 lidarOdometry.pose.pose.orientation.w =
m_tfGlobal->transform.rotation.w;
139 lidarOdometry.pose.pose.position.x =
m_tfGlobal->transform.translation.x;
140 lidarOdometry.pose.pose.position.y =
m_tfGlobal->transform.translation.y;
141 lidarOdometry.pose.pose.position.z =
m_tfGlobal->transform.translation.z;
ros::NodeHandle m_nodeHandle
geometry_msgs::TransformStampedPtr m_tfGlobal
ROS Transorm.
void handleClouds(const sensor_msgs::PointCloud2ConstPtr &edges, const sensor_msgs::PointCloud2ConstPtr &surfaces)
void init(const double &mapResolution)
Eigen::Map< Eigen::Quaterniond > m_currentRotation
std::shared_ptr< ApproximateSynchronizer > m_approximateSync
floam::lidar::Total m_totals
void fromROSMsg(const sensor_msgs::PointCloud2 &cloud, pcl::PointCloud< T > &pcl_cloud)
ros::NodeHandle & getPrivateNodeHandle() const
std::shared_ptr< ExactSynchronizer > m_exactSync
void updatePointsToMap(const pcl::PointCloud< pcl::PointXYZ >::Ptr &edges, const pcl::PointCloud< pcl::PointXYZ >::Ptr &surfaces)
void initMapWithPoints(const pcl::PointCloud< pcl::PointXYZ >::Ptr &edges, const pcl::PointCloud< pcl::PointXYZ >::Ptr &surfaces)
void publish(const boost::shared_ptr< M > &message) const
message_filters::Subscriber< sensor_msgs::PointCloud2 > m_subSurfaces
bool getParam(const std::string &key, std::string &s) const
message_filters::Subscriber< sensor_msgs::PointCloud2 > m_subEdges
message_filters::Synchronizer< ExactSyncPolicy > ExactSynchronizer
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
message_filters::Synchronizer< ApproximateSyncPolicy > ApproximateSynchronizer
floam::odom::OdomEstimation m_odomEstimation
#define ROS_INFO_STREAM(args)
void subscribe(ros::NodeHandle &nh, const std::string &topic, uint32_t queue_size, const ros::TransportHints &transport_hints=ros::TransportHints(), ros::CallbackQueueInterface *callback_queue=0)
const std::string & getNamespace() const
message_filters::sync_policies::ExactTime< sensor_msgs::PointCloud2, sensor_msgs::PointCloud2 > ExactSyncPolicy
ros::Publisher m_pubLidarOdometry
PLUGINLIB_EXPORT_CLASS(floam::lidar::LidarMappingNode, nodelet::Nodelet)
std::string m_parentFrameId
Major rewrite Author: Evan Flynn.
Eigen::Map< Eigen::Vector3d > m_currentTranslation
message_filters::sync_policies::ApproximateTime< sensor_msgs::PointCloud2, sensor_msgs::PointCloud2 > ApproximateSyncPolicy