|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
10 #define MAX_FILENAME 512
11 #define MAX_PROCESSING_THREADS 8
12 #define MAX_IMAGE_BUFFERS 25
15 #define SODA "/root/develop/allthings_obc2014/src/soda/soda"
23 static pthread_mutex_t
mut = PTHREAD_MUTEX_INITIALIZER;
25 int main(
int argc,
char *argv[])
32 printf(
"CATIA:\tStarting Camera Application Triggering Image Analysis\n");
36 printf(
"CATIA:\tfailed to open /dev/ttySAC0\n");
39 pthread_mutex_init(&
mut, NULL);
55 if (read(
fd, &
c, 1) > 0) {
57 }
else if (errno != 11) {
58 printf(
"CATIA:\nSerial error: %d\n" , errno);
73 printf(
"CATIA:\tSHOT %d,%d\n", shoot->
data.nr, shoot->
data.phi);
100 printf(
"CATIA:\tShutdown\n");
110 pthread_mutex_lock(&
mut);
112 pthread_mutex_unlock(&
mut);
113 printf(
"CATIA-%d:\tShooting: too fast\n", shoot->
data.nr);
122 pthread_mutex_unlock(&
mut);
124 printf(
"CATIA-%d:\tShooting: start\n", shoot->
data.nr);
126 printf(
"CATIA-%d:\tShooting: got image %s\n", shoot->
data.nr, filename);
128 pthread_mutex_lock(&
mut);
130 pthread_mutex_unlock(&
mut);
133 sprintf(soda_call,
"%s %s %d %d %d %d %d %d %d %d %d %d",
SODA, filename,
135 shoot->
data.vground, shoot->
data.course, shoot->
data.groundalt);
136 printf(
"CATIA-%d:\tCalling '%s'\n", shoot->
data.nr, soda_call);
137 short int ret = system(soda_call);
138 printf(
"CATIA-%d:\tShooting: soda return %d of image %s\n", shoot->
data.nr, ret, filename);
140 pthread_mutex_lock(&
mut);
142 pthread_mutex_unlock(&
mut);
153 printf(
"CATIA:\thandle_msg_buffer: Send %d\n",
image_idx);
169 struct mora_status_struct status_msg;
170 char *buffer = (
char *) &status_msg;
172 pthread_mutex_lock(&
mut);
176 status_msg.extra = 0;
177 pthread_mutex_unlock(&
mut);
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
void socket_init(int is_server)
#define MoraHeader(msg_id, payload_len)
#define MORA_STATUS_MSG_SIZE
void chdk_pipe_deinit(void)
Deinitialize CHDK pipe.
static volatile int is_shooting
#define MAX_IMAGE_BUFFERS
#define MORA_PAYLOAD_MSG_SIZE
static volatile int image_idx
void chdk_pipe_shoot(char *filename)
Shoot an image.
#define MORA_BUFFER_EMPTY
#define MORA_SHOOT_MSG_SIZE
int serial_init(char *port_name)
struct mora_transport mora_protocol
static void send_msg_status(void)
static pthread_mutex_t mut
#define MoraPutUint8(_byte)
struct dc_shot_union::@288 data
void parse_mora(struct mora_transport *t, uint8_t c)
static volatile int shooting_count
#define MAX_PROCESSING_THREADS
static volatile int shooting_idx
static char image_buffer[MAX_IMAGE_BUFFERS][IMAGE_SIZE]
static volatile int shooting_thread_count
int main(int argc, char *argv[])
uint8_t bin[MORA_SHOOT_MSG_SIZE]
int socket_recv(char *buffer, int len)
static void * handle_msg_shoot(void *ptr)
static volatile int image_count
void chdk_pipe_init(void)
Initialize the CHDK pipe.
static void send_msg_image_buffer(void)