Ambiguous call to overloaded function boost::tuples::tie

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

Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
Hi

I am a beginner in PCL.

I am trying 3D registration using Kinect data(of small objects).
I have done coarse registration (using SIFT + FPFH) and fine registration using GICP.
I want to register my point clouds globally so as to avoid accumulation errors. I have read from different forums that LUM is useful. I tried to execute LUM and I am getting the build error :

'boost::tuples::tie' - ambiguous call to overloaded function
File : lum.hpp

Could somebody help me here please?

Thanks,
Dhanya
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

nizar sallem
Hi Dhanya,

With such little info we can not help.
Please paste your code and send it so we may help you.

Cheers,
--
Nizar

On 21/01/2014 12:22, dhanyaspankaj wrote:

> Hi
>
> I am a beginner in PCL.
>
> I am trying 3D registration using Kinect data(of small objects).
> I have done coarse registration (using SIFT + FPFH) and fine registration
> using GICP.
> I want to register my point clouds globally so as to avoid accumulation
> errors. I have read from different forums that LUM is useful. I tried to
> execute LUM and I am getting the build error :
>
> 'boost::tuples::tie' - ambiguous call to overloaded function
> File : lum.hpp
>
> Could somebody help me here please?
>
> Thanks,
> Dhanya
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Ambiguous-call-to-overloaded-function-boost-tuples-tie-tp4031811.html
> Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
Hi,

Thanks.
This is the function where I use LUM


void findLUM(std::vector<PCD, Eigen::aligned_allocator<PCD>> &data,std::vector<pcl::CorrespondencesPtr> &correspondencesdata)
{
        //vector<pcl::CorrespondencesPtr> correspondencesdata;
        PointCloud::Ptr output(new PointCloud);
        pcl::registration::LUM<PointT> lum;

        for (unsigned int i = 0; i < data.size (); ++i)
        {
                PointCloud::Ptr src (new PointCloud (*(data[i].cloud)));
                lum.addPointCloud (src);
        }

        pcl::registration::LUM< PointT >::Vertex v1;
        pcl::registration::LUM< PointT >::Vertex v2;
        for (unsigned int i = 1; i <= data.size (); ++i)
        {
                v1=i-1;
                if (i<data.size ()) v2=i;
                else v2=0;
                lum.setCorrespondences (v2, v1, correspondencesdata[i-1]);


        /*lum.setMaxIterations (20);
        lum.compute ();
        output = lum.getConcatenatedCloud (); */ // -> I have commented this
        }
}

This is where I find the correspondences.

void findCorrespondences(std::vector<PCD, Eigen::aligned_allocator<PCD>> &data,std::vector<pcl::CorrespondencesPtr> &correspondencesdata)
{
        boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
        pcl::registration::CorrespondenceEstimation<pcl::PointXYZ, pcl::PointXYZ> corr_est;
        for (int i=0;i<data.size()-1;i++)
        {
                corr_est.setInputTarget (data[i].cloud);
                corr_est.setInputCloud (data[i+1].cloud);
                corr_est.determineCorrespondences (*correspondences);
                correspondencesdata.push_back(correspondences);
        }
}


<b>The build error is at this function in lum.hpp

//////////////////////////////////////////////////////////////////////////////////////////////
template<typename PointT>
  inline void
  pcl::registration::LUM<PointT>::setCorrespondences (Vertex source_vertex, Vertex target_vertex, pcl::CorrespondencesPtr corrs)
  {
    if (corrs->size () < 3)
    {
      PCL_ERROR ("[pcl::registration::LUM::setCorrespondences] A set of correspondences needs to contain at least 3 different correspondences.\n");
      return;
    }
    if (source_vertex < 0 || source_vertex >= num_vertices (*slam_graph_) || target_vertex < 0 || target_vertex >= num_vertices (*slam_graph_) || source_vertex == target_vertex)
    {
      PCL_ERROR ("[pcl::registration::LUM::setCorrespondences] You are attempting to set a set of correspondences between non-existing or identical graph vertices.\n");
      return;
    }
    Edge e;
    bool present;
    tie (e, present) = edge (source_vertex, target_vertex, *slam_graph_);
    if (!present)
      tie (e, present) = add_edge (source_vertex, target_vertex, *slam_graph_);
    (*slam_graph_)[e].corrs_ = corrs;
    (*slam_graph_)[e].converged_ = false;
  }
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
I have changed the function names 'tie' in the file to boost::tuples::tie and the build error is gone now.

Thanks.

Dhanya


On 22 January 2014 10:47, dhanyaspankaj [via Point Cloud Library (PCL) Users mailing list] <[hidden email]> wrote:
Hi,

Thanks.
This is the function where I use LUM


void findLUM(std::vector<PCD, Eigen::aligned_allocator<PCD>> &data,std::vector<pcl::CorrespondencesPtr> &correspondencesdata)
{
        //vector<pcl::CorrespondencesPtr> correspondencesdata;
        PointCloud::Ptr output(new PointCloud);
        pcl::registration::LUM<PointT> lum;

        for (unsigned int i = 0; i < data.size (); ++i)
        {
                PointCloud::Ptr src (new PointCloud (*(data[i].cloud)));
                lum.addPointCloud (src);
        }

        pcl::registration::LUM< PointT >::Vertex v1;
        pcl::registration::LUM< PointT >::Vertex v2;
        for (unsigned int i = 1; i <= data.size (); ++i)
        {
                v1=i-1;
                if (i<data.size ()) v2=i;
                else v2=0;
                lum.setCorrespondences (v2, v1, correspondencesdata[i-1]);


        /*lum.setMaxIterations (20);
        lum.compute ();
        output = lum.getConcatenatedCloud (); */ // -> I have commented this
        }
}

This is where I find the correspondences.

void findCorrespondences(std::vector<PCD, Eigen::aligned_allocator<PCD>> &data,std::vector<pcl::CorrespondencesPtr> &correspondencesdata)
{
        boost::shared_ptr<pcl::Correspondences> correspondences (new pcl::Correspondences);
        pcl::registration::CorrespondenceEstimation<pcl::PointXYZ, pcl::PointXYZ> corr_est;
        for (int i=0;i<data.size()-1;i++)
        {
                corr_est.setInputTarget (data[i].cloud);
                corr_est.setInputCloud (data[i+1].cloud);
                corr_est.determineCorrespondences (*correspondences);
                correspondencesdata.push_back(correspondences);
        }
}


<b>The build error is at this function in lum.hpp

//////////////////////////////////////////////////////////////////////////////////////////////
template<typename PointT>
  inline void
  pcl::registration::LUM<PointT>::setCorrespondences (Vertex source_vertex, Vertex target_vertex, pcl::CorrespondencesPtr corrs)
  {
    if (corrs->size () < 3)
    {
      PCL_ERROR ("[pcl::registration::LUM::setCorrespondences] A set of correspondences needs to contain at least 3 different correspondences.\n");
      return;
    }
    if (source_vertex < 0 || source_vertex >= num_vertices (*slam_graph_) || target_vertex < 0 || target_vertex >= num_vertices (*slam_graph_) || source_vertex == target_vertex)
    {
      PCL_ERROR ("[pcl::registration::LUM::setCorrespondences] You are attempting to set a set of correspondences between non-existing or identical graph vertices.\n");
      return;
    }
    Edge e;
    bool present;
    tie (e, present) = edge (source_vertex, target_vertex, *slam_graph_);
    if (!present)
      tie (e, present) = add_edge (source_vertex, target_vertex, *slam_graph_);
    (*slam_graph_)[e].corrs_ = corrs;
    (*slam_graph_)[e].converged_ = false;
  }



If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/Ambiguous-call-to-overloaded-function-boost-tuples-tie-tp4031811p4031827.html
To unsubscribe from Ambiguous call to overloaded function boost::tuples::tie, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

Sergey
Administrator
Hi,

It would be very nice if you send a pull request with your fix!

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
Hi,

Actually I am not even sure if that is a proper fix. I thought it is just a work-around solution.
Still I dont understand the real problem. 

Dhanya


On 25 January 2014 18:21, Sergey [via Point Cloud Library (PCL) Users mailing list] <[hidden email]> wrote:
Hi,

It would be very nice if you send a pull request with your fix!

Regards,
Sergey


If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/Ambiguous-call-to-overloaded-function-boost-tuples-tie-tp4031811p4031905.html
To unsubscribe from Ambiguous call to overloaded function boost::tuples::tie, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

Sergey
Administrator
Dhanya,

Do you compile with c++11 enabled? Do you have `using namespace std;` somewhere in your code?

If this is the case, then the explanation is simple: standard library (since c++11) also has `tie` function. Therefore when using the name with unqualified namespace you get the ambiguity.

As for the fix, changing `tie` to `boost::tie` (i.e. omitting `tuples`) would be sufficient.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj

Hi,

Thank you for the explanation.
I am using Visual Studio 2010 Express and I haven't enabled C++11.
Also I couldn't find 'using namespace std' in any of my code or the include files.

However, the tie function is specified somewhere else other than boost, I suppose.
Actually, I am new to PCL, GitHub etc. It would be really great if you could please point me to some documentation on how to do the fix.

Thanks & Regards,
Dhanya

Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

Jochen Sprickerhof
Administrator
Hi Dhanya,

* dhanyaspankaj <[hidden email]> [2014-01-26 20:34]:
> Actually, I am new to PCL, GitHub etc. It would be really great if you could
> please point me to some documentation on how to do the fix.

Have a look at [1], and don't hesitate to ask, if you need more
information.

Cheers Jochen

[1] https://help.github.com/articles/fork-a-repo

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

Sergey
Administrator
Dhanya,

The link posted by Jochen is a good starting point. Here is a bit more detail
about what to do after you are done with step 3:

* apply your fix and save the file
* commit it with `git add --all && git commit`
* push the commit to your fork `git push origin master`
* navigate to your repo on github and observe that at the top of the page
   there will be an indication of that you have something new compared to
   the original repository and a button to send a pull request
* fill in the description and send it

Some more details about pull requests here: https://help.github.com/articles/using-pull-requests

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
Hi ..

   Thanks for your help. Sorry, I was on vacation and took a while to learn about GitHub.
However, now I see that the required changes are already done.

Thank you.

Regards,
Dhanya.
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

Sergey
Administrator
Hi,

Indeed, this is fixed in the current master, but wait, it was fixed by this commit in summer 2012 (!). Why you were using those old sources in the first place?

A funny thing though is that back then it was Jochen who fixed the issue.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous call to overloaded function boost::tuples::tie

dhanyaspankaj
Hi,

It is a mistake from my part. I must have downloaded a past version by mistake. 
Today, I rechecked and found that it is fixed by Jochen in the current version (yes, in 2012). 
Sorry for the mistake and thanks for your help and understanding.

Regards,
Dhanya


On 3 February 2014 14:25, Sergey [via Point Cloud Library (PCL) Users mailing list] <[hidden email]> wrote:
Hi,

Indeed, this is fixed in the current master, but wait, it was fixed by this commit in summer 2012 (!). Why you were using those old sources in the first place?

A funny thing though is that back then it was Jochen who fixed the issue.

Regards,
Sergey


If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/Ambiguous-call-to-overloaded-function-boost-tuples-tie-tp4031811p4032066.html
To unsubscribe from Ambiguous call to overloaded function boost::tuples::tie, click here.
NAML