Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Access Joint from Sensor Element to Detect Full LIDAR Rotation

$
0
0
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: 00 0 0 0 0 01.20.0010874730.0010874730.0010924370000 0 0.0097 0 0 0.03785.01940model://rplidar/meshes/rplidar_base.dae00 0 0.0107 1.5707 0 0true400011000.1560.00010 0 0.01940 0 0 00.10.0000906230.0000906230.0000910360000 0 0.0107 0 0 00.036250.02140model://rplidar/meshes/rplidar_top.dae0 0 -0.036785 0 0 0basetop0 0 1-1000000000000000010000000000000000 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?

Viewing all articles
Browse latest Browse all 7017

Trending Articles