Page 1 of 1

Extracting Sensor Position / Pose

Posted: Wed May 10, 2023 3:49 pm
by subo3
Hello,

for a plugin i'm trying to figure out how to extract the sensor position (pose) of lidar point clouds.
Is it correct, that it's a member of Grid struct (ccGLMatrixd sensorPosition)? Doc: https://www.cloudcompare.org/doc/qCC_db ... 39a492038c

For my approach i'm thinking about iterating through the selected entities (point clouds in this case):

Code: Select all

ccHObject::Container selPw = appInterface->getSelectedEntities(); //create an instance of selected point clouds
	
for (int i = 0; i < selPw.size(); i++) 
{

}
Does anyone have an idea how to get to the sensor position of the point clouds in the container?
Thank you!

Re: Extracting Sensor Position / Pose

Posted: Sat May 13, 2023 6:31 am
by daniel
The most robust way is to loop through the selected entities, and check if it's a sensor object (ccSensor) or a point cloud (ccPointCloud).

If it's a sensor, you can retrieve its position directly. If it's a cloud, you'll have to look at its children (entities) and look for a ccSensor among them. You can look in the code base for either 'ccSensor' or 'ccGBLSensor' and you'll find many examples.

Re: Extracting Sensor Position / Pose

Posted: Fri May 26, 2023 11:59 am
by subo3
First of all thank you for the help!

Do you know a way to access the children? My entities are ccPointCloud objects. I tried a lot and looked for functions, somehow i didn't find a solution, unfortunately.

Re: Extracting Sensor Position / Pose

Posted: Sat May 27, 2023 9:47 am
by daniel
With the 'getChild()' method? (and the number of children can be retrieved with getChildrenNumber:
https://github.com/CloudCompare/CloudCo ... ect.h#L131