# Offboard: Using "MAV\_FRAME\_BODY\_FRD" frame to set position based on the body frame

**URL:** <https://discuss.px4.io/t/offboard-using-mav-frame-body-frd-frame-to-set-position-based-on-the-body-frame/26050>\
**Category:** MAVSDK\
**Created:** [February 4, 2022, 4:46pm UTC](https://discuss.px4.io/t/offboard-using-mav-frame-body-frd-frame-to-set-position-based-on-the-body-frame/26050 "2022-02-04T16:46:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![d1lee](https://discuss.px4.io/user_avatar/discuss.px4.io/d1lee/32/10117_2.png) [@d1lee](https://discuss.px4.io/u/d1lee)\
**Post date:** [February 4, 2022, 4:46pm UTC](https://discuss.px4.io/t/offboard-using-mav-frame-body-frd-frame-to-set-position-based-on-the-body-frame/26050/1 "2022-02-04T16:46:56Z")

</div>

I would like to move a copter based on the **body** frame (forward, right, down, yaw) in Offboard mode, using the `SET_POSITION_TARGET_LOCAL_NED` mavlink message.

In PX4’s docs, it says the `MAV_FRAME_BODY_NED` is supported:  
[https://docs.px4.io/master/en/flight\_modes/offboard.html#copter-vtol](https://docs.px4.io/master/en/flight_modes/offboard.html#copter-vtol)

However, this frame has since been deprecated and replaced by `MAV_FRAME_BODY_FRD`  
[https://mavlink.io/en/messages/common.html#MAV\_FRAME\_BODY\_NED](https://mavlink.io/en/messages/common.html#MAV_FRAME_BODY_NED)

So I tried to implement a `set_position_body` function in the C++ library by replicating the `set_position_ned` implementation, but instead using the `MAV_FRAME_BODY_FRD` frame. I got this warning:

 ![image](https://discuss.px4.io/uploads/default/original/2X/f/f139d4568b61597212bc79998ce260eb0a722260.png)

Is there a way to achieve positional movement based on the drone’s body (move 2m to the right, forward, etc) using MAVSDK? Any insights are greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Artem\_Borisov](https://discuss.px4.io/user_avatar/discuss.px4.io/artem_borisov/32/9999_2.png) [@Artem\_Borisov](https://discuss.px4.io/u/Artem_Borisov)\
**Post date:** [February 7, 2022, 3:13pm UTC](https://discuss.px4.io/t/offboard-using-mav-frame-body-frd-frame-to-set-position-based-on-the-body-frame/26050/2 "2022-02-07T15:13:41Z")

</div>

Hi.  
Any insights:

1. You can use, offboard.set\_position\_ned(NEDYAW), knowing the current NEDYAW it is possible to calculate the coordinates of NED , to move forward/right/left/backward relative to the body of the drone.

2. You can use, offboard.set\_velocity\_body(), set the speed of movement forward/right/down, for example 1 m/s, after two seconds set the speed of movement 0 m/s (the drone should be 2 meters in the selected direction). Or make feedback on the coordinates.

---

<div class="post-metadata">

**Author:** ![d1lee](https://discuss.px4.io/user_avatar/discuss.px4.io/d1lee/32/10117_2.png) [@d1lee](https://discuss.px4.io/u/d1lee)\
**Post date:** [February 10, 2022, 3:27am UTC](https://discuss.px4.io/t/offboard-using-mav-frame-body-frd-frame-to-set-position-based-on-the-body-frame/26050/3 "2022-02-10T03:27:52Z")

</div>

Hi, thank you for your answer!  
The two options are certainly great alternative solutions to achieve my goal. But I was really hoping to hear if someone knows how to implement it in the MAVSDK library.
