dji-sdk / Onboard-SDK-ROS

Official ROS packages for DJI onboard SDK.
443 stars 309 forks source link

set local pose instead of local position for HORIZONTAL_GROUND control #240

Closed mithundiddi closed 3 years ago

mithundiddi commented 5 years ago

Hi,

While sending flight control signal in Horizontal Ground Frame: the ground frame(only orientation) is parallel to the the orientation in which drone is powered on. So, the forward(+x) , left(+y) of ground frame is same as drone body frame, when powered on. Even if during the flight the pose(orientation) of uav changes(for ex. if yaw changes), still the velocities sent are preserved in ground frame. This is great.

But for some reason, I power on the uav at point(x,y,z) in rpy_degrees(0,0,30)[using rpy in degrees for ease of asking question] and after some time in flight, the uav is at point(x1,y1,z1) in rpy_degrees(0,0,60). Now if I want to set this as my new home pose and send new velocities based on goals with reference to new home(like i will send a goal in my code go (1,1,1) from where uav current home.) . which means my ground frame is rotated by +30degrees in yaw(xy plane). But the dji sdk or dji Flight controller doesn't know this rotation. so all my new goals and velocity vector i can send to uav using HORIZONTAL_GROUND needs to be multiplied by Rotation matrix before publishing.

(ps currently local position is kind of odometry from gps ) If you can allow user to call srv call to set local_ref_pose instead of set_local_ref_home_position and inform the the corresponding quaternion to either DJI FC(which will be great) or at least inform DJI onboard sdk, which can do the math inside before sending velocities to FC.

Thanks.

snakehaihai commented 5 years ago

the thing you ask is like user-specific case, i don't think they will do it for you.

For simple case, you can copy the ardrone_autonomy package from TUM for such simple control gui