I've been working on a sensor plugin for a LIDAR sensor simulation. We added a plugin element nested in a sensor element. However, we need to access a joint that is also in the model. We want to know when the LIDAR makes a full 360 degree rotation around it's rotating axis. Our sdf model is the following:
0 0 0 0 0 0 0 1.2 0.001087473 0.001087473 0.001092437 0 0 0 0 0 0.0097 0 0 0 .03785 .01940 model://rplidar/meshes/rplidar_base.dae 0 0 0 0.0107 1.5707 0 0 true 4000 1 1 0 0 0.15 6 0.0001 0 0 0.01940 0 0 0 0.1 0.000090623 0.000090623 0.000091036 0 0 0 0 0 0.0107 0 0 0 0.03625 0.02140 model://rplidar/meshes/rplidar_top.dae 0 0 -0.036785 0 0 0 base top 0 0 1 -10000000000000000 10000000000000000
First, we tried using the Pose from the sensor pointer, but that provided values that did not change. We did this through accessing the pose through sdf::SensorPtr ParentPointer, receiving the position vector from `ParentPointer->Pose()->pos()` and the rotation quaternion from `ParentPointer->Pose()->rot()`. However, these displayed constant values even with different rotation speeds, thus this did not help us to figure out when the RPLidar made a full rotation.
We also tried to use the parent of the given sdf::ElementPtr _sdf. We were able to return "sensor" when calling `printf("%s\n", _sdf->GetParent()->GetName())`. However, if we tried to look up one more level by writing `_sdf->GetParent()->GetParent()` we got a segmentation fault.
We want to find a way to access the joint to find its pose in order to tell when a full rotation is completed. What other ways can we approach this problem?
↧