Fixes from converting from pcl-1.7, incomplete

This commit is contained in:
William Woodall
2013-07-08 16:36:28 -07:00
committed by Paul Bovbel
parent 9d08dd5198
commit a931106c5b
11 changed files with 54 additions and 29 deletions
+4 -1
View File
@@ -49,6 +49,9 @@
#include <dynamic_reconfigure/server.h>
#include "pcl_ros/FeatureConfig.h"
// PCL conversions
#include <pcl_conversions/pcl_conversions.h>
namespace pcl_ros
{
namespace sync_policies = message_filters::sync_policies;
@@ -147,7 +150,7 @@ namespace pcl_ros
input_callback (const PointCloudInConstPtr &input)
{
PointIndices indices;
indices.header.stamp = input->header.stamp;
indices.header.stamp = pcl_conversions::fromPCL(input->header).stamp;
PointCloudIn cloud;
cloud.header.stamp = input->header.stamp;
nf_pc_.add (cloud.makeShared ());
+14 -6
View File
@@ -37,8 +37,12 @@
#ifndef pcl_ros_IMPL_TRANSFORMS_H_
#define pcl_ros_IMPL_TRANSFORMS_H_
#include <pcl_conversions/pcl_conversions.h>
#include "pcl_ros/transforms.h"
using pcl_conversions::fromPCL;
using pcl_conversions::toPCL;
namespace pcl_ros
{
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -99,7 +103,7 @@ transformPointCloudWithNormals (const std::string &target_frame,
tf::StampedTransform transform;
try
{
tf_listener.lookupTransform (target_frame, cloud_in.header.frame_id, cloud_in.header.stamp, transform);
tf_listener.lookupTransform (target_frame, cloud_in.header.frame_id, fromPCL(cloud_in.header).stamp, transform);
}
catch (tf::LookupException &e)
{
@@ -133,7 +137,7 @@ transformPointCloud (const std::string &target_frame,
tf::StampedTransform transform;
try
{
tf_listener.lookupTransform (target_frame, cloud_in.header.frame_id, cloud_in.header.stamp, transform);
tf_listener.lookupTransform (target_frame, cloud_in.header.frame_id, fromPCL(cloud_in.header).stamp, transform);
}
catch (tf::LookupException &e)
{
@@ -162,7 +166,7 @@ transformPointCloud (const std::string &target_frame,
tf::StampedTransform transform;
try
{
tf_listener.lookupTransform (target_frame, target_time, cloud_in.header.frame_id, cloud_in.header.stamp, fixed_frame, transform);
tf_listener.lookupTransform (target_frame, target_time, cloud_in.header.frame_id, fromPCL(cloud_in.header).stamp, fixed_frame, transform);
}
catch (tf::LookupException &e)
{
@@ -177,7 +181,9 @@ transformPointCloud (const std::string &target_frame,
transformPointCloud (cloud_in, cloud_out, transform);
cloud_out.header.frame_id = target_frame;
cloud_out.header.stamp = target_time;
std_msgs::Header header;
header.stamp = target_time;
cloud_out.header = toPCL(header);
return (true);
}
@@ -193,7 +199,7 @@ transformPointCloudWithNormals (const std::string &target_frame,
tf::StampedTransform transform;
try
{
tf_listener.lookupTransform (target_frame, target_time, cloud_in.header.frame_id, cloud_in.header.stamp, fixed_frame, transform);
tf_listener.lookupTransform (target_frame, target_time, cloud_in.header.frame_id, fromPCL(cloud_in.header).stamp, fixed_frame, transform);
}
catch (tf::LookupException &e)
{
@@ -208,7 +214,9 @@ transformPointCloudWithNormals (const std::string &target_frame,
transformPointCloudWithNormals (cloud_in, cloud_out, transform);
cloud_out.header.frame_id = target_frame;
cloud_out.header.stamp = target_time;
std_msgs::Header header;
header.stamp = target_time;
cloud_out.header = toPCL(header);
return (true);
}
+6 -3
View File
@@ -46,9 +46,10 @@
#include <sensor_msgs/PointCloud2.h>
// PCL includes
#include <pcl/PointIndices.h>
#include <pcl_msgs/PointIndices.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
#include "pcl_ros/point_cloud.h"
// ROS Nodelet includes
#include <nodelet/nodelet.h>
@@ -60,6 +61,8 @@
// Include TF
#include <tf/transform_listener.h>
using pcl_conversions::fromPCL;
namespace pcl_ros
{
////////////////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +78,7 @@ namespace pcl_ros
typedef PointCloud::Ptr PointCloudPtr;
typedef PointCloud::ConstPtr PointCloudConstPtr;
typedef pcl::PointIndices PointIndices;
typedef pcl_msgs::PointIndices PointIndices;
typedef PointIndices::Ptr PointIndicesPtr;
typedef PointIndices::ConstPtr PointIndicesConstPtr;
@@ -157,7 +160,7 @@ namespace pcl_ros
{
if (cloud->width * cloud->height != cloud->points.size ())
{
NODELET_WARN ("[%s] Invalid PointCloud (points = %zu, width = %d, height = %d) with stamp %f, and frame %s on topic %s received!", getName ().c_str (), cloud->points.size (), cloud->width, cloud->height, cloud->header.stamp.toSec (), cloud->header.frame_id.c_str (), pnh_->resolveName (topic_name).c_str ());
NODELET_WARN ("[%s] Invalid PointCloud (points = %zu, width = %d, height = %d) with stamp %f, and frame %s on topic %s received!", getName ().c_str (), cloud->points.size (), cloud->width, cloud->height, fromPCL(cloud->header).stamp.toSec (), cloud->header.frame_id.c_str (), pnh_->resolveName (topic_name).c_str ());
return (false);
}
+2 -1
View File
@@ -46,7 +46,8 @@
#define PCL_ROS_PUBLISHER_H_
#include <ros/ros.h>
#include <pcl/ros/conversions.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl/conversions.h>
namespace pcl_ros
{