mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AntennaTracker: replace ToRad with radians and ToDeg with degrees
This commit is contained in:
committed by
Peter Barker
parent
0a41bc1984
commit
032a3a783d
@@ -371,8 +371,8 @@ void GCS_MAVLINK_Tracker::handle_message_mission_item(const mavlink_message_t &m
|
||||
case MAV_FRAME_LOCAL_NED: // local (relative to home position)
|
||||
{
|
||||
tell_command = Location{
|
||||
int32_t(1.0e7f*ToDeg(packet.x/(RADIUS_OF_EARTH*cosf(ToRad(home.lat/1.0e7f)))) + home.lat),
|
||||
int32_t(1.0e7f*ToDeg(packet.y/RADIUS_OF_EARTH) + home.lng),
|
||||
int32_t(1.0e7f*degrees(packet.x/(RADIUS_OF_EARTH*cosf(radians(home.lat/1.0e7f)))) + home.lat),
|
||||
int32_t(1.0e7f*degrees(packet.y/RADIUS_OF_EARTH) + home.lng),
|
||||
int32_t(-packet.z*1.0e2f),
|
||||
Location::AltFrame::ABOVE_HOME
|
||||
};
|
||||
@@ -384,8 +384,8 @@ void GCS_MAVLINK_Tracker::handle_message_mission_item(const mavlink_message_t &m
|
||||
case MAV_FRAME_LOCAL: // local (relative to home position)
|
||||
{
|
||||
tell_command = {
|
||||
int32_t(1.0e7f*ToDeg(packet.x/(RADIUS_OF_EARTH*cosf(ToRad(home.lat/1.0e7f)))) + home.lat),
|
||||
int32_t(1.0e7f*ToDeg(packet.y/RADIUS_OF_EARTH) + home.lng),
|
||||
int32_t(1.0e7f*degrees(packet.x/(RADIUS_OF_EARTH*cosf(radians(home.lat/1.0e7f)))) + home.lat),
|
||||
int32_t(1.0e7f*degrees(packet.y/RADIUS_OF_EARTH) + home.lng),
|
||||
int32_t(packet.z*1.0e2f),
|
||||
Location::AltFrame::ABOVE_HOME
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user