37 #include "generated/flight_plan.h"
44 #ifndef TARGET_LOC_BODY_TO_CAM_PHI
45 #define TARGET_LOC_BODY_TO_CAM_PHI 0.f
48 #ifndef TARGET_LOC_BODY_TO_CAM_THETA
49 #define TARGET_LOC_BODY_TO_CAM_THETA 0.f
52 #ifndef TARGET_LOC_BODY_TO_CAM_PSI
53 #define TARGET_LOC_BODY_TO_CAM_PSI M_PI_2
56 #ifndef TARGET_LOC_CAM_POS_X
57 #define TARGET_LOC_CAM_POS_X 0.f
60 #ifndef TARGET_LOC_CAM_POS_Y
61 #define TARGET_LOC_CAM_POS_Y 0.f
64 #ifndef TARGET_LOC_CAM_POS_Z
65 #define TARGET_LOC_CAM_POS_Z 0.f
70 #ifndef TARGET_LOC_PIXEL_TO_IMAGE_X
71 #define TARGET_LOC_PIXEL_TO_IMAGE_X (1.f / 1000.f)
75 #ifndef TARGET_LOC_PIXEL_TO_IMAGE_Y
76 #define TARGET_LOC_PIXEL_TO_IMAGE_Y TARGET_LOC_PIXEL_TO_IMAGE_X
104 #ifndef TARGET_LOC_WP_T1_ID
105 #define TARGET_LOC_WP_T1_ID 1
107 #ifndef TARGET_LOC_WP_T2_ID
108 #define TARGET_LOC_WP_T2_ID 2
110 #ifndef TARGET_LOC_WP_T3_ID
111 #define TARGET_LOC_WP_T3_ID 3
114 #ifdef TARGET_LOC_WP_T1
117 #ifdef TARGET_LOC_WP_T2
120 #ifdef TARGET_LOC_WP_T3
127 #ifndef TARGET_LOC_ID
128 #define TARGET_LOC_ID ABI_BROADCAST
160 if (fabsf(tmp.
z) > 0.1f) {
161 float scale = fabsf(cam_pos_ltp.
z / tmp.
z);
238 float lat_deg = DegOfRad(pos->
lat);
239 float lon_deg = DegOfRad(pos->
lon);
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
int16_t px
Target in camera frame.
#define TARGET_LOC_CAM_POS_X
#define TARGET_LOC_PIXEL_TO_IMAGE_Y
#define TARGET_LOC_CAM_POS_Z
#define TARGET_LOC_BODY_TO_CAM_PSI
#define TARGET_LOC_WP_T3_ID
void cv_target_localization_report_mark(uint8_t mark)
struct FloatVect3 cam_pos
Position of camera in body frame.
uint8_t target_localization_mark
#define TARGET_LOC_BODY_TO_CAM_PHI
static struct target_loc_t target_loc
#define TARGET_LOC_BODY_TO_CAM_THETA
void target_localization_init(void)
static void detection_cb(uint8_t sender_id UNUSED, int16_t pixel_x, int16_t pixel_y, int16_t pixel_width UNUSED, int16_t pixel_height UNUSED, int32_t quality UNUSED, int16_t extra)
struct FloatRMat body_to_cam
Body to camera rotation.
uint8_t type
Type of target.
int16_t py
Target in camera frame.
struct LlaCoor_f pos_lla
Target global position in LLA.
bool target_localization_update_wp
struct NedCoor_f target
Target position in LTP-NED frame.
bool valid
True if a target have been seen.
#define TARGET_LOC_WP_T1_ID
uint8_t target_loc_wp_tab[][2]
#define TARGET_LOC_PIXEL_TO_IMAGE_X
void target_localization_report(void)
#define TARGET_LOC_CAM_POS_Y
#define TARGET_LOC_WP_T2_ID
Common code for AP and FBW telemetry.
static const float scale[]
#define FLOAT_VECT3_ZERO(_v)
#define float_rmat_of_eulers
void float_rmat_comp(struct FloatRMat *m_a2c, struct FloatRMat *m_a2b, struct FloatRMat *m_b2c)
Composition (multiplication) of two rotation matrices.
void float_rmat_transp_vmult(struct FloatVect3 *vb, struct FloatRMat *m_b2a, struct FloatVect3 *va)
rotate 3D vector by transposed rotation matrix.
void float_rmat_vmult(struct FloatVect3 *vb, struct FloatRMat *m_a2b, struct FloatVect3 *va)
rotate 3D vector by rotation matrix.
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define VECT3_ADD(_a, _b)
#define VECT3_SUM_SCALED(_c, _a, _b, _s)
#define POS_BFP_OF_REAL(_af)
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
static struct LtpDef_f * stateGetNedOrigin_f(void)
Get the coordinate NED frame origin (float)
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
void waypoint_move_xy_i(uint8_t wp_id, int32_t x, int32_t y)
Paparazzi floating point algebra.
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in)
Paparazzi floating point math for geodetic calculations.
vector in EarthCenteredEarthFixed coordinates
vector in Latitude, Longitude and Altitude
vector in North East Down coordinates Units: meters
API to get/set the generic vehicle states.
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.