2011-11-16 21:49:56 -04:00
|
|
|
#ifndef _DESKTOP_H
|
|
|
|
#define _DESKTOP_H
|
2011-11-07 05:52:12 -04:00
|
|
|
|
2011-11-26 03:18:51 -04:00
|
|
|
#include <unistd.h>
|
2011-12-02 00:15:12 -04:00
|
|
|
#include <sys/time.h>
|
2011-11-26 03:18:51 -04:00
|
|
|
|
2012-11-27 17:56:39 -04:00
|
|
|
enum vehicle_type {
|
|
|
|
ArduCopter,
|
|
|
|
APMrover2,
|
|
|
|
ArduPlane
|
|
|
|
};
|
|
|
|
|
2011-11-16 21:49:56 -04:00
|
|
|
struct desktop_info {
|
2011-11-07 05:52:12 -04:00
|
|
|
bool slider; // slider switch state, True means CLI mode
|
|
|
|
struct timeval sketch_start_time;
|
2012-11-27 17:56:39 -04:00
|
|
|
enum vehicle_type vehicle;
|
2011-11-25 23:47:06 -04:00
|
|
|
unsigned framerate;
|
|
|
|
float initial_height;
|
2012-02-24 02:22:02 -04:00
|
|
|
bool console_mode;
|
2011-11-07 05:52:12 -04:00
|
|
|
};
|
|
|
|
|
2011-11-16 21:49:56 -04:00
|
|
|
extern struct desktop_info desktop_state;
|
2011-11-07 05:52:12 -04:00
|
|
|
|
2011-10-30 03:31:16 -03:00
|
|
|
void desktop_serial_select_setup(fd_set *fds, int *fd_high);
|
2011-11-16 21:49:56 -04:00
|
|
|
void sitl_input(void);
|
|
|
|
void sitl_setup(void);
|
|
|
|
int sitl_gps_pipe(void);
|
|
|
|
ssize_t sitl_gps_read(int fd, void *buf, size_t count);
|
2012-03-20 19:05:58 -03:00
|
|
|
void sitl_update_compass(float roll, float pitch, float yaw);
|
2012-01-11 06:30:48 -04:00
|
|
|
void sitl_update_gps(double latitude, double longitude, float altitude,
|
|
|
|
double speedN, double speedE, bool have_lock);
|
2011-12-02 00:15:12 -04:00
|
|
|
void sitl_update_adc(float roll, float pitch, float yaw,
|
2012-01-11 06:30:48 -04:00
|
|
|
double rollRate, double pitchRate, double yawRate,
|
|
|
|
double xAccel, double yAccel, double zAccel,
|
2011-12-02 00:15:12 -04:00
|
|
|
float airspeed);
|
2011-11-16 21:49:56 -04:00
|
|
|
void sitl_setup_adc(void);
|
|
|
|
void sitl_update_barometer(float altitude);
|
2011-10-30 03:31:16 -03:00
|
|
|
|
2012-03-01 00:22:11 -04:00
|
|
|
void sitl_simstate_send(uint8_t chan);
|
|
|
|
|
2011-11-16 21:49:56 -04:00
|
|
|
#endif
|