mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 03:41:37 +08:00
test_vtol_mission: Add additional testing for VTOL RTL and reverse mission RTL
mavsdk-test: added a vtol mission without a landing at the end (used for reversed RTL) math_helpers: added function to compute local position from a raw mission item Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
committed by
Silvan Fuhrer
parent
9a48d375ce
commit
6fca984c3f
@@ -44,6 +44,20 @@ std::array<T, 3> get_local_mission_item(const Mission::MissionItem &item, const
|
||||
return {static_cast<T>(local.north_m), static_cast<T>(local.east_m), -item.relative_altitude_m};
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::array<T, 3> get_local_mission_item_from_raw_item(const mavsdk::MissionRaw::MissionItem &item,
|
||||
const CoordinateTransformation &ct)
|
||||
{
|
||||
using GlobalCoordinate = mavsdk::geometry::CoordinateTransformation::GlobalCoordinate;
|
||||
GlobalCoordinate global;
|
||||
global.latitude_deg = item.x / 1e7;
|
||||
global.longitude_deg = item.y / 1e7;
|
||||
|
||||
|
||||
auto local = ct.local_from_global(global);
|
||||
return {static_cast<T>(local.north_m), static_cast<T>(local.east_m), -item.z};
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T sq(T x)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user