[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5952] the "tool" :-)
From: |
Martin Dieblich |
Subject: |
[paparazzi-commits] [5952] the "tool" :-) |
Date: |
Mon, 27 Sep 2010 15:23:06 +0000 |
Revision: 5952
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5952
Author: mdieblich
Date: 2010-09-27 15:23:05 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
the "tool" :-)
Modified Paths:
--------------
paparazzi3/trunk/sw/airborne/fms/libeknav/Makefile
paparazzi3/trunk/sw/airborne/fms/libeknav/raw_log_to_ascii.c
Modified: paparazzi3/trunk/sw/airborne/fms/libeknav/Makefile
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/libeknav/Makefile 2010-09-27 10:39:21 UTC
(rev 5951)
+++ paparazzi3/trunk/sw/airborne/fms/libeknav/Makefile 2010-09-27 15:23:05 UTC
(rev 5952)
@@ -1,3 +1,10 @@
raw_log_to_ascii: raw_log_to_ascii.c
- gcc -I../../ -Wall raw_log_to_ascii.c -o raw_log_to_ascii
\ No newline at end of file
+ gcc -I../../ -Wall raw_log_to_ascii.c -o raw_log_to_ascii
+
+
+fetch_log:
+ scp address@hidden:/tmp/log_test3.bin
/home/martin/paparazzi3/trunk/sw/airborne/fms/libeknav
+
+clean:
+ -rm -f *.o *~ *.d
Modified: paparazzi3/trunk/sw/airborne/fms/libeknav/raw_log_to_ascii.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/libeknav/raw_log_to_ascii.c
2010-09-27 10:39:21 UTC (rev 5951)
+++ paparazzi3/trunk/sw/airborne/fms/libeknav/raw_log_to_ascii.c
2010-09-27 15:23:05 UTC (rev 5952)
@@ -4,29 +4,51 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdio.h>
+#include <stdint.h>
+
+
+
#include "math/pprz_algebra_float.h"
-// fixme,put that in a header
struct raw_log_entry {
- double time;
+ float time;
struct FloatRates gyro;
struct FloatVect3 accel;
struct FloatVect3 mag;
};
+void print_raw_log_entry(struct raw_log_entry);
+
+#define PRT(a) printf("%f ", a);
+
+
+
int main(int argc, char** argv) {
const char* filename = "log_test3.bin";
int raw_log_fd = open(filename, O_RDONLY);
+
// if (fd==-1) blaaa
while (1) {
struct raw_log_entry e;
ssize_t nb_read = read(raw_log_fd, &e, sizeof(e));
if (nb_read != sizeof(e)) break;
- printf("%f GYRO %f %f %f\n", e.time, e.gyro.p, e.gyro.q, e.gyro.r);
+ print_raw_log_entry(e);
+ //printf("%f %f %f %f", e.time, e.gyro.p, e.gyro.q, e.gyro.r);
+ printf("\n");
}
return 0;
}
+
+
+
+void print_raw_log_entry(struct raw_log_entry entry){
+ printf("%f\t", entry.time);
+ printf("%+f %+f %+f\t", entry.gyro.p, entry.gyro.q, entry.gyro.r);
+ printf("%+f %+f %+f\t", entry.accel.x, entry.accel.y, entry.accel.z);
+ printf("%+f %+f %+f\t", entry.mag.x, entry.mag.y, entry.mag.z);
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5952] the "tool" :-),
Martin Dieblich <=