ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Okay, I'm getting closer as I have added a third nodelet to the turtlebot pointcloud_to_laserscan package for the pointCloud tilt function, but I am stuck on a boost shared pointer that I can't pass directly into the transformPointCloud function in the PointCloud subscriber callback ...

  void callback(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr& cloud_in)
  {
    pcl::PointCloud<pcl::PointXYZ> cloud_out;
    //pcl::PointCloud<pcl::PointXYZ> cloud_test;
    std::string tgtFrame = "base_footprint";
    NODELET_DEBUG("CloudTilt callback");
    try
     {
       result = pcl_ros::transformPointCloud(tgtFrame, cloud_in, cloud_out, tfListener);
     }
     catch (tf::TransformException& e)
     {
        std::cout << e.what();
        return;
     }
     //Publish transformed pointCloud
     pub_.publish(cloud_out);
  } //callback

Error message: /opt/ros/dturtle/turtlebot/pointcloud_to_laserscan/src/cloud_tilt.cpp: In member function ‘void pointcloud_to_laserscan::CloudTilt::callback(const boost::shared_ptr<const pcl::pointcloud<pcl::pointxyz=""> >&)’: /opt/ros/dturtle/turtlebot/pointcloud_to_laserscan/src/cloud_tilt.cpp:87: error: no matching function for call to ‘transformPointCloud(std::string&, const boost::shared_ptr<const pcl::pointcloud<pcl::pointxyz=""> >&, pcl::PointCloud<pcl::pointxyz>&, tf::TransformListener&)’

Any suggestions on dealing with the boost pointer to reference conversions would be appreciated.

I also read that for this to be successful I need to use message_filters to buffer the tf data?