Skip to content

Commit

Permalink
Review fixes no. 3
Browse files Browse the repository at this point in the history
- Reverted the logging changes (...manually)
- Applied the guardian directive for checking if quadplane is enabled

Co-Authored-By: Peter Hall <[email protected]>
  • Loading branch information
miodine and IamPete1 committed Oct 16, 2023
1 parent 9e9292b commit 26102d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions ArduPlane/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ void GCS_MAVLINK_Plane::send_attitude() const
omega.z);
}

void GCS_MAVLINK_Plane::send_attitude_target() {

void GCS_MAVLINK_Plane::send_attitude_target()
{
#if HAL_QUADPLANE_ENABLED
// Check if the attitude target is valid for reporting
const uint32_t now = AP_HAL::millis();
if (now - plane.quadplane.last_att_control_ms > 100) {
Expand All @@ -182,6 +183,9 @@ void GCS_MAVLINK_Plane::send_attitude_target() {
ang_vel.y, // bodyframe target pitch rate (rad/s)
ang_vel.z, // bodyframe yaw rate (rad/s)
throttle); // Collective thrust, normalized to 0 .. 1

#endif // HAL_QUADPLANE_ENABLED

}


Expand Down
1 change: 0 additions & 1 deletion libraries/AP_Logger/AP_Logger_Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ bool AP_Logger_Backend::Write_VER()
git_hash: fwver.fw_hash,
build_type: fwver.vehicle_type,
};

strncpy(pkt.fw_string, fwver.fw_string, ARRAY_SIZE(pkt.fw_string)-1);

#ifdef APJ_BOARD_ID
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Logger/LogStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,9 @@ struct PACKED log_VER {
uint8_t patch;
uint8_t fw_type;
uint32_t git_hash;
uint8_t build_type;
char fw_string[64];
uint16_t _APJ_BOARD_ID;
uint8_t build_type;
};


Expand Down

0 comments on commit 26102d7

Please sign in to comment.