mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-19 14:23:57 -04:00
AC_PrecLand: added BUS parameter for precision landing
allow selection of i2c bus for irlock
This commit is contained in:
parent
2eb363a950
commit
5d4400f1b7
@ -83,6 +83,13 @@ const AP_Param::GroupInfo AC_PrecLand::var_info[] = {
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CAM_POS", 7, AC_PrecLand, _cam_offset, 0.0f),
|
||||
|
||||
// @Param: BUS
|
||||
// @DisplayName: Sensor Bus
|
||||
// @Description: Precland sensor bus for I2C sensors.
|
||||
// @Values: -1:DefaultBus,0:InternalI2C,1:ExternalI2C
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("BUS", 8, AC_PrecLand, _bus, -1),
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
|
@ -107,6 +107,7 @@ private:
|
||||
// parameters
|
||||
AP_Int8 _enabled; // enabled/disabled and behaviour
|
||||
AP_Int8 _type; // precision landing sensor type
|
||||
AP_Int8 _bus; // which sensor bus
|
||||
AP_Int8 _estimator_type; // precision landing estimator type
|
||||
AP_Float _yaw_align; // Yaw angle from body x-axis to sensor x-axis.
|
||||
AP_Float _land_ofs_cm_x; // Desired landing position of the camera forward of the target in vehicle body frame
|
||||
|
@ -39,6 +39,9 @@ public:
|
||||
// parses a mavlink message from the companion computer
|
||||
virtual void handle_msg(mavlink_message_t* msg) {};
|
||||
|
||||
// get bus parameter
|
||||
int8_t get_bus(void) const { return _frontend._bus.get(); }
|
||||
|
||||
protected:
|
||||
const AC_PrecLand& _frontend; // reference to precision landing front end
|
||||
AC_PrecLand::precland_state &_state; // reference to this instances state
|
||||
|
@ -15,7 +15,7 @@ AC_PrecLand_IRLock::AC_PrecLand_IRLock(const AC_PrecLand& frontend, AC_PrecLand:
|
||||
// init - perform initialisation of this backend
|
||||
void AC_PrecLand_IRLock::init()
|
||||
{
|
||||
irlock.init();
|
||||
irlock.init(get_bus());
|
||||
}
|
||||
|
||||
// update - give chance to driver to get updates from sensor
|
||||
|
@ -15,7 +15,7 @@ AC_PrecLand_SITL_Gazebo::AC_PrecLand_SITL_Gazebo(const AC_PrecLand& frontend, AC
|
||||
// init - perform initialisation of this backend
|
||||
void AC_PrecLand_SITL_Gazebo::init()
|
||||
{
|
||||
irlock.init();
|
||||
irlock.init(get_bus());
|
||||
}
|
||||
|
||||
// update - give chance to driver to get updates from sensor
|
||||
|
Loading…
Reference in New Issue
Block a user