-
Notifications
You must be signed in to change notification settings - Fork 19.6k
add yaw and yaw rate logging for MAVLink_SET_POSITION_TARGET_LOCAL_NED #31366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add yaw and yaw rate logging for MAVLink_SET_POSITION_TARGET_LOCAL_NED #31366
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message could be Copter: mode_guided: log yaw and yaw rate for SET_POSITION_TARGET_LOCAL_NED
Seems like a reasonable change - 'though I wonder why we weren't logging this before.... (@lthall )
ArduCopter/Log.cpp
Outdated
| accel_target_y : accel_target_mss.y, | ||
| accel_target_z : accel_target_mss.z | ||
| accel_target_z : accel_target_mss.z, | ||
| yaw_target : wrap_360(degrees(yaw_rad)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the wrap_360?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
I wrapped it to 360° since -π/2 was causing issues to compare with ATT.Yaw and ArduPilot logs yaw in [0, 360), so this makes it easier to compare with ATT.yaw.

@peterbarker let me know your thoughts
ArduCopter/Log.cpp
Outdated
| accel_target_z : accel_target_mss.z | ||
| accel_target_z : accel_target_mss.z, | ||
| yaw_target : wrap_360(degrees(yaw_rad)), | ||
| yaw_rate_target : yaw_rate_rads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| yaw_rate_target : yaw_rate_rads | |
| yaw_rate_target : yaw_rate_rads, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the formatting changes to the code
ArduCopter/Log.cpp
Outdated
| // terrain should be 0 if pos_target_m.z is alt-above-ekf-origin, 1 if alt-above-terrain | ||
| // vel_target_ms is m/s | ||
| void Copter::Log_Write_Guided_Position_Target(ModeGuided::SubMode submode, const Vector3p& pos_target_m, bool is_terrain_alt, const Vector3f& vel_target_ms, const Vector3f& accel_target_mss) | ||
| void Copter::Log_Write_Guided_Position_Target(ModeGuided::SubMode submode, const Vector3p& pos_target_m, bool is_terrain_alt, const Vector3f& vel_target_ms, const Vector3f& accel_target_mss, const float yaw_rad, const float yaw_rate_rads) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void Copter::Log_Write_Guided_Position_Target(ModeGuided::SubMode submode, const Vector3p& pos_target_m, bool is_terrain_alt, const Vector3f& vel_target_ms, const Vector3f& accel_target_mss, const float yaw_rad, const float yaw_rate_rads) | |
| void Copter::Log_Write_Guided_Position_Target(ModeGuided::SubMode submode, const Vector3p& pos_target_m, bool is_terrain_alt, const Vector3f& vel_target_ms, const Vector3f& accel_target_mss, const float yaw_target_rad, const float yaw_target_rate_rads) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the above renaming changes to the code
ArduCopter/mode_guided.cpp
Outdated
| AC_AttitudeControl::HeadingCommand yaw_command = auto_yaw.get_heading(); | ||
| // log target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| AC_AttitudeControl::HeadingCommand yaw_command = auto_yaw.get_heading(); | |
| // log target | |
| // log target | |
| AC_AttitudeControl::HeadingCommand yaw_command = auto_yaw.get_heading(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated the order of comment updates to the code
Hi @peterbarker , |
2718a4e to
c7da249
Compare
…AL_NED Adds support for logging commanded yaw in GUIDED pose targets. Uses AutoYaw object get_heading() to get targets for yaw and yaw rates
c7da249 to
2fbcdf0
Compare
Adds support for logging commanded yaw and yaw rates from the guided setpoint target.
The implementation uses
get_heading()method of the AutoYaw object to get the yaw and yaw rate target.I have tested the branch in SITL.
Please let me know your thoughts on the implementation.
@peterbarker , @rmackay9