|
|
|
@ -20,6 +20,10 @@ public:
@@ -20,6 +20,10 @@ public:
|
|
|
|
|
// handle request to align camera's attitude with vehicle's AHRS/EKF attitude
|
|
|
|
|
void align_sensor_to_vehicle() override { _align_camera = true; } |
|
|
|
|
|
|
|
|
|
// update position offsets to align to AHRS position
|
|
|
|
|
// should only be called when this library is not being used as the position source
|
|
|
|
|
void align_position_to_ahrs(bool align_xy, bool align_z) override { _align_posxy = align_xy; _align_posz = align_z; } |
|
|
|
|
|
|
|
|
|
// arming check
|
|
|
|
|
bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const override; |
|
|
|
|
|
|
|
|
@ -42,6 +46,10 @@ protected:
@@ -42,6 +46,10 @@ protected:
|
|
|
|
|
// only the VISION_POSITION_ESTIMATE message's reset_counter is used to determine if sensor data should be ignored
|
|
|
|
|
bool should_consume_sensor_data(bool vision_position_estimate, uint8_t reset_counter); |
|
|
|
|
|
|
|
|
|
// align position with ahrs position by updating _pos_correction
|
|
|
|
|
// sensor_pos should be the position directly from the sensor with only scaling applied (i.e. no yaw or position corrections)
|
|
|
|
|
bool align_position_to_ahrs(const Vector3f &sensor_pos, bool align_xy, bool align_z); |
|
|
|
|
|
|
|
|
|
float _yaw_trim; // yaw angle trim (in radians) to align camera's yaw to ahrs/EKF's
|
|
|
|
|
Quaternion _yaw_rotation; // earth-frame yaw rotation to align heading of sensor with vehicle. use when _yaw_trim is non-zero
|
|
|
|
|
Quaternion _att_rotation; // body-frame rotation corresponding to ORIENT parameter. use when get_orientation != NONE
|
|
|
|
@ -50,6 +58,8 @@ protected:
@@ -50,6 +58,8 @@ protected:
|
|
|
|
|
bool _use_att_rotation; // true if _att_rotation should be applied to sensor's attitude data
|
|
|
|
|
bool _use_posvel_rotation; // true if _posvel_rotation should be applied to sensor's position and/or velocity data
|
|
|
|
|
bool _align_camera = true; // true if camera should be aligned to AHRS/EKF
|
|
|
|
|
bool _align_posxy; // true if sensor xy position should be aligned to AHRS
|
|
|
|
|
bool _align_posz; // true if sensor z position should be aligned to AHRS
|
|
|
|
|
bool _error_orientation; // true if the orientation is not supported
|
|
|
|
|
Quaternion _attitude_last; // last attitude received from camera (used for arming checks)
|
|
|
|
|
uint8_t _pos_reset_counter_last; // last vision-position-estimate reset counter value
|
|
|
|
|