[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5766] gps received by overo.
From: |
Paul Cox |
Subject: |
[paparazzi-commits] [5766] gps received by overo. |
Date: |
Tue, 31 Aug 2010 14:34:47 +0000 |
Revision: 5766
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5766
Author: paulcox
Date: 2010-08-31 14:34:47 +0000 (Tue, 31 Aug 2010)
Log Message:
-----------
gps received by overo.
Modified Paths:
--------------
paparazzi3/trunk/conf/airframes/Poine/beth.xml
paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c
paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c
Modified: paparazzi3/trunk/conf/airframes/Poine/beth.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/Poine/beth.xml 2010-08-31 14:04:20 UTC
(rev 5765)
+++ paparazzi3/trunk/conf/airframes/Poine/beth.xml 2010-08-31 14:34:47 UTC
(rev 5766)
@@ -246,7 +246,7 @@
#
USER =
-HOST = 192.168.0.16
+HOST = auto3
TARGET_DIR = ~
SRC_FMS=fms
@@ -254,19 +254,19 @@
overo_test_uart.CFLAGS = -I. -I$(SRC_FMS)
overo_test_uart.srcs = $(SRC_BETH)/overo_test_uart.c
-overo_test_uart.CFLAGS += -DFMS_PERIODIC_FREQ=2
+overo_test_uart.CFLAGS += -DFMS_PERIODIC_FREQ=500
overo_test_uart.srcs += $(SRC_FMS)/fms_periodic.c
overo_test_uart.srcs += $(SRC_FMS)/fms_serial_port.c
-overo_test_uart.CFLAGS += -DUBX -DGPS -DGPS_LINK=ttyUSB0
-overo_test_uart.srcs += $(SRC_BETH)/gps_ubx.c
overo_test_uart.LDFLAGS += -lrt
overo_test_uart.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=UdpTransport
overo_test_uart.srcs += $(SRC_FMS)/udp_transport2.c downlink.c
overo_test_uart.srcs += $(SRC_FMS)/fms_network.c
overo_test_uart.LDFLAGS += -levent -lm
overo_test_uart.srcs += $(SRC_BETH)/overo_gcs_com.c
+overo_test_uart.CFLAGS += -DUBX -DGPS -DUSE_UART0 -DUART0_BAUD=B38400
-DGPS_LINK=Uart0 -DGPS_USE_LATLONG
+#overo_test_uart.CFLAGS += -DUBX -DGPS -DUSE_UART1 -DUART1_BAUD=B9600
-DGPS_LINK=Uart1 -DGPS_USE_LATLONG
+overo_test_uart.srcs += gps_ubx.c gps.c latlong.c $(SRC_FMS)/uart_hw.c
-
#
# Overo twisting
#
Modified: paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c 2010-08-31 14:04:20 UTC
(rev 5765)
+++ paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c 2010-08-31 14:34:47 UTC
(rev 5766)
@@ -9,7 +9,10 @@
#include "dl_protocol.h"
#include "settings.h"
-#define GCS_HOST "10.31.4.5"
+//bill laptop
+//#define GCS_HOST "10.31.4.5"
+//auto4
+#define GCS_HOST "10.31.4.104"
#define GCS_PORT 4242
#define DATALINK_PORT 4243
Modified: paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c 2010-08-31 14:04:20 UTC
(rev 5765)
+++ paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c 2010-08-31 14:34:47 UTC
(rev 5766)
@@ -31,6 +31,8 @@
#include <event.h>
+#include "gps.h"
+
#include "messages2.h"
#include "airframe.h"
@@ -39,6 +41,7 @@
#include "fms_serial_port.h"
#include "overo_gcs_com.h"
+#include "uart_hw.h"
struct OveroController {
int armed;
@@ -47,16 +50,23 @@
static void main_periodic(int);
static void main_exit(int sig);
static void main_talk_with_tiny(void);
+void check_gps(void);
-static uint32_t foo = 0;
-struct FmsSerialPort* fmssp;
-int spfd;
+//make gps.c happy without incluing navigation code
+uint8_t nav_utm_zone0 = 5;
+static uint16_t foo = 0;
+//struct FmsSerialPort* fmssp;
+//int spfd;
+
int main(int argc, char *argv[]) {
(void) signal(SIGINT, main_exit);
- fmssp = serial_port_new();
+ uart_init();
+ gps_init();
+
+/* fmssp = serial_port_new();
//speed_t speed;
if (serial_port_open_raw(fmssp,"/dev/ttyUSB0",B9600)){
@@ -65,7 +75,7 @@
}
spfd = (int)fmssp->fd;
-
+*/
/* Initalize the event library */
event_init();
@@ -83,16 +93,56 @@
return 0;
}
+static uint16_t tempstatus = 0;
+
static void main_periodic(int my_sig_num) {
- RunOnceEvery(20, {DOWNLINK_SEND_ALIVE(gcs_com.udp_transport, 16, MD5SUM);
printf("\n");});
-
+
+ RunOnceEvery(10, {DOWNLINK_SEND_MOTOR(gcs_com.udp_transport, &tempstatus,
&foo );});
+
+ RunOnceEvery(50, {DOWNLINK_SEND_ALIVE(gcs_com.udp_transport, 16, MD5SUM);});
+
+#ifdef USE_UART0
+ uart0_handler();
+#elif USE_UART1
+ uart1_handler();
+#endif
main_talk_with_tiny();
+ check_gps();
- RunOnceEvery(2, gcs_com_periodic());
+ RunOnceEvery(20, gcs_com_periodic());
+
}
+
+
+void check_gps(void){
+ if (ubx_status > tempstatus) tempstatus = ubx_status;
+
+/* if (GpsTimeoutError) {
+ printf("gps timeout\n");
+ }
+*/
+ if (GpsBuffer()) {
+ ReadGpsBuffer();
+ }
+
+ if (gps_msg_received) {
+ printf("gps msg rx\n");
+ /* parse and use GPS messages */
+ parse_gps_msg();
+ gps_msg_received = FALSE;
+ if (gps_pos_available) {
+ printf("gps pos avail\n");
+ gps_verbose_downlink = 0;
+// UseGpsPosNoSend(estimator_update_state_gps);
+ gps_downlink();
+ gps_pos_available = FALSE;
+ }
+ }
+}
+
static void main_exit(int sig) {
printf("Initiating shutdown...\n");
@@ -101,18 +151,11 @@
}
static void main_talk_with_tiny() {
- unsigned char c='D';
- write(spfd,&c,1);
- if (read(spfd,&c,1)>0) write(STDOUT_FILENO,&c,1);
+ //unsigned char c='D';
+ //write(spfd,&c,1);
+ //if (read(spfd,&c,1)>0) write(STDOUT_FILENO,&c,1);
//fprintf(spfd,"testing\n");
- printf(".");
+ //printf(".");
foo++;
}
-int ttyUSB0Transmit(){
-
-}
-int ttyUSB0SendMessage(){
-
-}
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5766] gps received by overo.,
Paul Cox <=