mirror of https://github.com/ArduPilot/ardupilot
Plane: compile in AC_PrecLand for scripting
This commit is contained in:
parent
e5f092482d
commit
a4109c6cf2
|
@ -135,6 +135,9 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = {
|
||||||
#if AP_LANDINGGEAR_ENABLED
|
#if AP_LANDINGGEAR_ENABLED
|
||||||
SCHED_TASK(landing_gear_update, 5, 50, 159),
|
SCHED_TASK(landing_gear_update, 5, 50, 159),
|
||||||
#endif
|
#endif
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
SCHED_TASK(precland_update, 400, 50, 160),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void Plane::get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
|
void Plane::get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
|
||||||
|
@ -947,4 +950,13 @@ bool Plane::flight_option_enabled(FlightOptions flight_option) const
|
||||||
return g2.flight_options & flight_option;
|
return g2.flight_options & flight_option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
void Plane::precland_update(void)
|
||||||
|
{
|
||||||
|
// alt will be unused if we pass false through as the second parameter:
|
||||||
|
return g2.precland.update(rangefinder_state.height_estimate*100,
|
||||||
|
rangefinder_state.in_range && rangefinder_state.in_use);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_HAL_MAIN_CALLBACKS(&plane);
|
AP_HAL_MAIN_CALLBACKS(&plane);
|
||||||
|
|
|
@ -1242,7 +1242,13 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
|
||||||
// @Bitmask: 0:Roll,1:Pitch,2:Yaw
|
// @Bitmask: 0:Roll,1:Pitch,2:Yaw
|
||||||
// @User: Standard
|
// @User: Standard
|
||||||
AP_GROUPINFO("AUTOTUNE_AXES", 34, ParametersG2, axis_bitmask, 7),
|
AP_GROUPINFO("AUTOTUNE_AXES", 34, ParametersG2, axis_bitmask, 7),
|
||||||
|
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
// @Group: PLND_
|
||||||
|
// @Path: ../libraries/AC_PrecLand/AC_PrecLand.cpp
|
||||||
|
AP_SUBGROUPINFO(precland, "PLND_", 35, ParametersG2, AC_PrecLand),
|
||||||
|
#endif
|
||||||
|
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -520,6 +520,10 @@ public:
|
||||||
AP_LandingGear landing_gear;
|
AP_LandingGear landing_gear;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
AC_PrecLand precland;
|
||||||
|
#endif
|
||||||
|
|
||||||
// crow flaps weighting
|
// crow flaps weighting
|
||||||
AP_Int8 crow_flap_weight_outer;
|
AP_Int8 crow_flap_weight_outer;
|
||||||
AP_Int8 crow_flap_weight_inner;
|
AP_Int8 crow_flap_weight_inner;
|
||||||
|
|
|
@ -87,6 +87,11 @@
|
||||||
#include "AP_ExternalControl_Plane.h"
|
#include "AP_ExternalControl_Plane.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <AC_PrecLand/AC_PrecLand_config.h>
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
# include <AC_PrecLand/AC_PrecLand.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "GCS_Mavlink.h"
|
#include "GCS_Mavlink.h"
|
||||||
#include "GCS_Plane.h"
|
#include "GCS_Plane.h"
|
||||||
#include "quadplane.h"
|
#include "quadplane.h"
|
||||||
|
@ -251,6 +256,10 @@ private:
|
||||||
AP_Rally rally;
|
AP_Rally rally;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
void precland_update(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
// returns a Location for a rally point or home; if
|
// returns a Location for a rally point or home; if
|
||||||
// HAL_RALLY_ENABLED is false, just home.
|
// HAL_RALLY_ENABLED is false, just home.
|
||||||
Location calc_best_rally_or_home_location(const Location ¤t_loc, float rtl_home_alt_amsl_cm) const;
|
Location calc_best_rally_or_home_location(const Location ¤t_loc, float rtl_home_alt_amsl_cm) const;
|
||||||
|
|
|
@ -132,6 +132,10 @@ void Plane::init_ardupilot()
|
||||||
optflow.init(-1);
|
optflow.init(-1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if AC_PRECLAND_ENABLED
|
||||||
|
g2.precland.init(scheduler.get_loop_rate_hz());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//********************************************************************************
|
//********************************************************************************
|
||||||
|
|
|
@ -29,6 +29,8 @@ def build(bld):
|
||||||
'AP_OSD',
|
'AP_OSD',
|
||||||
'AC_AutoTune',
|
'AC_AutoTune',
|
||||||
'AP_Follow',
|
'AP_Follow',
|
||||||
|
'AC_PrecLand',
|
||||||
|
'AP_IRLock',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue