not able to retrieve sensor's pose from standalone gazebo program
Hi all,
I am compiling Gazebo directly as a standalone program(without the use of ROS). I use an MAV model which contains some single ray sensors in various direction. I am able to read out the value of raysensors with no problem, which means they are correctly initialized , however when I try to read out their pose from that program, I get all zeros. Is this an bug within gazebo or am I doing it in the wrong way?
The piece of code is listed here, where I try to read out the orientation of the pose in a loop. Roll pitch and yaw are all zeros.
ignition::math::Pose3d pose3d_sensor = RaySensorPtr_test->Pose();
gazebo::math::Pose pose_sensor = gazebo::math::Pose(pose3d_sensor);
double roll = pose_sensor.rot.GetRoll()
double pitch = pose_sensor.rot.GetPitch()
double yaw = pose_sensor.rot.GetYaw()
the rotation angles you're getting is relative to parent link so they could be 0s depending on what you specified in SDF. Are you're looking for angles in world frame?
Ah of course! The link has the orientation but not the sensor relative to the link. My bad. Thanks for your quick answer :)