Error compiling (candidates are:)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error compiling (candidates are:)

Xavier Puig
Hello,
I am following the pcl turiorial and in filtering(Downsampling a
PointCloud using a VoxelGrid filter) when I try to compile with:

 g++ -fPIC -Wall -O3 -I/pcl/pcl-0.7.0/include   -I/pcl/eigen
-I/pcl/pcl-0.7.0/include/roslib -I/pcl/pcl-0.7.0/src taula.cpp -o
taula.o

taula.cpp: In function ‘int main(int, char**)’:
taula.cpp:26: error: no matching function for call to
‘pcl::PCDWriter::write(const char [35], sensor_msgs::PointCloud2&,
bool)’
/pcl/pcl-0.7.0/include/pcl/io/pcd_io.h:188: note: candidates are: int
pcl::PCDWriter::write(const std::string&, const
sensor_msgs::PointCloud2&, const Eigen::Vector4f&, const
Eigen::Quaternionf&, bool)
/pcl/pcl-0.7.0/include/pcl/io/pcd_io.h:207: note:                 int
pcl::PCDWriter::write(const std::string&, const boost::shared_ptr<const
sensor_msgs::PointCloud2_<std::allocator<void> > >&, const
Eigen::Vector4f&, const Eigen::Quaternionf&, bool)


the code is (from pcl standalone) is:

class PCDWriter
  {
    public:
      /** \brief Generate the header of a PCD v.7 file format
        * \param cloud the point cloud data message
        * \param origin the sensor acquisition origin
        * \param orientation the sensor acquisition orientation
        */
      std::string
      generateHeader (const sensor_msgs::PointCloud2 &cloud, const
Eigen::Vector4f &origin,
                      const Eigen::Quaternionf &orientation);

      /** \brief Save point cloud data to a PCD file containing n-D
points, in ASCII format
        * \param file_name the output file name
        * \param cloud the point cloud data message
        * \param origin the sensor acquisition origin
        * \param orientation the sensor acquisition orientation
        * \param precision the specified output numeric stream precision
(default: 7)
        */
      int writeASCII (const std::string &file_name, const
sensor_msgs::PointCloud2 &cloud,
                      const Eigen::Vector4f &origin =
Eigen::Vector4f::Zero (),
                      const Eigen::Quaternionf &orientation =
Eigen::Quaternionf::Identity (),
                      int precision = 7);

      /** \brief Save point cloud data to a PCD file containing n-D
points, in BINARY format
        * \param file_name the output file name
        * \param cloud the point cloud data message
        * \param origin the sensor acquisition origin
        * \param orientation the sensor acquisition orientation
        */
      int writeBinary (const std::string &file_name, const
sensor_msgs::PointCloud2 &cloud,
                       const Eigen::Vector4f &origin =
Eigen::Vector4f::Zero (),
                       const Eigen::Quaternionf &orientation =
Eigen::Quaternionf::Identity ());

      /** \brief Save point cloud data to a PCD file containing n-D
points
        * \param file_name the output file name
        * \param cloud the point cloud data message
        * \param origin the sensor acquisition origin
        * \param orientation the sensor acquisition orientation
        * \param binary set to true if the file is to be written in a
binary PCD format, false (default) for ASCII
        */
      inline int
      write (const std::string &file_name, const
sensor_msgs::PointCloud2 &cloud,
             const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (),
             const Eigen::Quaternionf &orientation =
Eigen::Quaternionf::Identity (),
             bool binary = false)
      {
        if (binary)
          return (writeBinary (file_name, cloud, origin, orientation));
        else
          return (writeASCII (file_name, cloud, origin, orientation,
7));
      }

      /** \brief Save point cloud data to a PCD file containing n-D
points
        * \param file_name the output file name
        * \param cloud the point cloud data message (boost shared
pointer)
        * \param binary set to true if the file is to be written in a
binary PCD format, false (default) for ASCII
        * \param origin the sensor acquisition origin
        * \param orientation the sensor acquisition orientation
        */
      inline int
      write (const std::string &file_name, const
sensor_msgs::PointCloud2::ConstPtr &cloud,
             const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (),
             const Eigen::Quaternionf &orientation =
Eigen::Quaternionf::Identity (),
             bool binary = false)
      {
        return (write (file_name, *cloud, origin, orientation, binary));
      }

       
      /** \brief Save point cloud data to a PCD file containing n-D
points
        * \param file_name the output file name
        * \param cloud the pcl::PointCloud data
        * \param binary set to true if the file is to be written in a
binary PCD format, false (default) for ASCII
        */
      template<typename PointT> inline int
      write (const std::string &file_name, const pcl::PointCloud<PointT>
&cloud, bool binary = false)
      {
        Eigen::Vector4f origin = cloud.sensor_origin_;
        Eigen::Quaternionf orientation = cloud.sensor_orientation_;

        sensor_msgs::PointCloud2 blob;
        pcl::toROSMsg (cloud, blob);

        // Save the data
        return (write (file_name, blob, origin, orientation, binary));
      }
     
     
  };

Thanks in advance



_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling (candidates are:)

Radu B. Rusu
Administrator
Xavier,

Are you trying to follow the tutorials on the wiki? Unfortunately we need to fix a few of them as they represent the PCL
API in cturtle, and you are using unstable (dturtle) -- 0.7.0 was only released there.

The two extra parameters indicate a sensor origin/orientation, and you can pass them as empty (Eigen::Vector4f::Zero ()
and Eigen::Quaternionf::Identity ()).

Cheers,
Radu.
--
http://pointclouds.org

On 01/24/2011 11:16 AM, Xavier Puig wrote:

> Hello,
> I am following the pcl turiorial and in filtering(Downsampling a
> PointCloud using a VoxelGrid filter) when I try to compile with:
>
>   g++ -fPIC -Wall -O3 -I/pcl/pcl-0.7.0/include   -I/pcl/eigen
> -I/pcl/pcl-0.7.0/include/roslib -I/pcl/pcl-0.7.0/src taula.cpp -o
> taula.o
>
> taula.cpp: In function ‘int main(int, char**)’:
> taula.cpp:26: error: no matching function for call to
> ‘pcl::PCDWriter::write(const char [35], sensor_msgs::PointCloud2&,
> bool)’
> /pcl/pcl-0.7.0/include/pcl/io/pcd_io.h:188: note: candidates are: int
> pcl::PCDWriter::write(const std::string&, const
> sensor_msgs::PointCloud2&, const Eigen::Vector4f&, const
> Eigen::Quaternionf&, bool)
> /pcl/pcl-0.7.0/include/pcl/io/pcd_io.h:207: note:                 int
> pcl::PCDWriter::write(const std::string&, const boost::shared_ptr<const
> sensor_msgs::PointCloud2_<std::allocator<void>  >  >&, const
> Eigen::Vector4f&, const Eigen::Quaternionf&, bool)
>
>
> the code is (from pcl standalone) is:
>
> class PCDWriter
>    {
>      public:
>        /** \brief Generate the header of a PCD v.7 file format
>          * \param cloud the point cloud data message
>          * \param origin the sensor acquisition origin
>          * \param orientation the sensor acquisition orientation
>          */
>        std::string
>        generateHeader (const sensor_msgs::PointCloud2&cloud, const
> Eigen::Vector4f&origin,
>                        const Eigen::Quaternionf&orientation);
>
>        /** \brief Save point cloud data to a PCD file containing n-D
> points, in ASCII format
>          * \param file_name the output file name
>          * \param cloud the point cloud data message
>          * \param origin the sensor acquisition origin
>          * \param orientation the sensor acquisition orientation
>          * \param precision the specified output numeric stream precision
> (default: 7)
>          */
>        int writeASCII (const std::string&file_name, const
> sensor_msgs::PointCloud2&cloud,
>                        const Eigen::Vector4f&origin =
> Eigen::Vector4f::Zero (),
>                        const Eigen::Quaternionf&orientation =
> Eigen::Quaternionf::Identity (),
>                        int precision = 7);
>
>        /** \brief Save point cloud data to a PCD file containing n-D
> points, in BINARY format
>          * \param file_name the output file name
>          * \param cloud the point cloud data message
>          * \param origin the sensor acquisition origin
>          * \param orientation the sensor acquisition orientation
>          */
>        int writeBinary (const std::string&file_name, const
> sensor_msgs::PointCloud2&cloud,
>                         const Eigen::Vector4f&origin =
> Eigen::Vector4f::Zero (),
>                         const Eigen::Quaternionf&orientation =
> Eigen::Quaternionf::Identity ());
>
>        /** \brief Save point cloud data to a PCD file containing n-D
> points
>          * \param file_name the output file name
>          * \param cloud the point cloud data message
>          * \param origin the sensor acquisition origin
>          * \param orientation the sensor acquisition orientation
>          * \param binary set to true if the file is to be written in a
> binary PCD format, false (default) for ASCII
>          */
>        inline int
>        write (const std::string&file_name, const
> sensor_msgs::PointCloud2&cloud,
>               const Eigen::Vector4f&origin = Eigen::Vector4f::Zero (),
>               const Eigen::Quaternionf&orientation =
> Eigen::Quaternionf::Identity (),
>               bool binary = false)
>        {
>          if (binary)
>            return (writeBinary (file_name, cloud, origin, orientation));
>          else
>            return (writeASCII (file_name, cloud, origin, orientation,
> 7));
>        }
>
>        /** \brief Save point cloud data to a PCD file containing n-D
> points
>          * \param file_name the output file name
>          * \param cloud the point cloud data message (boost shared
> pointer)
>          * \param binary set to true if the file is to be written in a
> binary PCD format, false (default) for ASCII
>          * \param origin the sensor acquisition origin
>          * \param orientation the sensor acquisition orientation
>          */
>        inline int
>        write (const std::string&file_name, const
> sensor_msgs::PointCloud2::ConstPtr&cloud,
>               const Eigen::Vector4f&origin = Eigen::Vector4f::Zero (),
>               const Eigen::Quaternionf&orientation =
> Eigen::Quaternionf::Identity (),
>               bool binary = false)
>        {
>          return (write (file_name, *cloud, origin, orientation, binary));
>        }
>
>
>        /** \brief Save point cloud data to a PCD file containing n-D
> points
>          * \param file_name the output file name
>          * \param cloud the pcl::PointCloud data
>          * \param binary set to true if the file is to be written in a
> binary PCD format, false (default) for ASCII
>          */
>        template<typename PointT>  inline int
>        write (const std::string&file_name, const pcl::PointCloud<PointT>
> &cloud, bool binary = false)
>        {
>          Eigen::Vector4f origin = cloud.sensor_origin_;
>          Eigen::Quaternionf orientation = cloud.sensor_orientation_;
>
>          sensor_msgs::PointCloud2 blob;
>          pcl::toROSMsg (cloud, blob);
>
>          // Save the data
>          return (write (file_name, blob, origin, orientation, binary));
>        }
>
>
>    };
>
> Thanks in advance
>
>
>
> _______________________________________________
> [hidden email] / http://pointclouds.org
> https://code.ros.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users