Browse Source

AC_PrecLand: added BUS parameter for precision landing

allow selection of i2c bus for irlock
master
Andrew Tridgell 8 years ago
parent
commit
5d4400f1b7
  1. 7
      libraries/AC_PrecLand/AC_PrecLand.cpp
  2. 1
      libraries/AC_PrecLand/AC_PrecLand.h
  3. 3
      libraries/AC_PrecLand/AC_PrecLand_Backend.h
  4. 2
      libraries/AC_PrecLand/AC_PrecLand_IRLock.cpp
  5. 2
      libraries/AC_PrecLand/AC_PrecLand_SITL_Gazebo.cpp

7
libraries/AC_PrecLand/AC_PrecLand.cpp

@ -83,6 +83,13 @@ const AP_Param::GroupInfo AC_PrecLand::var_info[] = { @@ -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
};

1
libraries/AC_PrecLand/AC_PrecLand.h

@ -107,6 +107,7 @@ private: @@ -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

3
libraries/AC_PrecLand/AC_PrecLand_Backend.h

@ -39,6 +39,9 @@ public: @@ -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

2
libraries/AC_PrecLand/AC_PrecLand_IRLock.cpp

@ -15,7 +15,7 @@ AC_PrecLand_IRLock::AC_PrecLand_IRLock(const AC_PrecLand& frontend, AC_PrecLand: @@ -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

2
libraries/AC_PrecLand/AC_PrecLand_SITL_Gazebo.cpp

@ -15,7 +15,7 @@ AC_PrecLand_SITL_Gazebo::AC_PrecLand_SITL_Gazebo(const AC_PrecLand& frontend, AC @@ -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…
Cancel
Save