Get rotate angle to move a robot in 3D environment
I have an UAV and my idea is to make it moves around some points I pass to it.
My logic is the following:
1- Moves UAV in z-axis to adjust high;
2- Rotates around z-axis;
3- Moves forward on x-axis until reach the goal.
Step 1 works fine, but I'm getting problems on step number 2.
I have one coordinate frame for the the UAV and I get the angle between the uav and the point (in the world) as a transform between the frames of my goal_point
and the UAV
:
angle = transform_goal_robotPose.getRotation().getAngle();
However, I cannot get a metric to compare with and establish that the uav has rotated the correct angle and then can go to step 3.
I was thinking about something like a comparison if (angle == expected_angle)
, but couldn't figure out none.
Someone knows how can I get it?