|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
43 #ifndef OPTICFLOW_AGL_ID
44 #define OPTICFLOW_AGL_ID ABI_BROADCAST
49 #define OPTICFLOW_FPS 0
52 #ifndef OPTICFLOW_FPS_CAMERA2
53 #define OPTICFLOW_FPS_CAMERA2 0
58 #ifdef OPTICFLOW_CAMERA2
59 #define ACTIVE_CAMERAS 2
61 #define ACTIVE_CAMERAS 1
74 #if PERIODIC_TELEMETRY
84 for (
int idx_camera = 0; idx_camera <
ACTIVE_CAMERAS; idx_camera++) {
86 pprz_msg_send_OPTIC_FLOW_EST(trans,
dev, AC_ID,
108 for (
int idx_camera = 0; idx_camera <
ACTIVE_CAMERAS; idx_camera++) {
114 #ifdef OPTICFLOW_CAMERA2
118 #if PERIODIC_TELEMETRY
132 for (
int idx_camera = 0; idx_camera <
ACTIVE_CAMERAS; idx_camera++) {
#define OPTICFLOW_AGL_ID
Default sonar/agl to use in opticflow visual_estimator.
#define OPTICFLOW_FPS_CAMERA2
Default FPS (zero means run at camera fps)
static bool opticflow_got_result[ACTIVE_CAMERAS]
When we have an optical flow calculation.
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
float divergence
Divergence as determined with a linear flow fit.
float surface_roughness
Surface roughness as determined with a linear optical flow fit.
bool opticflow_calc_frame(struct opticflow_t *opticflow, struct image_t *img, struct opticflow_result_t *result)
Run the optical flow on a new image frame.
#define FLOW_OPTICFLOW_ID
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct pose_t get_rotation_at_timestamp(uint32_t timestamp)
Given a pprz timestamp in used (obtained with get_sys_time_usec) we return the pose in FloatEulers cl...
static void opticflow_telem_send(struct transport_tx *trans, struct link_device *dev)
Send optical flow telemetry information.
static const struct usb_device_descriptor dev
struct FloatVect3 vel_body
The velocity in body frame (m/s) with X positive to the front of the aircraft, Y positive to the righ...
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void opticflow_module_run(void)
Update the optical flow state for the calculation thread and update the stabilization loops with the ...
uint8_t camera_id
Camera id as passed to cv_add_to_device.
void opticflow_module_init(void)
Initialize the optical flow module for the bottom camera.
float noise_measurement
noise of measurement, for state filter
struct FloatEulers eulers
#define OPTICFLOW_FPS
Default FPS (zero means run at camera fps)
static pthread_mutex_t opticflow_mutex
Mutex lock fo thread safety.
float div_size
Divergence as determined with the size_divergence script.
struct image_t * opticflow_module_calc(struct image_t *img, uint8_t camera_id)
The main optical flow calculation thread.
uint32_t pprz_ts
The timestamp in us since system startup.
struct opticflow_t opticflow[ACTIVE_CAMERAS]
Opticflow calculations.
static struct opticflow_result_t opticflow_result[ACTIVE_CAMERAS]
The opticflow result.
#define DefaultPeriodic
Set default periodic telemetry.
void opticflow_calc_init(struct opticflow_t opticflow[])
Initialize the opticflow calculator.
struct FloatEulers eulers
Euler Angles at time of image.
optical-flow calculation for Parrot Drones