Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
jevois.c File Reference
#include "modules/sensors/cameras/jevois.h"
#include "std.h"
#include "mcu_periph/uart.h"
#include "subsystems/abi.h"
#include "math/pprz_algebra_float.h"
#include "subsystems/datalink/downlink.h"
#include <string.h>
#include <stdio.h>
+ Include dependency graph for jevois.c:

Go to the source code of this file.

Data Structures

struct  jevois_msg_t
 
struct  jevois_t
 

Macros

#define JEVOIS_MAX_LEN   32
 
#define JEVOIS_MAX_COORD   18
 
#define JEVOIS_CHECK_DELIM(_c)   (_c == ' ' || _c == '\n' || _c == '\r' || _c == '\0')
 

Enumerations

enum  jevois_state {
  JV_SYNC = 0, JV_TYPE, JV_ID, JV_SIZE,
  JV_COORD, JV_DIM, JV_QUAT, JV_EXTRA,
  JV_SEND_MSG
}
 

Functions

void jevois_report (void)
 
void jevois_init (void)
 
static int jevois_extract_nb (char *in)
 
static void jevois_send_message (void)
 
static void jevois_parse (struct jevois_t *jv, char c)
 
void jevois_event (void)
 
void jevois_send_string (char *s)
 Generic function to send a string command to Jevois. More...
 
void jevois_stream (bool activate)
 Start and stop streaming. More...
 
void jevois_setmapping (int number)
 Set video mapping. More...
 
void jevois_send_state (void)
 Send state to camera. More...
 

Variables

int jevois_mapping_setting
 
bool jevois_stream_setting
 
struct jevois_t jevois
 

Detailed Description

Author
Gautier Hattenberger Decoder for standardized messages from the JEVOIS smart camera (http://jevois.org)

Definition in file jevois.c.


Data Structure Documentation

struct jevois_msg_t

Definition at line 47 of file jevois.c.

+ Collaboration diagram for jevois_msg_t:
Data Fields
int16_t coord[JEVOIS_MAX_COORD]
uint16_t dim[3]
char extra[JEVOIS_MAX_LEN]
char id[JEVOIS_MAX_LEN]
uint8_t nb
struct FloatQuat quat
uint8_t type
struct jevois_t

Definition at line 71 of file jevois.c.

+ Collaboration diagram for jevois_t:
Data Fields
char buf[JEVOIS_MAX_LEN]
bool data_available
uint8_t idx
struct jevois_msg_t msg
uint8_t n
enum jevois_state state

Macro Definition Documentation

#define JEVOIS_CHECK_DELIM (   _c)    (_c == ' ' || _c == '\n' || _c == '\r' || _c == '\0')

Definition at line 44 of file jevois.c.

Referenced by jevois_parse().

#define JEVOIS_MAX_COORD   18

Definition at line 42 of file jevois.c.

#define JEVOIS_MAX_LEN   32

Definition at line 40 of file jevois.c.

Referenced by jevois_extract_nb(), jevois_init(), and jevois_parse().

Enumeration Type Documentation

Enumerator
JV_SYNC 
JV_TYPE 
JV_ID 
JV_SIZE 
JV_COORD 
JV_DIM 
JV_QUAT 
JV_EXTRA 
JV_SEND_MSG 

Definition at line 58 of file jevois.c.

Function Documentation

void jevois_event ( void  )

Definition at line 393 of file jevois.c.

References jevois, JEVOIS_DEV, jevois_parse(), uart_char_available(), and uart_getch().

+ Here is the call graph for this function:

static int jevois_extract_nb ( char *  in)
static

Definition at line 131 of file jevois.c.

References JEVOIS_MAX_LEN.

Referenced by jevois_send_message().

+ Here is the caller graph for this function:

static void jevois_send_message ( void  )
static

Definition at line 148 of file jevois.c.

References CAM_JEVOIS_ID, jevois_msg_t::coord, jevois_msg_t::dim, jevois_msg_t::id, jevois, jevois_extract_nb(), JEVOIS_HFOV, JEVOIS_NORM, jevois_report(), JEVOIS_VFOV, and jevois_t::msg.

Referenced by jevois_parse().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void jevois_send_state ( void  )

Send state to camera.

Definition at line 436 of file jevois.c.

References alt_mm, jevois_send_string(), FloatQuat::qi, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, stateGetNedToBodyQuat_f(), stateGetPositionEnu_f(), EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

+ Here is the call graph for this function:

void jevois_send_string ( char *  s)

Generic function to send a string command to Jevois.

Parameters
[in]sstring command to send

Definition at line 403 of file jevois.c.

References JEVOIS_DEV, and uart_put_byte().

Referenced by jevois_send_state(), jevois_setmapping(), and jevois_stream().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void jevois_setmapping ( int  number)

Set video mapping.

Parameters
[in]numbervideo mapping number

Definition at line 422 of file jevois.c.

References jevois_mapping_setting, jevois_send_string(), jevois_stream(), and s.

+ Here is the call graph for this function:

void jevois_stream ( bool  activate)

Start and stop streaming.

Parameters
[in]activateenable or disable streaming

Definition at line 412 of file jevois.c.

References jevois_send_string(), and jevois_stream_setting.

Referenced by jevois_setmapping().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct jevois_t jevois

Definition at line 80 of file jevois.c.

Referenced by jevois_event(), jevois_init(), jevois_report(), and jevois_send_message().

int jevois_mapping_setting

Definition at line 36 of file jevois.c.

Referenced by jevois_init(), and jevois_setmapping().

bool jevois_stream_setting

Definition at line 37 of file jevois.c.

Referenced by jevois_init(), and jevois_stream().