|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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);
static struct target_loc_t target_loc
uint8_t target_localization_mark
#define float_rmat_of_eulers
vector in North East Down coordinates Units: meters
#define TARGET_LOC_WP_T3_ID
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
bool target_localization_update_wp
static const float scale[]
struct FloatRMat body_to_cam
Body to camera rotation.
struct NedCoor_f target
Target position in LTP-NED frame.
Event structure to store callbacks in a linked list.
struct LlaCoor_f pos_lla
Target global position in LLA.
uint8_t target_loc_wp_tab[][2]
#define TARGET_LOC_WP_T2_ID
#define TARGET_LOC_BODY_TO_CAM_PSI
Paparazzi floating point algebra.
#define VECT3_ADD(_a, _b)
#define TARGET_LOC_CAM_POS_Z
void cv_target_localization_report_mark(uint8_t mark)
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)
void target_localization_init(void)
void ecef_of_ned_point_f(struct EcefCoor_f *ecef, struct LtpDef_f *def, struct NedCoor_f *ned)
void float_rmat_transp_vmult(struct FloatVect3 *vb, struct FloatRMat *m_b2a, struct FloatVect3 *va)
rotate 3D vector by transposed rotation matrix.
#define TARGET_LOC_PIXEL_TO_IMAGE_X
void float_rmat_vmult(struct FloatVect3 *vb, struct FloatRMat *m_a2b, struct FloatVect3 *va)
rotate 3D vector by rotation matrix.
Paparazzi floating point math for geodetic calculations.
uint8_t type
Type of target.
#define TARGET_LOC_BODY_TO_CAM_PHI
#define FLOAT_VECT3_ZERO(_v)
void float_rmat_comp(struct FloatRMat *m_a2c, struct FloatRMat *m_a2b, struct FloatRMat *m_b2c)
Composition (multiplication) of two rotation matrices.
#define TARGET_LOC_CAM_POS_X
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
void waypoint_move_xy_i(uint8_t wp_id, int32_t x, int32_t y)
#define TARGET_LOC_BODY_TO_CAM_THETA
Common code for AP and FBW telemetry.
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
bool valid
True if a target have been seen.
#define VECT3_SUM_SCALED(_c, _a, _b, _s)
int16_t py
Target in camera frame.
vector in EarthCenteredEarthFixed coordinates
#define TARGET_LOC_PIXEL_TO_IMAGE_Y
#define POS_BFP_OF_REAL(_af)
#define TARGET_LOC_CAM_POS_Y
#define VECT3_ASSIGN(_a, _x, _y, _z)
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
void lla_of_ecef_f(struct LlaCoor_f *out, struct EcefCoor_f *in)
#define TARGET_LOC_WP_T1_ID
int16_t px
Target in camera frame.
void target_localization_report(void)
vector in Latitude, Longitude and Altitude
struct FloatVect3 cam_pos
Position of camera in body frame.