# Why are they different on /mavros/setpoint\_raw/local and /mavros/setpoint\_position/local about handling yaw

**URL:** <https://discuss.px4.io/t/why-are-they-different-on-mavros-setpoint-raw-local-and-mavros-setpoint-position-local-about-handling-yaw/46666>\
**Category:** PX4 Autopilot\
**Created:** [July 26, 2025, 7:13am UTC](https://discuss.px4.io/t/why-are-they-different-on-mavros-setpoint-raw-local-and-mavros-setpoint-position-local-about-handling-yaw/46666 "2025-07-26T07:13:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfly](https://discuss.px4.io/user_avatar/discuss.px4.io/tfly/32/19977_2.png) [@tfly](https://discuss.px4.io/u/tfly)\
**Post date:** [July 26, 2025, 7:13am UTC](https://discuss.px4.io/t/why-are-they-different-on-mavros-setpoint-raw-local-and-mavros-setpoint-position-local-about-handling-yaw/46666/1 "2025-07-26T07:13:27Z")

</div>

In `/mavros/setpoint_position/local(setpoint_position.cpp)`

```cpp
auto q = [&] () {
	if (mav_frame == MAV_FRAME::BODY_NED || mav_frame == MAV_FRAME::BODY_OFFSET_NED) {
		return ftf::transform_orientation_absolute_frame_aircraft_baselink(Eigen::Quaterniond(tr.rotation()));
	} else {
		return ftf::transform_orientation_enu_ned(
			ftf::transform_orientation_baselink_aircraft(Eigen::Quaterniond(tr.rotation())));
	}
} ();

```

In `/mavros/setpoint_raw/local(setpoint_raw.cpp)` , the yaw have two transform, `ned -> enu` , `frd -> flu` ?

```cpp
position = ftf::transform_frame_enu_ned(position);
velocity = ftf::transform_frame_enu_ned(velocity);
af = ftf::transform_frame_enu_ned(af);
yaw = ftf::quaternion_get_yaw(
		ftf::transform_orientation_aircraft_baselink(
			ftf::transform_orientation_ned_enu(
				ftf::quaternion_from_rpy(0.0, 0.0, req->yaw))));

```

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [October 24, 2025, 7:13am UTC](https://discuss.px4.io/t/why-are-they-different-on-mavros-setpoint-raw-local-and-mavros-setpoint-position-local-about-handling-yaw/46666/2 "2025-10-24T07:13:58Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
