40 #define JEVOIS_MAX_LEN 32
42 #define JEVOIS_MAX_COORD 18
44 #define JEVOIS_CHECK_DELIM(_c) (_c == ' ' || _c == '\n' || _c == '\r' || _c == '\0')
131 unsigned int i, j = 0;
134 for (i = 0; i < strlen(in)+1; i++) {
135 if ((in[i] >=
'0' && in[i] <
'9') || in[i] ==
'-') {
138 }
else if (first || in[i] ==
'\0') {
153 #if JEVOIS_SEND_FOLLOW_TARGET
157 AbiSendMsgFOLLOW_TARGET(
CAM_JEVOIS_ID, 0, 0, cam_heading, cam_height, 0.f);
159 #if JEVOIS_SEND_VISUAL_DETECTION
203 if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'1') {
207 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'1') {
211 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'1') {
215 }
else if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'2') {
219 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'2') {
223 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'2') {
227 }
else if (jv->
buf[0] ==
'F' && jv->
buf[1] ==
'2') {
231 }
else if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'3') {
235 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'3') {
239 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'3') {
243 }
else if (jv->
buf[0] ==
'F' && jv->
buf[1] ==
'3') {
287 if (jv->
n == jv->
msg.
nb) {
325 if (jv->
n == jv->
msg.
nb) {
346 float q = (float)atof(jv->
buf);
379 }
else if( c==
'\r') {
447 char str[32] __attribute__((unused));
451 Bound(
alt_mm, -999999, 999999);
452 sprintf(str,
"alt %d\r\n",
alt_mm);
458 int x_mm = (int)(pos.
x * 1000.f);
459 int y_mm = (int)(pos.
y * 1000.f);
460 int z_mm = (int)(pos.
z * 1000.f);
461 Bound(x_mm, -999999, 999999);
462 Bound(y_mm, -999999, 999999);
463 Bound(z_mm, -999999, 999999);
464 sprintf(str,
"pos %d %d %d\r\n", x_mm, y_mm, z_mm);
470 int qi = (int)(quat.
qi * 1000.f);
471 int qx = (int)(quat.
qx * 1000.f);
472 int qy = (int)(quat.
qy * 1000.f);
473 int qz = (int)(quat.
qz * 1000.f);
474 Bound(
qi, -9999, 9999);
475 Bound(
qx, -9999, 9999);
476 Bound(
qy, -9999, 9999);
477 Bound(
qz, -9999, 9999);
478 sprintf(str,
"quat %d %d %d %d\r\n",
qi,
qx,
qy,
qz);
Main include for ABI (AirBorneInterface).
Common code for AP and FBW telemetry.
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
bool jevois_stream_setting
static void jevois_parse(struct jevois_t *jv, char c)
void jevois_setmapping(int number)
Set video mapping.
static void jevois_handle_msg(struct jevois_t *jv)
char extra[JEVOIS_MAX_LEN]
void jevois_stream(bool activate)
Start and stop streaming.
static void jevois_send_message(void)
int jevois_mapping_setting
int16_t coord[JEVOIS_MAX_COORD]
int jevois_extract_nb(char *in)
Extract a number from jevoid ID field.
#define JEVOIS_CHECK_DELIM(_c)
void jevois_send_string(char *s)
Generic function to send a string command to Jevois.
void jevois_send_state(void)
Send state to camera.
#define JEVOIS_HFOV
Camera horizontal FOV From datasheet it should be 65deg, but it seems that better results are acheive...
#define JEVOIS_VFOV
Camera vertical FOV Camera has a 4/3 ratio.
#define JEVOIS_NORM
Normalized data from JEVOIS are between -1000 and 1000.
#define JEVOIS_MSG_T1
JEVOIS messages types.
void uart_put_byte(struct uart_periph *periph, long fd, uint8_t data)
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
uint8_t uart_getch(struct uart_periph *p)
Paparazzi floating point algebra.
vector in East North Up coordinates Units: meters
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.