Co-ordinates of a point

Typically: "How do I... ", "How can I... " questions
Posts: 11
Joined: 19 Jun 2013, 14:29

Co-ordinates of a point

Is it possible to know the co-ordinates of a point in the default floor ?(before or after simulation)

coppelia
Posts: 7272
Joined: 14 Dec 2012, 00:25

Re: Co-ordinates of a point

Hello,

Yes, of course! But the question is, what point?

To get the coordinates of an object (be it a dummy or another one), just use the simGetObjectPosition API function.

.. or are you talking about coordinate transformations?

Cheers

hassan
Posts: 10
Joined: 20 Aug 2013, 12:31

Re: Co-ordinates of a point

Hello,

I have a question regarding the conversion of depth values into 3D point clouds and transformation to the world reference frame. I am using a Kinect Vision sensor. I set the angle of view using the focal length which i got by calibrating a real camera e.g. for a camera with focal length in pixels=534 i use the formula Angle=2*atan(640/ (534*2)), converting into degrees it came to about 61.86 degrees.

After that I retrieved the depth buffer, I write the depth buffer to a .txt file as explained in the other post a few days ago. Now using MATLAB i convert this depth map into a point cloud using the following code:

Code: Select all

``````%%dImage contains the depth values retrieved from v-rep
for m=1:480
for n=1:640
Z=dImage(m,n)*1000;%%from mm to m
PointCloud(1,Count)=(n-cx)*(Z/fx);%%X
PointCloud(2,Count)=(m-cy)*(Z/fy);%%Y
PointCloud(3,Count)=Z;
Count=Count+1;
end
end
``````
I also get the absolute position of the sensor using 'simGetObjectMatrix'. Now i apply this transformation matrix to the computed point cloud for two different sensors. I should actually get a well registered point cloud from both the sensors but instead i get weird transformations. I know there is something wrong in my interpretation fo the coordinate system. But i am not quite able to interpret what exactly is it?

I hope you will be able to help.

best regards

coppelia