Skip to content
Snippets Groups Projects
Commit a83a4768 authored by Randy Mackay's avatar Randy Mackay
Browse files

Copter: remove get_angle_targets_for_reporting fn

this saves a tiny amount of time by removing the memory copy of a
Vector3f
parent f6e12bda
No related branches found
No related tags found
No related merge requests found
...@@ -276,8 +276,7 @@ static void NOINLINE send_location(mavlink_channel_t chan) ...@@ -276,8 +276,7 @@ static void NOINLINE send_location(mavlink_channel_t chan)
static void NOINLINE send_nav_controller_output(mavlink_channel_t chan) static void NOINLINE send_nav_controller_output(mavlink_channel_t chan)
{ {
Vector3f targets; const Vector3f &targets = attitude_control.angle_ef_targets();
get_angle_targets_for_reporting(targets);
mavlink_msg_nav_controller_output_send( mavlink_msg_nav_controller_output_send(
chan, chan,
targets.x / 1.0e2f, targets.x / 1.0e2f,
......
...@@ -469,8 +469,7 @@ struct PACKED log_Attitude { ...@@ -469,8 +469,7 @@ struct PACKED log_Attitude {
// Write an attitude packet // Write an attitude packet
static void Log_Write_Attitude() static void Log_Write_Attitude()
{ {
Vector3f targets; const Vector3f &targets = attitude_control.angle_ef_targets();
get_angle_targets_for_reporting(targets);
struct log_Attitude pkt = { struct log_Attitude pkt = {
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG), LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG),
time_ms : hal.scheduler->millis(), time_ms : hal.scheduler->millis(),
......
...@@ -327,8 +327,3 @@ print_flight_mode(AP_HAL::BetterStream *port, uint8_t mode) ...@@ -327,8 +327,3 @@ print_flight_mode(AP_HAL::BetterStream *port, uint8_t mode)
} }
} }
// get_angle_targets_for_reporting() - returns 3d vector of roll, pitch and yaw target angles for logging and reporting to GCS
static void get_angle_targets_for_reporting(Vector3f& targets)
{
targets = attitude_control.angle_ef_targets();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment