|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
35 #include <sys/types.h>
42 #ifndef VIDEO_USB_LOGGER_PATH
43 #define VIDEO_USB_LOGGER_PATH /data/video/usb
46 #ifndef VIDEO_USB_LOGGER_FPS
47 #define VIDEO_USB_LOGGER_FPS 0
68 if (access(save_name, F_OK) == -1) {
73 #if VIDEO_USB_LOGGER_JPEG_WITH_EXIF_HEADER
74 write_exif_jpeg(save_name, img_jpeg->buf, img_jpeg->buf_size, img_jpeg->w, img_jpeg->h);
76 FILE *fp = fopen(save_name,
"w");
78 printf(
"[video_thread-thread] Could not write shot %s.\n", save_name);
81 fwrite(img_jpeg->buf,
sizeof(
uint8_t), img_jpeg->buf_size, fp);
83 printf(
"Wrote image\n");
102 fprintf(
video_usb_logger,
"%d,%d,%f,%f,%f,%d,%d,%d,%d,%d,%d,%f,%f,%f,%d\n",
counter,
105 ned->
x, ned->
y, ned->
z,
106 accel->
x, accel->
y, accel->
z,
132 struct stat st = {0};
143 snprintf(filename,
sizeof(filename),
"%s/log.csv",
foldername);
147 fprintf(
video_usb_logger,
"counter,image,roll,pitch,yaw,x,y,z,accelx,accely,accelz,ratep,rateq,rater,sonar\n");
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
std::shared_ptr< gazebo::sensors::SonarSensor > sonar
static struct image_t * log_image(struct image_t *img, uint8_t camera_id)
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
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...
Camera image logger for Linux based autopilots.
#define VIDEO_USB_LOGGER_PATH
Set the default File logger path to the USB drive.
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)
vector in North East Down coordinates
static void save_shot_on_disk(struct image_t *img, struct image_t *img_jpeg)
void video_usb_logger_periodic(void)
@ IMAGE_JPEG
An JPEG encoded image (not per pixel encoded)
static FILE * video_usb_logger
The file pointer.
struct image_t img_jpeg_global
void video_usb_logger_stop(void)
Stop the logger an nicely close the file.
struct FloatEulers eulers
void video_usb_logger_start(void)
Start the file logger and open a new file.
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
#define VIDEO_USB_LOGGER_FPS
Default FPS (zero means run at camera fps)