35 #include <sys/types.h>
42 #ifndef VIDEO_USB_LOGGER_PATH
43 #define VIDEO_USB_LOGGER_PATH /data/video/usb
63 if (access(save_name, F_OK) == -1) {
68 #if VIDEO_USB_LOGGER_JPEG_WITH_EXIF_HEADER
71 FILE *fp = fopen(save_name,
"w");
73 printf(
"[video_thread-thread] Could not write shot %s.\n", save_name);
78 printf(
"Wrote image\n");
97 fprintf(
video_usb_logger,
"%d,%d,%f,%f,%f,%d,%d,%d,%d,%d,%d,%f,%f,%f,%d\n", counter,
100 ned->
x, ned->
y, ned->
z,
101 accel->
x, accel->
y, accel->
z,
127 struct stat st = {0};
138 snprintf(filename,
sizeof(filename),
"%s/log.csv",
foldername);
142 fprintf(
video_usb_logger,
"counter,image,roll,pitch,yaw,x,y,z,accelx,accely,accelz,ratep,rateq,rater,sonar\n");
uint32_t buf_size
The buffer size.
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func)
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
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...
void video_usb_logger_periodic(void)
uint32_t pprz_ts
The timestamp in us since system startup.
Camera image logger for Linux based autopilots.
int write_exif_jpeg(char *filename, const unsigned char *image_jpg, const unsigned int image_jpg_len, const unsigned int image_jpg_x, const unsigned int image_jpg_y)
struct FloatEulers eulers
#define VIDEO_USB_LOGGER_PATH
Set the default File logger path to the USB drive.
Computer vision framework for onboard processing.
void * buf
Image buffer (depending on the image_type)
struct image_t img_jpeg_global
Encode images with the use of the JPEG encoding.
void video_usb_logger_stop(void)
Stop the logger an nicely close the file.
static struct image_t * log_image(struct image_t *img)
Get live images from a RTP/UDP stream and save pictures on internal memory.
API to get/set the generic vehicle states.
vector in North East Down coordinates
void video_usb_logger_start(void)
Start the file logger and open a new file.
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
static void save_shot_on_disk(struct image_t *img, struct image_t *img_jpeg)
static FILE * video_usb_logger
The file pointer.
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
An JPEG encoded image (not per pixel encoded)