eigen3 and changes that you need to make to your code

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

eigen3 and changes that you need to make to your code

Radu B. Rusu
Administrator

We're trying to document all the changes that one needs to make to their code in order to fix the eigen(2)->eigen3
problems. We've set up a page for that at http://www.ros.org/wiki/eigen3

Please let us know if you find anything else, and feel free to modify the wiki page above.

--
Cheers,
Radu.

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

Re: eigen3 and changes that you need to make to your code

Radu B. Rusu
Administrator
We forgot to mention an important change that happened in the switch to Eigen3.

To make sure that our Point Cloud data is always aligned, both on 32bit architectures as well as on 64bit, we have
changed the pcl::PointCloud<T> data type internally as follows. Instead of providing a:

std::vector <T> points;

we now use:

std::vector<T, Eigen3::aligned_alocator<T> > points;

This requires changes in your code wherever you use vectors of points manually. Example:

std::vector<pcl::PointXYZINormal>::iterator it;
it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);

should now be

std::vector<pcl::PointXYZINormal, Eigen3::aligned_allocator<pcl::PointXYZINormal> >::iterator it;
it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);


Cheers,
Radu.


On 09/26/2010 02:18 PM, Radu Bogdan Rusu wrote:
>
> We're trying to document all the changes that one needs to make to their
> code in order to fix the eigen(2)->eigen3 problems. We've set up a page
> for that at http://www.ros.org/wiki/eigen3
>
> Please let us know if you find anything else, and feel free to modify
> the wiki page above.
>
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: eigen3 and changes that you need to make to your code

Geoffrey Biggs
On 27/09/10 07:47, Radu Bogdan Rusu wrote:

> We forgot to mention an important change that happened in the switch to Eigen3.
>
> To make sure that our Point Cloud data is always aligned, both on 32bit architectures as well as on 64bit, we have
> changed the pcl::PointCloud<T> data type internally as follows. Instead of providing a:
>
> std::vector <T> points;
>
> we now use:
>
> std::vector<T, Eigen3::aligned_alocator<T> > points;
>
> This requires changes in your code wherever you use vectors of points manually. Example:
>
> std::vector<pcl::PointXYZINormal>::iterator it;
> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);
>
> should now be
>
> std::vector<pcl::PointXYZINormal, Eigen3::aligned_allocator<pcl::PointXYZINormal> >::iterator it;
> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);

Any chance of getting a typedef or something for that? It's a lot to
type every time I want an iterator.

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

Re: eigen3 and changes that you need to make to your code

Radu B. Rusu
Administrator
Good news - We identified the same problem yesterday, and Kai already added an iterator to the PointCloud class, which
means you can ignore my previous e-mail :)

Kai, can we write a small unit test/example for it so that we encourage users to use it? Thanks.

Cheers,
Radu.


On 09/28/2010 01:07 AM, Geoffrey Biggs wrote:

> On 27/09/10 07:47, Radu Bogdan Rusu wrote:
>> We forgot to mention an important change that happened in the switch to Eigen3.
>>
>> To make sure that our Point Cloud data is always aligned, both on 32bit architectures as well as on 64bit, we have
>> changed the pcl::PointCloud<T>  data type internally as follows. Instead of providing a:
>>
>> std::vector<T>  points;
>>
>> we now use:
>>
>> std::vector<T, Eigen3::aligned_alocator<T>  >  points;
>>
>> This requires changes in your code wherever you use vectors of points manually. Example:
>>
>> std::vector<pcl::PointXYZINormal>::iterator it;
>> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);
>>
>> should now be
>>
>> std::vector<pcl::PointXYZINormal, Eigen3::aligned_allocator<pcl::PointXYZINormal>  >::iterator it;
>> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);
>
> Any chance of getting a typedef or something for that? It's a lot to
> type every time I want an iterator.
>
> Geoff
> _______________________________________________
> [hidden email] / http://pcl.ros.org
> https://code.ros.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: eigen3 and changes that you need to make to your code

Kai M. Wurm
Hi,

I added a unit test for PointCloud::iterator and added some more
convenience methods (push_back, size).

Best,
Kai

On 09/28/2010 08:29 AM, Radu Bogdan Rusu wrote:

> Good news - We identified the same problem yesterday, and Kai already added an iterator to the PointCloud class, which
> means you can ignore my previous e-mail :)
>
> Kai, can we write a small unit test/example for it so that we encourage users to use it? Thanks.
>
> Cheers,
> Radu.
>
>
> On 09/28/2010 01:07 AM, Geoffrey Biggs wrote:
>> On 27/09/10 07:47, Radu Bogdan Rusu wrote:
>>> We forgot to mention an important change that happened in the switch to Eigen3.
>>>
>>> To make sure that our Point Cloud data is always aligned, both on 32bit architectures as well as on 64bit, we have
>>> changed the pcl::PointCloud<T>   data type internally as follows. Instead of providing a:
>>>
>>> std::vector<T>   points;
>>>
>>> we now use:
>>>
>>> std::vector<T, Eigen3::aligned_alocator<T>   >   points;
>>>
>>> This requires changes in your code wherever you use vectors of points manually. Example:
>>>
>>> std::vector<pcl::PointXYZINormal>::iterator it;
>>> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);
>>>
>>> should now be
>>>
>>> std::vector<pcl::PointXYZINormal, Eigen3::aligned_allocator<pcl::PointXYZINormal>   >::iterator it;
>>> it = std::unique(overlap_model.points.begin(), overlap_model.points.end(), pclUnique);
>>
>> Any chance of getting a typedef or something for that? It's a lot to
>> type every time I want an iterator.
>>
>> Geoff
>> _______________________________________________
>> [hidden email] / http://pcl.ros.org
>> https://code.ros.org/mailman/listinfo/pcl-users
> _______________________________________________
> [hidden email] / http://pcl.ros.org
> https://code.ros.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users