Sub: Organize descend climb_rate calc
Make it more clear to read Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
3ca520021b
commit
a856f747aa
@ -1021,7 +1021,7 @@ void GCS_MAVLINK_Sub::handleMessage(mavlink_message_t* msg)
|
||||
climb_rate_cms = (packet.thrust - 0.5f) * 2.0f * sub.wp_nav.get_speed_up();
|
||||
} else {
|
||||
// descend at up to WPNAV_SPEED_DN
|
||||
climb_rate_cms = (0.5f - packet.thrust) * 2.0f * -fabsf(sub.wp_nav.get_speed_down());
|
||||
climb_rate_cms = (packet.thrust - 0.5f) * 2.0f * fabsf(sub.wp_nav.get_speed_down());
|
||||
}
|
||||
sub.guided_set_angle(Quaternion(packet.q[0],packet.q[1],packet.q[2],packet.q[3]), climb_rate_cms);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user