mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Disable manually moving the home location on the opmap (for now).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1979 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
8aecc1ec0a
commit
dc943baeaa
@ -43,6 +43,11 @@
|
|||||||
#include "uavobjects/homelocation.h"
|
#include "uavobjects/homelocation.h"
|
||||||
#include "extensionsystem/pluginmanager.h"
|
#include "extensionsystem/pluginmanager.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define allow_manual_home_location_move
|
||||||
|
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
|
|
||||||
#define deg_to_rad ((double)M_PI / 180.0)
|
#define deg_to_rad ((double)M_PI / 180.0)
|
||||||
@ -680,20 +685,21 @@ void OPMapGadgetWidget::updatePosition()
|
|||||||
float yaw = getUAV_Yaw(); // get current UAV heading
|
float yaw = getUAV_Yaw(); // get current UAV heading
|
||||||
|
|
||||||
internals::PointLatLng uav_pos = internals::PointLatLng(latitude, longitude); // current UAV position
|
internals::PointLatLng uav_pos = internals::PointLatLng(latitude, longitude); // current UAV position
|
||||||
float uav_heading = yaw; // current UAV heading
|
float uav_heading_degrees = yaw; // current UAV heading
|
||||||
float uav_altitude_meters = altitude; // current UAV height
|
float uav_altitude_meters = altitude; // current UAV height
|
||||||
float uav_ground_speed_meters_per_second = 0; //data.Groundspeed; // current UAV ground speed
|
float uav_ground_speed_meters_per_second = 0; //data.Groundspeed; // current UAV ground speed
|
||||||
|
|
||||||
// display the UAV lat/lon position
|
// display the UAV lat/lon position
|
||||||
QString str = "lat: " + QString::number(uav_pos.Lat(), 'f', 7) +
|
QString str =
|
||||||
|
"lat: " + QString::number(uav_pos.Lat(), 'f', 7) +
|
||||||
" lon: " + QString::number(uav_pos.Lng(), 'f', 7) +
|
" lon: " + QString::number(uav_pos.Lng(), 'f', 7) +
|
||||||
" " + QString::number(uav_heading, 'f', 1) + "deg" +
|
" " + QString::number(uav_heading_degrees, 'f', 1) + "deg" +
|
||||||
" " + QString::number(uav_altitude_meters, 'f', 1) + "m" +
|
" " + QString::number(uav_altitude_meters, 'f', 1) + "m" +
|
||||||
" " + QString::number(uav_ground_speed_meters_per_second, 'f', 1) + "m/s";
|
" " + QString::number(uav_ground_speed_meters_per_second, 'f', 1) + "m/s";
|
||||||
m_widget->labelUAVPos->setText(str);
|
m_widget->labelUAVPos->setText(str);
|
||||||
|
|
||||||
m_map->UAV->SetUAVPos(uav_pos, uav_altitude_meters); // set the maps UAV position
|
m_map->UAV->SetUAVPos(uav_pos, uav_altitude_meters); // set the maps UAV position
|
||||||
m_map->UAV->SetUAVHeading(uav_heading); // set the maps UAV heading
|
m_map->UAV->SetUAVHeading(uav_heading_degrees); // set the maps UAV heading
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPMapGadgetWidget::updateMousePos()
|
void OPMapGadgetWidget::updateMousePos()
|
||||||
@ -1502,6 +1508,9 @@ void OPMapGadgetWidget::createActions()
|
|||||||
|
|
||||||
homeMagicWaypointAct = new QAction(tr("Home magic waypoint"), this);
|
homeMagicWaypointAct = new QAction(tr("Home magic waypoint"), this);
|
||||||
homeMagicWaypointAct->setStatusTip(tr("Move the magic waypoint to the home position"));
|
homeMagicWaypointAct->setStatusTip(tr("Move the magic waypoint to the home position"));
|
||||||
|
#if !defined(allow_manual_home_location_move)
|
||||||
|
homeMagicWaypointAct->setEnabled(false);
|
||||||
|
#endif
|
||||||
connect(homeMagicWaypointAct, SIGNAL(triggered()), this, SLOT(onHomeMagicWaypointAct_triggered()));
|
connect(homeMagicWaypointAct, SIGNAL(triggered()), this, SLOT(onHomeMagicWaypointAct_triggered()));
|
||||||
|
|
||||||
mapModeActGroup = new QActionGroup(this);
|
mapModeActGroup = new QActionGroup(this);
|
||||||
@ -2020,10 +2029,12 @@ void OPMapGadgetWidget::homeMagicWaypoint()
|
|||||||
if (m_map_mode != MagicWaypoint_MapMode)
|
if (m_map_mode != MagicWaypoint_MapMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(allow_manual_home_location_move)
|
||||||
magic_waypoint.coord = home_position.coord;
|
magic_waypoint.coord = home_position.coord;
|
||||||
|
|
||||||
if (magic_waypoint.map_wp_item)
|
if (magic_waypoint.map_wp_item)
|
||||||
magic_waypoint.map_wp_item->SetCoord(magic_waypoint.coord);
|
magic_waypoint.map_wp_item->SetCoord(magic_waypoint.coord);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
@ -2043,6 +2054,7 @@ void OPMapGadgetWidget::moveToMagicWaypointPosition()
|
|||||||
|
|
||||||
// ToDo:
|
// ToDo:
|
||||||
|
|
||||||
|
// see ConfigAHRSWidget::launchAHRSCalibration()
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
@ -2106,7 +2118,12 @@ void OPMapGadgetWidget::showMagicWaypointControls()
|
|||||||
{
|
{
|
||||||
m_widget->lineWaypoint->setVisible(true);
|
m_widget->lineWaypoint->setVisible(true);
|
||||||
m_widget->toolButtonHomeWaypoint->setVisible(true);
|
m_widget->toolButtonHomeWaypoint->setVisible(true);
|
||||||
|
|
||||||
|
#if defined(allow_manual_home_location_move)
|
||||||
m_widget->toolButtonMoveToWP->setVisible(true);
|
m_widget->toolButtonMoveToWP->setVisible(true);
|
||||||
|
#else
|
||||||
|
m_widget->toolButtonMoveToWP->setVisible(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
@ -2250,7 +2267,6 @@ bool OPMapGadgetWidget::getUAV_LLA(double &latitude, double &longitude, double &
|
|||||||
altitude = LLA[2];
|
altitude = LLA[2];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
// return QPointF(LLA[0], LLA[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double OPMapGadgetWidget::getUAV_Yaw()
|
double OPMapGadgetWidget::getUAV_Yaw()
|
||||||
|
Loading…
Reference in New Issue
Block a user