Saving / Loading transforms

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

Saving / Loading transforms

Matt Bell 2
Hi all,

Perhaps I am worrying too much about stylistic cleanliness by asking this, since I could instead just quickly write an acceptable solution.

Is there a built-in function for saving and loading Eigen types (eg Matrix4f)?  I'm looking to save a bunch of transforms as files.  For now I'm planning on doing the lazy approach of saving an empty point cloud with the transform information included.  I could just write something that writes the numbers in the matrix to file and reads them in again, but I'm curious if there's a more general setup for this.  I didn't see anything in either the Eigen or PCL documentation.

- Matt

 
Reply | Threaded
Open this post in threaded view
|

Re: Saving / Loading transforms

Nicola Fioraio
Hi Matt,

I guess there's no function to save an Eigen::Matrix and I think it's not a good solution to save the matrix using a PoinCloud.
If you use OpenCV, you could try to create a cv::Mat from the Eigen::Matrix and save the OpenCV matrix using cv::FileStorage, but I think it shouldn't be difficult to write a function like this:

template<matrix_type> bool save(const matrix_type& m);

where 'matrix_type' is an Eigen::Matrix. Just few lines of code, I guess.

Hope it helps.

Cheers,
Nicola


On Wed, Mar 16, 2011 at 8:41 PM, Matt Bell 2 <[hidden email]> wrote:
Hi all,

Perhaps I am worrying too much about stylistic cleanliness by asking this,
since I could instead just quickly write an acceptable solution.

Is there a built-in function for saving and loading Eigen types (eg
Matrix4f)?  I'm looking to save a bunch of transforms as files.  For now I'm
planning on doing the lazy approach of saving an empty point cloud with the
transform information included.  I could just write something that writes
the numbers in the matrix to file and reads them in again, but I'm curious
if there's a more general setup for this.  I didn't see anything in either
the Eigen or PCL documentation.

- Matt



--
View this message in context: http://point-cloud-library-pcl-mailing-list.967500.n3.nabble.com/Saving-Loading-transforms-tp2692021p2692021.html
Sent from the Point Cloud Library (PCL) mailing list mailing list archive at Nabble.com.
_______________________________________________
[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
Reply | Threaded
Open this post in threaded view
|

Re: Saving / Loading transforms

Radu B. Rusu
Administrator
In reply to this post by Matt Bell 2
Matt,

I haven't used any functions for storing eigen types to disk, but it should be trivial to write one. You can chose
between saving your values as ascii (if you don't care about a tiny bit of precision loss), or if not, as binary.

We could definitely accommodate something like this into pcl_io. Or we could go all the way and define a nice clean API
for different transforms and create a new file format for them.

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

On 03/16/2011 08:41 PM, Matt Bell 2 wrote:

> Hi all,
>
> Perhaps I am worrying too much about stylistic cleanliness by asking this,
> since I could instead just quickly write an acceptable solution.
>
> Is there a built-in function for saving and loading Eigen types (eg
> Matrix4f)?  I'm looking to save a bunch of transforms as files.  For now I'm
> planning on doing the lazy approach of saving an empty point cloud with the
> transform information included.  I could just write something that writes
> the numbers in the matrix to file and reads them in again, but I'm curious
> if there's a more general setup for this.  I didn't see anything in either
> the Eigen or PCL documentation.
>
> - Matt
>
>
>
> --
> View this message in context: http://point-cloud-library-pcl-mailing-list.967500.n3.nabble.com/Saving-Loading-transforms-tp2692021p2692021.html
> Sent from the Point Cloud Library (PCL) mailing list mailing list archive at Nabble.com.
> _______________________________________________
> [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
Reply | Threaded
Open this post in threaded view
|

Re: Saving / Loading transforms

Jochen Sprickerhof
Administrator
* Radu Bogdan Rusu <[hidden email]> [2011-03-17 00:30]:
> Matt,

Hi,

> I haven't used any functions for storing eigen types to disk, but it should be trivial to write one. You can chose
> between saving your values as ascii (if you don't care about a tiny bit of precision loss), or if not, as binary.

if you really care, you can transform them to Euler angels first ;).

> We could definitely accommodate something like this into pcl_io. Or we could go all the way and define a nice clean API
> for different transforms and create a new file format for them.

A clean API would be really useful and I've some ideas for it, but it
still needs a few cycles.
In our SLAM6D software we dump all transformations to an ASCII file to
visualize the registration, so I think it would be the easiest to go
with this for now.

> Cheers,
> Radu.

Cheers,

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

Re: Saving / Loading transforms

Radu B. Rusu
Administrator
Jochen,


On 03/17/2011 01:31 AM, Jochen Sprickerhof wrote:
> * Radu Bogdan Rusu<[hidden email]>  [2011-03-17 00:30]:
>> We could definitely accommodate something like this into pcl_io. Or we could go all the way and define a nice clean API
>> for different transforms and create a new file format for them.
>
> A clean API would be really useful and I've some ideas for it, but it
> still needs a few cycles.
> In our SLAM6D software we dump all transformations to an ASCII file to
> visualize the registration, so I think it would be the easiest to go
> with this for now.

That sounds great. You wanna start architecting this? It feels like we need to see what sort of transformations we
should address (would Matrix4f do it or do we need more? what about single/double precision), define a file format
extension, and if we need both ascii/binary a header like PCD files have.

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

Re: Saving / Loading transforms

dirkholz
On Thu, 2011-03-17 at 11:21 -0700, Radu Bogdan Rusu wrote:

> Jochen,
>
>
> On 03/17/2011 01:31 AM, Jochen Sprickerhof wrote:
> > * Radu Bogdan Rusu<[hidden email]>  [2011-03-17 00:30]:
> >> We could definitely accommodate something like this into pcl_io. Or we could go all the way and define a nice clean API
> >> for different transforms and create a new file format for them.
> >
> > A clean API would be really useful and I've some ideas for it, but it
> > still needs a few cycles.
> > In our SLAM6D software we dump all transformations to an ASCII file to
> > visualize the registration, so I think it would be the easiest to go
> > with this for now.

what about sensor_position (vector) and sensor_origin (quaternion) that
we added to PointCloud?

>
> That sounds great. You wanna start architecting this? It feels like we need to see what sort of transformations we
> should address (would Matrix4f do it or do we need more? what about single/double precision), define a file format
> extension, and if we need both ascii/binary a header like PCD files have.
>
> Cheers,
> Radu.
> --
> http://pointclouds.org
> _______________________________________________
> [hidden email] / http://pointclouds.org
> https://code.ros.org/mailman/listinfo/pcl-users

--
----------------------------------------------------------------------
Dirk Holz
Autonomous Intelligent Systems Group  http://www.ais.uni-bonn.de/~holz
Department of Computer Science VI     [hidden email]
University of Bonn                    Tel.:  +49 228 73 4434
D-53117 Bonn, Germany                 Fax.:  +49 228 73 4425
----------------------------------------------------------------------

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

Re: Saving / Loading transforms

Jochen Sprickerhof
Administrator
* Dirk Holz <[hidden email]> [2011-03-18 11:59]:

> On Thu, 2011-03-17 at 11:21 -0700, Radu Bogdan Rusu wrote:
> > Jochen,
> >
> >
> > On 03/17/2011 01:31 AM, Jochen Sprickerhof wrote:
> > > * Radu Bogdan Rusu<[hidden email]>  [2011-03-17 00:30]:
> > >> We could definitely accommodate something like this into pcl_io. Or we could go all the way and define a nice clean API
> > >> for different transforms and create a new file format for them.
> > >
> > > A clean API would be really useful and I've some ideas for it, but it
> > > still needs a few cycles.
> > > In our SLAM6D software we dump all transformations to an ASCII file to
> > > visualize the registration, so I think it would be the easiest to go
> > > with this for now.
>
> what about sensor_position (vector) and sensor_origin (quaternion) that
> we added to PointCloud?

but thats only one pose. I was rather thinking about multiple ones (e.g.
for every iteration of ICP..) together with a timestamp and some
information about the used algorithm you get a nice visualization of
whats going on with your transforms (for example while registration).

> >
> > That sounds great. You wanna start architecting this? It feels like we need to see what sort of transformations we
> > should address (would Matrix4f do it or do we need more? what about single/double precision), define a file format
> > extension, and if we need both ascii/binary a header like PCD files have.
> >
> > Cheers,
> > Radu.
> > --
> > http://pointclouds.org
> > _______________________________________________
> > [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