[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [6042] added sonar sensor to twog which forwards us
From: |
Paul Cox |
Subject: |
[paparazzi-commits] [6042] added sonar sensor to twog which forwards us the adc values. |
Date: |
Fri, 01 Oct 2010 13:03:54 +0000 |
Revision: 6042
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6042
Author: paulcox
Date: 2010-10-01 13:03:53 +0000 (Fri, 01 Oct 2010)
Log Message:
-----------
added sonar sensor to twog which forwards us the adc values.
Modified Paths:
--------------
paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c
paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c
paparazzi3/trunk/sw/airborne/beth/rcv_telemetry.c
Modified: paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c 2010-10-01 13:01:49 UTC
(rev 6041)
+++ paparazzi3/trunk/sw/airborne/beth/overo_gcs_com.c 2010-10-01 13:03:53 UTC
(rev 6042)
@@ -10,8 +10,9 @@
#include "settings.h"
//bill laptop
-//#define GCS_HOST "10.31.4.5"
-#define GCS_HOST "192.168.2.10"
+#define GCS_HOST "10.31.4.5"
+//#define GCS_HOST "192.168.2.10"
+//#define GCS_HOST "192.168.2.1"
//auto4
//#define GCS_HOST "10.31.4.104"
#define GCS_PORT 4242
Modified: paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c 2010-10-01 13:01:49 UTC
(rev 6041)
+++ paparazzi3/trunk/sw/airborne/beth/overo_test_uart.c 2010-10-01 13:03:53 UTC
(rev 6042)
@@ -67,6 +67,17 @@
#endif
static uint8_t configgps = 0;
+
+extern float phi;
+extern float psi;
+extern float theta;
+extern uint16_t throttle;
+extern uint16_t voltage;
+extern uint16_t amps;
+extern uint16_t energy;
+extern uint16_t adc1;
+extern uint16_t adc2;
+
int main(int argc, char *argv[]) {
portnum = 0;
@@ -118,7 +129,8 @@
static void main_periodic(int my_sig_num) {
- //RunOnceEvery(50, {DOWNLINK_SEND_ALIVE(gcs_com.udp_transport, 16,
MD5SUM);});
+ RunOnceEvery(50, {DOWNLINK_SEND_ALIVE(gcs_com.udp_transport, 16, MD5SUM);});
+ RunOnceEvery(5,
{DOWNLINK_SEND_ADC_GENERIC(gcs_com.udp_transport,&adc1,&adc2);});
#ifdef USE_UART0
uart0_handler();
Modified: paparazzi3/trunk/sw/airborne/beth/rcv_telemetry.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/rcv_telemetry.c 2010-10-01 13:01:49 UTC
(rev 6041)
+++ paparazzi3/trunk/sw/airborne/beth/rcv_telemetry.c 2010-10-01 13:03:53 UTC
(rev 6042)
@@ -48,23 +48,59 @@
#include "downlink.h"
+
#define MOfCm(_x) (((float)(_x))/100.)
#define SenderIdOfMsg(x) (x[0])
#define IdOfMsg(x) (x[1])
+float phi;
+float psi;
+float theta;
+uint16_t throttle;
+uint16_t voltage;
+uint16_t amps;
+uint16_t energy;
+uint16_t adc1;
+uint16_t adc2;
+
+/*
+ 6 ATTITUDE
+ 8 GPS
+10 NAVIGATION
+12 BAT
+16 DESIRED
+35
+36
+37 ENERGY
+42 ESTIMATOR
+*/
void dl_parse_msg(void) {
datalink_time = 0;
uint8_t msg_id = IdOfMsg(dl_buffer);
printf("Tiny rx id: %d\n",msg_id);
-if (msg_id == DL_ATTITUDE) {
- float phi = DL_ATTITUDE_phi(dl_buffer);
- float psi = DL_ATTITUDE_psi(dl_buffer);
- float theta = DL_ATTITUDE_theta(dl_buffer);
+ if (msg_id == DL_ATTITUDE) {
+ phi = DL_ATTITUDE_phi(dl_buffer);
+ psi = DL_ATTITUDE_psi(dl_buffer);
+ theta = DL_ATTITUDE_theta(dl_buffer);
printf("Attitude: %f %f %f\n", phi, psi, theta);
- } else {
- printf("Unknown msg id %d",msg_id);
}
+ if (msg_id == DL_BAT) {
+ throttle = DL_BAT_throttle(dl_buffer);
+ voltage = DL_BAT_voltage(dl_buffer);
+ amps = DL_BAT_amps(dl_buffer);
+ energy = DL_BAT_energy(dl_buffer);
+ printf("BAT: %d %d %d %d\n", throttle,voltage,amps,energy);
+ }
+ if (msg_id == DL_ADC_GENERIC) {
+ adc1 = DL_ADC_GENERIC_val1(dl_buffer);
+ adc2 = DL_ADC_GENERIC_val2(dl_buffer);
+ printf("ADC: %d %d\n",adc1,adc2);
+ }
+
+ else {
+ //printf("Tiny msg_id %d unknown\n",msg_id);
+ }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [6042] added sonar sensor to twog which forwards us the adc values.,
Paul Cox <=