paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [4673]


From: antoine drouin
Subject: [paparazzi-commits] [4673]
Date: Sat, 13 Mar 2010 00:51:10 +0000

Revision: 4673
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4673
Author:   poine
Date:     2010-03-13 00:51:09 +0000 (Sat, 13 Mar 2010)
Log Message:
-----------


Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/test/Makefile
    paparazzi3/trunk/sw/airborne/test/pprz_algebra_print.h

Added Paths:
-----------
    paparazzi3/trunk/sw/airborne/test/pprz_simple_matrix_print.h
    paparazzi3/trunk/sw/airborne/test/test_matrix.c

Modified: paparazzi3/trunk/sw/airborne/test/Makefile
===================================================================
--- paparazzi3/trunk/sw/airborne/test/Makefile  2010-03-12 23:50:11 UTC (rev 
4672)
+++ paparazzi3/trunk/sw/airborne/test/Makefile  2010-03-13 00:51:09 UTC (rev 
4673)
@@ -1,15 +1,22 @@
 
 
 CC = gcc
-CFLAGS = -I.. -I../../include -I../booz -I../../booz -DFLOAT_T=double -Wall
+CFLAGS = -std=c99 -I.. -I../../include -I../booz -I../../booz  -Wall
 LDFLAGS = -lm
 
+
+test_matrix: test_matrix.c
+       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
 test_geodetic: test_geodetic.c ../math/pprz_geodetic_float.c 
../math/pprz_geodetic_double.c ../math/pprz_geodetic_int.c 
../math/pprz_trig_int.c
        $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 
 test_algebra: test_algebra.c ../math/pprz_trig_int.c
        $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 
+test_att: test_att.c ../math/pprz_trig_int.c
+       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
 test_sqrt: test_sqrt.c
        $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 

Modified: paparazzi3/trunk/sw/airborne/test/pprz_algebra_print.h
===================================================================
--- paparazzi3/trunk/sw/airborne/test/pprz_algebra_print.h      2010-03-12 
23:50:11 UTC (rev 4672)
+++ paparazzi3/trunk/sw/airborne/test/pprz_algebra_print.h      2010-03-13 
00:51:09 UTC (rev 4673)
@@ -63,6 +63,11 @@
     printf("%s %d %d %d (%d)\n",text,  (_v).x, (_v).y, (_v).z, norm);  \
   }
 
+#define DISPLAY_INT32_RATES(text, _v) {                                        
\
+    printf("%s %d %d %d\n",text,  (_v).p, (_v).q, (_v).r);             \
+  }
+
+
 #define DISPLAY_INT32_EULERS(text, _e) {                               \
     printf("%s %d %d %d\n",text,  (_e).phi, (_e).theta, (_e).psi);     \
   }

Added: paparazzi3/trunk/sw/airborne/test/pprz_simple_matrix_print.h
===================================================================
--- paparazzi3/trunk/sw/airborne/test/pprz_simple_matrix_print.h                
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/test/pprz_simple_matrix_print.h        
2010-03-13 00:51:09 UTC (rev 4673)
@@ -0,0 +1,16 @@
+#ifndef PPRZ_SIMPLE_MATRIX_PRINT_H
+#define PPRZ_SIMPLE_MATRIX_PRINT_H
+
+#include <stdio.h>
+
+#define MAT_PRINT(_i, _j, A) {                 \
+    for (int i=0; i<_i; i++) {                 \
+      for (int j=0; j<_j; j++)                 \
+       printf("%f ", A[i][j]);                 \
+      printf("\n");                            \
+    }                                          \
+  }
+
+
+#endif /* PPRZ_SIMPLE_MATRIX_PRINT_H */
+

Added: paparazzi3/trunk/sw/airborne/test/test_matrix.c
===================================================================
--- paparazzi3/trunk/sw/airborne/test/test_matrix.c                             
(rev 0)
+++ paparazzi3/trunk/sw/airborne/test/test_matrix.c     2010-03-13 00:51:09 UTC 
(rev 4673)
@@ -0,0 +1,44 @@
+
+
+#include "math/pprz_simple_matrix.h"
+#include "pprz_simple_matrix_print.h"
+
+
+
+int main(int argc, char** argv) {
+
+  float A[2][3] = {{ 1., 2., 3.},
+                  { 4., 5., 6.}};
+
+  float B[3][2] = {{ 1., 2.},
+                  { 3., 4.},
+                  { 5., 6.}};
+
+  float C[2][3] = {{ 1., 2., 3.},
+                  { 4., 5., 6.}};
+  
+  float D[2][2];
+
+  float E[3][3] = {{ 1., 2., 3.},
+                  { 5., 1., 3.},
+                  { 3., 4., 6.}};
+  
+  float F[3][3];
+
+  printf("\n");
+  MAT_PRINT(2,3,A);
+  printf("\n");
+  MAT_PRINT(3,2,B);
+  printf("\n");
+
+  MAT_MUL_T(2,3,2, D, A, C);
+  MAT_PRINT(2,2,D);
+  printf("\n");
+
+  MAT_INV33(F, E);
+  MAT_PRINT(3,3,F);
+  printf("\n");
+
+
+  return 0;
+}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]