|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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')
132 unsigned int i, j = 0;
135 for (i = 0; i < strlen(in)+1; i++) {
136 if ((in[i] >
'0' && in[i] <
'9') || in[i] ==
'-') {
139 }
else if (first || in[i] ==
'\0') {
154 #if JEVOIS_SEND_FOLLOW_TARGET
158 AbiSendMsgFOLLOW_TARGET(
CAM_JEVOIS_ID, 0, 0, cam_heading, cam_height, 0.
f);
160 #if JEVOIS_SEND_VISUAL_DETECTION
187 if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'1') {
191 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'1') {
195 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'1') {
199 }
else if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'2') {
203 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'2') {
207 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'2') {
211 }
else if (jv->
buf[0] ==
'F' && jv->
buf[1] ==
'2') {
215 }
else if (jv->
buf[0] ==
'T' && jv->
buf[1] ==
'3') {
219 }
else if (jv->
buf[0] ==
'N' && jv->
buf[1] ==
'3') {
223 }
else if (jv->
buf[0] ==
'D' && jv->
buf[1] ==
'3') {
227 }
else if (jv->
buf[0] ==
'F' && jv->
buf[1] ==
'3') {
271 if (jv->
n == jv->
msg.
nb) {
308 if (jv->
n == jv->
msg.
nb) {
328 float q = (float)atof(jv->
buf);
438 char str[32] __attribute__((unused));
442 Bound(
alt_mm, -999999, 999999);
443 sprintf(str,
"alt %d\r\n",
alt_mm);
449 int x_mm = (int)(pos.
x * 1000.f);
450 int y_mm = (int)(pos.
y * 1000.f);
451 int z_mm = (int)(pos.
z * 1000.f);
452 Bound(x_mm, -999999, 999999);
453 Bound(y_mm, -999999, 999999);
454 Bound(z_mm, -999999, 999999);
455 sprintf(str,
"pos %d %d %d\r\n", x_mm, y_mm, z_mm);
461 int qi = (int)(quat.
qi * 1000.f);
462 int qx = (int)(quat.
qx * 1000.f);
463 int qy = (int)(quat.
qy * 1000.f);
464 int qz = (int)(quat.
qz * 1000.f);
465 Bound(
qi, -9999, 9999);
466 Bound(
qx, -9999, 9999);
467 Bound(
qy, -9999, 9999);
468 Bound(
qz, -9999, 9999);
469 sprintf(str,
"quat %d %d %d %d\r\n",
qi,
qx,
qy,
qz);
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
uint8_t uart_getch(struct uart_periph *p)
static int jevois_extract_nb(char *in)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
Paparazzi floating point algebra.
void jevois_send_string(char *s)
Generic function to send a string command to Jevois.
void jevois_send_state(void)
Send state to camera.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int jevois_mapping_setting
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
#define JEVOIS_NORM
Normalized data from JEVOIS are between -1000 and 1000.
vector in East North Up coordinates Units: meters
void uart_put_byte(struct uart_periph *p, long fd, uint8_t data)
Uart transmit implementation.
bool jevois_stream_setting
#define JEVOIS_HFOV
Camera horizontal FOV From datasheet it should be 65deg, but it seems that better results are acheive...
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
Common code for AP and FBW telemetry.
#define JEVOIS_MSG_T1
JEVOIS messages types.
void jevois_stream(bool activate)
Start and stop streaming.
static void jevois_parse(struct jevois_t *jv, char c)
void jevois_setmapping(int number)
Set video mapping.
static void jevois_send_message(void)
#define JEVOIS_CHECK_DELIM(_c)
#define JEVOIS_VFOV
Camera vertical FOV Camera has a 4/3 ratio.
int16_t coord[JEVOIS_MAX_COORD]
char extra[JEVOIS_MAX_LEN]