Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
tag_tracking.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3  *
4  * This file is part of paparazzi
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
32 #include "generated/modules.h"
33 #include "state.h"
34 #include "modules/core/abi.h"
35 #include <math.h>
37 
38 #include "generated/flight_plan.h"
39 #if !(defined TAG_TRACKING_WP) && (defined WP_TAG)
40 #define TAG_TRACKING_WP WP_TAG
41 #endif
42 
43 // use WP_TARGET by default for simulation
44 #if !(defined TAG_TRACKING_SIM_WP) && (defined WP_TARGET)
45 #define TAG_TRACKING_SIM_WP WP_TARGET
46 #endif
47 
48 #if defined SITL && defined TAG_TRACKING_SIM_WP
49 static void tag_tracking_sim(void);
50 static void tag_motion_sim(void);
51 
52 // select print function for debug
53 #include <stdio.h>
54 #define PRINTF printf
55 // #define PRINTF(...) {}
56 
57 #define TAG_MOTION_NONE 0
58 #define TAG_MOTION_LINE 1
59 #define TAG_MOTION_CIRCLE 2
60 
61 #define TAG_MOTION_SPEED_X 0.25f //0.5f
62 #define TAG_MOTION_SPEED_Y 0.f
63 #define TAG_MOTION_RANGE_X 4.f
64 #define TAG_MOTION_RANGE_Y 4.f
65 
66 static uint8_t tag_motion_sim_type = TAG_MOTION_NONE;
67 static struct FloatVect3 tag_motion_speed = { TAG_MOTION_SPEED_X, TAG_MOTION_SPEED_Y, 0.f };
68 
69 // variables for circle
70 int time_circle = 0;
71 float time_circle_corrected;
72 float speed_circle = 0.03;
73 
74 #endif // SITL
75 
76 // Default parameters
77 // Camera is looking down and is placed at the center of the frame
78 // With cam X axis pointing to the right, Y down and Z forward of image frame,
79 // the camera is just rotated of pi/2 around body Z axis
80 
81 #ifndef TAG_TRACKING_BODY_TO_CAM_PHI
82 #define TAG_TRACKING_BODY_TO_CAM_PHI 0.f
83 #endif
84 
85 #ifndef TAG_TRACKING_BODY_TO_CAM_THETA
86 #define TAG_TRACKING_BODY_TO_CAM_THETA 0.f
87 #endif
88 
89 #ifndef TAG_TRACKING_BODY_TO_CAM_PSI
90 #define TAG_TRACKING_BODY_TO_CAM_PSI M_PI_2
91 #endif
92 
93 #ifndef TAG_TRACKING_CAM_POS_X
94 #define TAG_TRACKING_CAM_POS_X 0.f
95 #endif
96 
97 #ifndef TAG_TRACKING_CAM_POS_Y
98 #define TAG_TRACKING_CAM_POS_Y 0.f
99 #endif
100 
101 #ifndef TAG_TRACKING_CAM_POS_Z
102 #define TAG_TRACKING_CAM_POS_Z 0.f
103 #endif
104 
105 #ifndef TAG_TRACKING_COORD_TO_M
106 #define TAG_TRACKING_COORD_TO_M (1.f / 1000.f)
107 #endif
108 
109 #ifndef TAG_TRACKING_R
110 #define TAG_TRACKING_R 1.f
111 #endif
112 
113 #ifndef TAG_TRACKING_Q_SIGMA2
114 #define TAG_TRACKING_Q_SIGMA2 1.f
115 #endif
116 
117 #ifndef TAG_TRACKING_P0_POS
118 #define TAG_TRACKING_P0_POS 10.f
119 #endif
120 
121 #ifndef TAG_TRACKING_P0_SPEED
122 #define TAG_TRACKING_P0_SPEED 10.f
123 #endif
124 
125 #ifndef TAG_TRACKING_TIMEOUT
126 #define TAG_TRACKING_TIMEOUT 5.f
127 #endif
128 
129 #ifndef TAG_TRACKING_PREDICT_TIME
130 #define TAG_TRACKING_PREDICT_TIME 1.f
131 #endif
132 
133 #ifndef TAG_TRACKING_MAX_OFFSET
134 #define TAG_TRACKING_MAX_OFFSET 2.0f
135 #endif
136 
137 #ifndef TAG_TRACKING_KP
138 #define TAG_TRACKING_KP 0.5f
139 #endif
140 
141 #ifndef TAG_TRACKING_KPZ
142 #define TAG_TRACKING_KPZ 0.2f
143 #endif
144 
145 #ifndef TAG_TRACKING_MAX_SPEED
146 #define TAG_TRACKING_MAX_SPEED 4.f
147 #endif
148 
149 #ifndef TAG_TRACKING_MAX_VZ
150 #define TAG_TRACKING_MAX_VZ 2.f
151 #endif
152 
153 // generated in modules.h
154 static const float tag_track_dt = TAG_TRACKING_PROPAGATE_PERIOD;
155 
156 // global state structure
157 struct tag_tracking {
158  struct FloatVect3 meas;
159 
160  struct FloatRMat body_to_cam;
161  struct FloatVect3 cam_pos;
162 
163  float timeout;
164  bool updated;
165 
167 };
168 
169 static struct tag_tracking tag_track_private;
170 static struct SimpleKinematicKalman kalman;
171 
173 
174 // Abi bindings
175 #ifndef TAG_TRACKING_ID
176 #define TAG_TRACKING_ID ABI_BROADCAST
177 #endif
178 
180 
181 // update measure vect before calling
182 static void update_tag_position(void)
183 {
184  struct FloatVect3 target_pos_ned, target_pos_body;
185  // compute target position in body frame (rotate and translate)
187  VECT3_ADD(target_pos_body, tag_track_private.cam_pos);
188  // rotate to ltp frame
189  struct FloatRMat *ltp_to_body_rmat = stateGetNedToBodyRMat_f();
190  float_rmat_transp_vmult(&target_pos_ned, ltp_to_body_rmat, &target_pos_body);
191  // compute absolute position of tag in earth frame
192  struct NedCoor_f * pos_ned = stateGetPositionNed_f();
193  VECT3_ADD(target_pos_ned, *pos_ned);
194 
195  if (tag_tracking.status == TAG_TRACKING_DISABLE) {
196  // don't run kalman, just update pos, set speed to zero
197  tag_tracking.pos = target_pos_ned;
199  } else {
200  // update state and status
201  if (tag_tracking.status != TAG_TRACKING_RUNNING) {
202  // reset state after first detection or lost tag
203  struct FloatVect3 speed = { 0.f, 0.f, 0.f };
204  simple_kinematic_kalman_set_state(&kalman, target_pos_ned, speed);
206  }
207  else {
208  // RUNNING state, call correction step
209  simple_kinematic_kalman_update_pos(&kalman, target_pos_ned);
210  }
211  // update public structure
213  }
214 }
215 
216 static void tag_track_cb(uint8_t sender_id UNUSED,
217  uint8_t type, char * id,
218  uint8_t nb UNUSED, int16_t * coord, uint16_t * dim UNUSED,
219  struct FloatQuat quat UNUSED, char * extra UNUSED)
220 {
221  if (type == JEVOIS_MSG_D3) {
222  // store data from Jevois detection
226  // update filter
228  // store tag ID
230  // reset timeout and status
232  tag_track_private.updated = true;
233  }
234 }
235 
237 {
238  // update x,y,z position from lat,lon,alt fields
239  tag_track_private.meas.x = DL_TARGET_POS_lat(buf) * TAG_TRACKING_COORD_TO_M;
240  tag_track_private.meas.y = DL_TARGET_POS_lon(buf) * TAG_TRACKING_COORD_TO_M;
241  tag_track_private.meas.z = DL_TARGET_POS_alt(buf) * TAG_TRACKING_COORD_TO_M;
242  // update filter
244  // store tag ID
245  tag_track_private.id = DL_TARGET_POS_target_id(buf);
246  // reset timeout and status
248  tag_track_private.updated = true;
249 }
250 
251 // Update and display tracking WP
252 static void update_wp(bool report UNUSED)
253 {
254 #ifdef TAG_TRACKING_WP
255  struct FloatVect3 target_pos_enu, target_pos_pred;
256  ENU_OF_TO_NED(target_pos_enu, tag_tracking.pos); // convert local target pos to ENU
257  if (tag_tracking.motion_type == TAG_TRACKING_MOVING) {
258  // when moving mode, predict tag position
259  ENU_OF_TO_NED(target_pos_pred, tag_tracking.speed);
260  VECT2_SMUL(target_pos_pred, target_pos_pred, tag_tracking.predict_time); // pos offset at predict_time
261  VECT2_STRIM(target_pos_pred, -TAG_TRACKING_MAX_OFFSET, TAG_TRACKING_MAX_OFFSET); // trim max offset
262  VECT3_ADD(target_pos_enu, target_pos_pred); // add prediction offset
263  }
264  struct EnuCoor_i pos_i;
265  ENU_BFP_OF_REAL(pos_i, target_pos_enu);
266  if (report) {
267  // move is a set + downlink report
268  waypoint_move_enu_i(TAG_TRACKING_WP, &pos_i);
269  } else {
270  waypoint_set_enu_i(TAG_TRACKING_WP, &pos_i);
271  }
272 #endif
273 }
274 
275 // Init function
277 {
278  // Init structure
282  FLOAT_VECT3_ZERO(tag_tracking.speed_cmd);
283  struct FloatEulers euler = {
287  };
295 
296  // Bind to ABI message
297  AbiBindMsgJEVOIS_MSG(TAG_TRACKING_ID, &tag_track_ev, tag_track_cb);
298 
300  tag_tracking.motion_type = TAG_TRACKING_FIXED_POS;
303  tag_track_private.updated = false;
304 }
305 
306 
307 // Propagation function
309 {
310 #if defined SITL && defined TAG_TRACKING_SIM_WP
311  if (tag_motion_sim_type != TAG_MOTION_NONE) {
312  tag_motion_sim();
313  }
314  tag_tracking_sim();
315 #endif
316 
317  switch (tag_tracking.status) {
319  // don't propagate, wait for first detection
320  break;
322  // call kalman propagation step
324  // force speed to zero for fixed tag
325  if (tag_tracking.motion_type == TAG_TRACKING_FIXED_POS) {
326  struct FloatVect3 zero = { 0.f, 0.f, 0.f };
328  }
329  // update public structure
331  // update WP
332  update_wp(false);
333  // increment timeout counter
337  }
338  break;
339  case TAG_TRACKING_LOST:
340  // tag is lost, restart filter and wait for a new detection
342  break;
343  default:
344  break;
345  }
346 }
347 
348 // Propagation start function (called at each start state)
350 {
354 }
355 
356 // Report function
358 {
359 #if TAG_TRACKING_DEBUG
360  float msg[] = {
361  kalman.state[0],
362  kalman.state[1],
363  kalman.state[2],
364  kalman.state[3],
365  kalman.state[4],
366  kalman.state[5],
367  (float)tag_tracking.status
368  };
369  DOWNLINK_SEND_PAYLOAD_FLOAT(DefaultChannel, DefaultDevice, 7, msg);
370 #endif
371 
373  // compute absolute position
374  struct LlaCoor_f tag_lla;
375  struct EcefCoor_f tag_ecef;
376  ecef_of_ned_point_f(&tag_ecef, &state.ned_origin_f, (struct NedCoor_f *)(&tag_tracking.pos));
377  lla_of_ecef_f(&tag_lla, &tag_ecef);
378  float lat_deg = DegOfRad(tag_lla.lat);
379  float lon_deg = DegOfRad(tag_lla.lon);
380  DOWNLINK_SEND_MARK(DefaultChannel, DefaultDevice, &tag_track_private.id,
381  &lat_deg, &lon_deg);
382  update_wp(true);
383  tag_track_private.updated = false;
384  }
385 }
386 
394 {
395  if (tag_tracking.status == TAG_TRACKING_RUNNING) {
396  // compute speed command as estimated tag speed + gain * position error
397  struct NedCoor_f pos = *stateGetPositionNed_f();
398  tag_tracking.speed_cmd.x = tag_tracking.speed.x + tag_tracking.kp * (tag_tracking.pos.x - pos.x);
399  tag_tracking.speed_cmd.y = tag_tracking.speed.y + tag_tracking.kp * (tag_tracking.pos.y - pos.y);
400  tag_tracking.speed_cmd.z = tag_tracking.speed.z + tag_tracking.kpz * (tag_tracking.pos.z - pos.z);
401  VECT2_STRIM(tag_tracking.speed_cmd, -TAG_TRACKING_MAX_SPEED, TAG_TRACKING_MAX_SPEED); // trim max horizontal speed
402  BoundAbs(tag_tracking.speed_cmd.z, TAG_TRACKING_MAX_VZ); // tim max vertical speed
403  }
404  else {
405  // filter is not runing, set speed command to zero
406  FLOAT_VECT3_ZERO(tag_tracking.speed_cmd);
407  }
408 }
409 
410 // Simulate detection using a WP coordinate
411 #if defined SITL && defined TAG_TRACKING_SIM_WP
412 static void tag_tracking_sim(void)
413 {
414  // Compute image coordinates of a WP given fake camera parameters
415  struct FloatRMat *ltp_to_body_rmat = stateGetNedToBodyRMat_f();
416  struct FloatRMat ltp_to_cam_rmat;
417  float_rmat_comp(&ltp_to_cam_rmat, ltp_to_body_rmat, &tag_track_private.body_to_cam);
418  // Prepare cam world position
419  // C_w = P_w + R_w2b * C_b
420  struct FloatVect3 cam_pos_ltp;
421  float_rmat_vmult(&cam_pos_ltp, ltp_to_body_rmat, &tag_track_private.cam_pos);
422  VECT3_ADD(cam_pos_ltp, *stateGetPositionNed_f());
423  // Target
424  struct NedCoor_f target_ltp;
425  ENU_OF_TO_NED(target_ltp, waypoints[TAG_TRACKING_SIM_WP].enu_f);
426  target_ltp.z = 0.f; // force on the ground
427  // Compute target in camera frame Pc = R * (Pw - C)
428  struct FloatVect3 target_cam, tmp;
429  VECT3_DIFF(tmp, target_ltp, cam_pos_ltp);
430  float_rmat_vmult(&target_cam, &ltp_to_cam_rmat, &tmp);
431  if (fabsf(target_cam.z) > 1.) {
432  // If we are not too close from target
433  // Compute target in image frame x = X/Z, y = X/Z
434  if (fabsf(target_cam.x / target_cam.z) < 0.3f &&
435  fabsf(target_cam.y / target_cam.z) < 0.3f) {
436  // If in field of view (~tan(60)/2)
437  // send coordinates in millimeter
438  int16_t coord[3] = {
439  (int16_t) (target_cam.x * 1000.f),
440  (int16_t) (target_cam.y * 1000.f),
441  (int16_t) (target_cam.z * 1000.f)
442  };
443  uint16_t dim[3] = { 100, 100, 0 };
444  struct FloatQuat quat; // TODO
445  float_quat_identity(&quat);
446  AbiSendMsgJEVOIS_MSG(42, JEVOIS_MSG_D3, "1", 3, coord, dim, quat, "");
447  }
448  }
449 }
450 
451 static void tag_motion_sim(void)
452 {
453  switch (tag_motion_sim_type) {
454  case TAG_MOTION_LINE:
455  {
456  struct EnuCoor_f pos = waypoints[TAG_TRACKING_SIM_WP].enu_f;
457  struct FloatVect3 speed_dt = tag_motion_speed;
458  VECT2_SMUL(speed_dt, speed_dt, tag_track_dt);
459  if (pos.x < -TAG_MOTION_RANGE_X || pos.x > TAG_MOTION_RANGE_X ||
460  pos.y < -TAG_MOTION_RANGE_Y || pos.y > TAG_MOTION_RANGE_Y) {
461  tag_motion_speed.x = -tag_motion_speed.x;
462  tag_motion_speed.y = -tag_motion_speed.y;
463  speed_dt.x = -speed_dt.x;
464  speed_dt.y = -speed_dt.y;
465  }
466  VECT2_ADD(pos, speed_dt);
467  struct EnuCoor_i pos_i;
468  ENU_BFP_OF_REAL(pos_i, pos);
469  waypoint_move_enu_i(TAG_TRACKING_SIM_WP, &pos_i);
470  break;
471  }
472  case TAG_MOTION_CIRCLE:
473  {
474  time_circle += 1;
475  time_circle_corrected = time_circle * 0.02;
476  struct EnuCoor_f pos = waypoints[TAG_TRACKING_SIM_WP].enu_f;
477  struct FloatVect3 speed_dt = tag_motion_speed;
478  VECT2_SMUL(speed_dt, speed_dt, tag_track_dt);
479  tag_motion_speed.x = speed_circle * cos(time_circle_corrected);
480  tag_motion_speed.y = speed_circle * sin(time_circle_corrected);
481  speed_dt.x = speed_circle * cos(time_circle_corrected);;
482  speed_dt.y = speed_circle * sin(time_circle_corrected);
483  VECT2_ADD(pos, speed_dt);
484  struct EnuCoor_i pos_i;
485  ENU_BFP_OF_REAL(pos_i, pos);
486  waypoint_move_enu_i(TAG_TRACKING_SIM_WP, &pos_i);
487  }
488  default:
489  break;
490  }
491 }
492 
493 #endif
494 
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
Definition: abi_common.h:67
uint8_t last_wp UNUSED
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
Definition: common_nav.c:39
static void float_quat_identity(struct FloatQuat *q)
initialises a quaternion to identity
#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.
euler angles
Roation quaternion.
rotation matrix
#define VECT2_ADD(_a, _b)
Definition: pprz_algebra.h:74
#define VECT2_SMUL(_vo, _vi, _s)
Definition: pprz_algebra.h:98
#define VECT2_STRIM(_v, _min, _max)
Definition: pprz_algebra.h:110
#define VECT3_ASSIGN(_a, _x, _y, _z)
Definition: pprz_algebra.h:125
#define VECT3_DIFF(_c, _a, _b)
Definition: pprz_algebra.h:182
#define VECT3_ADD(_a, _b)
Definition: pprz_algebra.h:147
#define ENU_OF_TO_NED(_po, _pi)
Definition: pprz_geodetic.h:41
#define ENU_BFP_OF_REAL(_o, _i)
vector in East North Up coordinates
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
Definition: state.h:1137
struct State state
Definition: state.c:36
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
Definition: state.h:220
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
Definition: state.h:710
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
int jevois_extract_nb(char *in)
Extract a number from jevoid ID field.
Definition: jevois.c:131
#define JEVOIS_MSG_D3
Definition: jevois.h:41
void waypoint_move_enu_i(uint8_t wp_id, struct EnuCoor_i *new_pos)
Definition: waypoints.c:189
void waypoint_set_enu_i(uint8_t wp_id, struct EnuCoor_i *enu)
Definition: waypoints.c:165
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)
float y
in meters
float x
in meters
float lon
in radians
float z
in meters
float x
in meters
float lat
in radians
float y
in meters
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates Units: meters
vector in Latitude, Longitude and Altitude
vector in North East Down coordinates Units: meters
void simple_kinematic_kalman_get_state(struct SimpleKinematicKalman *kalman, struct FloatVect3 *pos, struct FloatVect3 *speed)
Get current state.
void simple_kinematic_kalman_predict(struct SimpleKinematicKalman *kalman)
propagate dynamic model
void simple_kinematic_kalman_set_state(struct SimpleKinematicKalman *kalman, struct FloatVect3 pos, struct FloatVect3 speed)
Set initial state vector.
void simple_kinematic_kalman_update_pos(struct SimpleKinematicKalman *kalman, struct FloatVect3 pos)
correction step for position
void simple_kinematic_kalman_init(struct SimpleKinematicKalman *kalman, float P0_pos, float P0_speed, float Q_sigma2, float r, float dt)
Init SimpleKinematicKalman internal struct.
void simple_kinematic_kalman_update_speed(struct SimpleKinematicKalman *kalman, struct FloatVect3 speed, uint8_t type)
correction step for speed
#define SIMPLE_KINEMATIC_KALMAN_SPEED_3D
float state[SIMPLE_KINEMATIC_KALMAN_DIM]
state vector
API to get/set the generic vehicle states.
void tag_tracking_propagate_start()
Definition: tag_tracking.c:349
static abi_event tag_track_ev
Definition: tag_tracking.c:179
static void tag_track_cb(uint8_t sender_id UNUSED, uint8_t type, char *id, uint8_t nb UNUSED, int16_t *coord, uint16_t *dim UNUSED, struct FloatQuat quat UNUSED, char *extra UNUSED)
Definition: tag_tracking.c:216
static const float tag_track_dt
Definition: tag_tracking.c:154
#define TAG_TRACKING_TIMEOUT
Definition: tag_tracking.c:126
#define TAG_TRACKING_KP
Definition: tag_tracking.c:138
void tag_tracking_init()
Definition: tag_tracking.c:276
struct FloatVect3 meas
measured position
Definition: tag_tracking.c:158
#define TAG_TRACKING_MAX_VZ
Definition: tag_tracking.c:150
#define TAG_TRACKING_CAM_POS_Z
Definition: tag_tracking.c:102
#define TAG_TRACKING_CAM_POS_Y
Definition: tag_tracking.c:98
#define TAG_TRACKING_BODY_TO_CAM_THETA
Definition: tag_tracking.c:86
void tag_tracking_propagate()
Definition: tag_tracking.c:308
#define TAG_TRACKING_PREDICT_TIME
Definition: tag_tracking.c:130
#define TAG_TRACKING_Q_SIGMA2
Definition: tag_tracking.c:114
#define TAG_TRACKING_BODY_TO_CAM_PSI
Definition: tag_tracking.c:90
float timeout
timeout for lost flag [sec]
Definition: tag_tracking.c:163
#define TAG_TRACKING_KPZ
Definition: tag_tracking.c:142
struct FloatVect3 cam_pos
Position of camera in body frame.
Definition: tag_tracking.c:161
#define TAG_TRACKING_BODY_TO_CAM_PHI
Definition: tag_tracking.c:82
bool updated
updated state
Definition: tag_tracking.c:164
#define TAG_TRACKING_COORD_TO_M
Definition: tag_tracking.c:106
static void update_wp(bool report UNUSED)
Definition: tag_tracking.c:252
void tag_tracking_report()
Definition: tag_tracking.c:357
void tag_tracking_parse_target_pos(uint8_t *buf)
Definition: tag_tracking.c:236
static struct SimpleKinematicKalman kalman
Definition: tag_tracking.c:170
static struct tag_tracking tag_track_private
Definition: tag_tracking.c:169
static void update_tag_position(void)
Definition: tag_tracking.c:182
#define TAG_TRACKING_P0_POS
Definition: tag_tracking.c:118
#define TAG_TRACKING_MAX_SPEED
Definition: tag_tracking.c:146
struct FloatRMat body_to_cam
Body to camera rotation.
Definition: tag_tracking.c:160
#define TAG_TRACKING_CAM_POS_X
Definition: tag_tracking.c:94
uint8_t id
ID of detected tag.
Definition: tag_tracking.c:166
#define TAG_TRACKING_MAX_OFFSET
Definition: tag_tracking.c:134
#define TAG_TRACKING_P0_SPEED
Definition: tag_tracking.c:122
#define TAG_TRACKING_ID
Definition: tag_tracking.c:176
void tag_tracking_compute_speed(void)
Control function.
Definition: tag_tracking.c:393
#define TAG_TRACKING_R
Definition: tag_tracking.c:110
#define TAG_TRACKING_MOVING
Definition: tag_tracking.h:45
#define TAG_TRACKING_DISABLE
Definition: tag_tracking.h:40
#define TAG_TRACKING_RUNNING
Definition: tag_tracking.h:38
#define TAG_TRACKING_FIXED_POS
Definition: tag_tracking.h:44
#define TAG_TRACKING_SEARCHING
Definition: tag_tracking.h:37
#define TAG_TRACKING_LOST
Definition: tag_tracking.h:39
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
short int16_t
Typedef defining 16 bit short type.
Definition: vl53l1_types.h:93
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98