I am using v4.2.0 and I can't figure out how to output the data collected by the vision sensor.
I understand that it can be outputted as a Point Cloud by applying the sensor matrix transformation to the depth buffer retrieved by sim.getVisionSensorDepthBuffer(), I would appreciate it if someone can tell me how that is realized in Lua. Thanks in advance,
How to save a depth image as a point cloud?
Re: How to save a depth image as a point cloud?
Hi,
have a look at the model components/sensors/3D laser scanner Fast.ttm.
have a look at the model components/sensors/3D laser scanner Fast.ttm.
Re: How to save a depth image as a point cloud?
Hello, Thanks a lot for your reply
I think I understand most of it, the problem now is exporting it. The sample code from the 3D laser Scanner said that the data needs to be packed into a string first. When I tried to pack the measuredData using the sim.packTable functions I get gibberish encoding and weird symbols. I tried all the packing functions. Do you have any idea why that is happening?
I think I understand most of it, the problem now is exporting it. The sample code from the 3D laser Scanner said that the data needs to be packed into a string first. When I tried to pack the measuredData using the sim.packTable functions I get gibberish encoding and weird symbols. I tried all the packing functions. Do you have any idea why that is happening?
Re: How to save a depth image as a point cloud?
There is a simple demo scene located here, doing exactly what you want. That scene will probably be integrated as example scene in next release, in folder scenes/vision.
Cheers
Cheers
Re: How to save a depth image as a point cloud?
Thanks a lot for that scene. It however does not explain how to save the point cloud data to an external file. As mentioned above, when I use sim.pack*Table functions with measuredData I get gibberish coding like this:
É?^A^@^@^@@<9a><8f><95>¿^A^@^@^@^@Ü<93><99>?^A^@^@^@ÀÆÃÉ?^A^@^@^@@<9a><8f><95>¿^A^@^@^@^@®Þ<94>?^A^@^@^@ ÈÃÉ?^A^@^@^@<80><9d><8f><95>¿^A^@^@^@ })<90>?^A^@^@^@ ÈÃÉ?^A^@^@^@<80><9d><8f>
Any idea why this is happening?
É?^A^@^@^@@<9a><8f><95>¿^A^@^@^@^@Ü<93><99>?^A^@^@^@ÀÆÃÉ?^A^@^@^@@<9a><8f><95>¿^A^@^@^@^@®Þ<94>?^A^@^@^@ ÈÃÉ?^A^@^@^@<80><9d><8f><95>¿^A^@^@^@ })<90>?^A^@^@^@ ÈÃÉ?^A^@^@^@<80><9d><8f>
Any idea why this is happening?
Re: How to save a depth image as a point cloud?
measuredData is a table that contains 3*n coordinates. Simply write that data to file, in your favorite format.
Cheers
Cheers