paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [4982] fixing spi communications test between overo


From: antoine drouin
Subject: [paparazzi-commits] [4982] fixing spi communications test between overo and stm
Date: Fri, 18 Jun 2010 13:51:01 +0000

Revision: 4982
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4982
Author:   poine
Date:     2010-06-18 13:51:00 +0000 (Fri, 18 Jun 2010)
Log Message:
-----------
fixing spi communications test between overo and stm

Modified Paths:
--------------
    paparazzi3/trunk/conf/airframes/Poine/beth.xml
    paparazzi3/trunk/conf/autopilot/lisa_passthrough.makefile
    paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile
    paparazzi3/trunk/sw/airborne/beth/main_overo.c
    paparazzi3/trunk/sw/airborne/beth/main_stm32.c
    paparazzi3/trunk/sw/airborne/fms/fms_autopilot_msg.h
    paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c
    paparazzi3/trunk/sw/airborne/lisa/stm_test_spi_link.c

Added Paths:
-----------
    paparazzi3/trunk/conf/airframes/Poine/booz2_a8.xml

Modified: paparazzi3/trunk/conf/airframes/Poine/beth.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/Poine/beth.xml      2010-06-18 10:35:34 UTC 
(rev 4981)
+++ paparazzi3/trunk/conf/airframes/Poine/beth.xml      2010-06-18 13:51:00 UTC 
(rev 4982)
@@ -91,7 +91,7 @@
 main_stm32.srcs += downlink.c pprz_transport.c
 
 main_stm32.CFLAGS += -DUSE_OVERO_LINK 
-DOVERO_LINK_MSG_UNION=AutopilotMessageBeth
-main_stm32.CFLAGS += -DOVERO_LINK_LED_OK=3 -DOVERO_LINK_LED_KO=4 
-DUSE_DMA1_C2_IRQ
+main_stm32.CFLAGS += -DOVERO_LINK_LED_OK=5 -DOVERO_LINK_LED_KO=4 
-DUSE_DMA1_C2_IRQ
 main_stm32.srcs += lisa/lisa_overo_link.c 
lisa/arch/stm32/lisa_overo_link_arch.c
 
 main_stm32.CFLAGS += -DBOOZ_IMU_TYPE_H=\"imu/booz_imu_b2.h\"
@@ -170,8 +170,6 @@
 #
 include $(PAPARAZZI_SRC)/conf/autopilot/lisa_test_progs.makefile
 
-include $(PAPARAZZI_SRC)/conf/autopilot/lisa_passthrough.makefile
-
   </makefile>
 
 </airframe>

Added: paparazzi3/trunk/conf/airframes/Poine/booz2_a8.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/Poine/booz2_a8.xml                          
(rev 0)
+++ paparazzi3/trunk/conf/airframes/Poine/booz2_a8.xml  2010-06-18 13:51:00 UTC 
(rev 4982)
@@ -0,0 +1,103 @@
+<!-- this is the biplan equiped with  Lisa/L#XXX and asctec V2 controllers -->
+
+<airframe name="booz2_a7">
+
+  <servos min="0" neutral="0" max="0xff">
+    <servo name="FRONT"   no="0" min="0" neutral="0" max="255"/>
+    <servo name="BACK"    no="1" min="0" neutral="0" max="255"/>
+    <servo name="LEFT"    no="2" min="0" neutral="0" max="255"/>
+    <servo name="RIGHT"   no="3" min="0" neutral="0" max="255"/>
+  </servos>
+
+  <commands>
+    <axis name="PITCH"  failsafe_value="0"/>
+    <axis name="ROLL"   failsafe_value="0"/>
+    <axis name="YAW"    failsafe_value="0"/>
+    <axis name="THRUST" failsafe_value="0"/>
+  </commands>
+
+
+  <section name="SUPERVISION" prefix="SUPERVISION_">
+    <define name="MIN_MOTOR" value="3"/>
+    <define name="MAX_MOTOR" value="200"/>
+    <define name="TRIM_A" value="0"/>
+    <define name="TRIM_E" value="0"/>
+    <define name="TRIM_R" value="0"/>
+    <define name="NB_MOTOR" value="4"/>
+    <define name="SCALE" value="256"/>
+    <define name="ROLL_COEF"   value="{  0  ,    0,  256, -256 }"/>
+    <define name="PITCH_COEF"  value="{  256, -256,    0,    0 }"/>
+    <define name="YAW_COEF"    value="{  256,  256, -256, -256 }"/>
+    <define name="THRUST_COEF" value="{  256,  256,  256,  256 }"/>
+  </section>
+
+  <section name="IMU" prefix="IMU_">
+
+    <define name="GYRO_P_NEUTRAL" value="31948"/>
+    <define name="GYRO_Q_NEUTRAL" value="31834"/>
+    <define name="GYRO_R_NEUTRAL" value="32687"/>
+
+    <define name="GYRO_P_SENS" value=" 1.101357422" integer="16"/>
+    <define name="GYRO_Q_SENS" value="-1.122670898" integer="16"/>
+    <define name="GYRO_R_SENS" value="-1.104890137" integer="16"/>
+
+
+    <define name="ACCEL_X_SENS" value="-2.58273701242" integer="16"/>
+    <define name="ACCEL_Y_SENS" value="-2.54076215332" integer="16"/>
+    <define name="ACCEL_Z_SENS" value="-2.57633620646" integer="16"/>
+
+    <define name="ACCEL_X_NEUTRAL" value="32857"/>
+    <define name="ACCEL_Y_NEUTRAL" value="32429"/>
+    <define name="ACCEL_Z_NEUTRAL" value="32593"/>
+
+    <define name="MAG_X_SENS" value=" 5.32718104135" integer="16"/>
+    <define name="MAG_Y_SENS" value="-4.87857821202" integer="16"/>
+    <define name="MAG_Z_SENS" value="-3.11986612709" integer="16"/>
+
+    <define name="MAG_X_NEUTRAL" value="-43"/>
+    <define name="MAG_Y_NEUTRAL" value=" 49"/>
+    <define name="MAG_Z_NEUTRAL" value="-66"/>
+
+    <define name="BODY_TO_IMU_PHI"   value="RadOfDeg(  0.)"/>
+    <define name="BODY_TO_IMU_THETA" value="RadOfDeg(  0.)"/>
+    <define name="BODY_TO_IMU_PSI"   value="RadOfDeg(  45.)"/>
+
+  </section>
+
+ <section name="BAT">
+   <define name="MILLIAMP_PER_PERCENT" value="0.86"/>
+   <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
+   <define name="BATTERY_SENS"   value="0.48" integer="16"/>
+ </section>
+
+
+ <makefile>
+
+
+
+USER =
+#HOST = 10.31.4.22
+#HOST = overo
+HOST = beth
+TARGET_DIR = ~
+
+SRC_FMS=fms
+
+
+ARCH=stm32
+ARCHI=stm32
+BOARD_CFG=\"boards/lisa_0.99.h\"
+FLASH_MODE = JTAG
+
+include $(PAPARAZZI_SRC)/conf/autopilot/lisa_test_progs.makefile
+
+include $(PAPARAZZI_SRC)/conf/autopilot/lisa_passthrough.makefile
+
+#
+# 
+#
+
+
+ </makefile>
+
+</airframe>

Modified: paparazzi3/trunk/conf/autopilot/lisa_passthrough.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_passthrough.makefile   2010-06-18 
10:35:34 UTC (rev 4981)
+++ paparazzi3/trunk/conf/autopilot/lisa_passthrough.makefile   2010-06-18 
13:51:00 UTC (rev 4982)
@@ -29,7 +29,7 @@
 pt.srcs += downlink.c pprz_transport.c
 
 # Link Overo
-pt.CFLAGS += -DUSE_OVERO_LINK -DOVERO_LINK_MSG_UNION=AutopilotMessageBeth
+pt.CFLAGS += -DUSE_OVERO_LINK -DOVERO_LINK_MSG_UNION=AutopilotMessagePT
 pt.CFLAGS += -DOVERO_LINK_LED_OK=3 -DOVERO_LINK_LED_KO=4 -DUSE_DMA1_C2_IRQ
 pt.srcs += lisa/lisa_overo_link.c lisa/arch/stm32/lisa_overo_link_arch.c
 
@@ -57,8 +57,9 @@
 
 # Actuators
 pt.srcs += $(SRC_BOOZ)/actuators/booz_supervision.c
-pt.srcs += $(SRC_BOOZ)/actuators/booz_actuators_mkk.c
-pt.srcs += $(SRC_BOOZ_ARCH)/actuators/booz_actuators_mkk_arch.c
+pt.CFLAGS += -DACTUATORS_ASCTEC_V2_PROTOCOL
+pt.srcs += $(SRC_BOOZ)/actuators/booz_actuators_asctec.c
 pt.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
-pt.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1  -DUSE_TIM2_IRQ
+
+pt.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1
 pt.CFLAGS += -DUSE_I2C1

Modified: paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-06-18 
10:35:34 UTC (rev 4981)
+++ paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-06-18 
13:51:00 UTC (rev 4982)
@@ -684,7 +684,7 @@
 
 
 #
-# test spi slave
+# test spi slave ( hardcoded SPI without DMA )
 #
 test_spi_slave.ARCHDIR = $(ARCHI)
 test_spi_slave.TARGET = test_spi_slave
@@ -707,7 +707,7 @@
 
 
 #
-# test spi slave2  ( with DMA )
+# test spi slave2  ( hardcoded SPI with DMA )
 #
 test_spi_slave2.ARCHDIR = $(ARCHI)
 test_spi_slave2.TARGET = test_spi_slave2

Modified: paparazzi3/trunk/sw/airborne/beth/main_overo.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/main_overo.c      2010-06-18 10:35:34 UTC 
(rev 4981)
+++ paparazzi3/trunk/sw/airborne/beth/main_overo.c      2010-06-18 13:51:00 UTC 
(rev 4982)
@@ -60,11 +60,12 @@
 
   spi_link_send(msg_out, sizeof(union AutopilotMessageBeth), msg_in);
   //  if (!foo%100) {
+  if (0) {
   printf("%d -> %d %d %d %d %d %d %d %d %d\n", foo, 
         msg_in->bench_sensor.x, msg_in->bench_sensor.y, msg_in->bench_sensor.z,
         msg_in->gyro.x, msg_in->gyro.y, msg_in->gyro.z,
         msg_in->accel.x, msg_in->accel.y, msg_in->accel.z);
-  //  }
+  }
   foo++;
 }
 

Modified: paparazzi3/trunk/sw/airborne/beth/main_stm32.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/main_stm32.c      2010-06-18 10:35:34 UTC 
(rev 4981)
+++ paparazzi3/trunk/sw/airborne/beth/main_stm32.c      2010-06-18 13:51:00 UTC 
(rev 4982)
@@ -64,14 +64,14 @@
   actuators_init();
   //  radio_control_init();
   //  booz_imu_init();
-  //  overo_link_init();
+  overo_link_init();
   bench_sensors_init();
 }
 
 static inline void main_periodic( void ) {
   //  booz_imu_periodic();
   actuators_set(FALSE);
-  //  OveroLinkPeriodic(main_on_overo_link_lost)
+  OveroLinkPeriodic(main_on_overo_link_lost)
   RunOnceEvery(10, {LED_PERIODIC(); DOWNLINK_SEND_ALIVE(DefaultChannel, 16, 
MD5SUM);});
 
   read_bench_sensors();
@@ -80,7 +80,7 @@
 
 static inline void main_event( void ) {
   //    BoozImuEvent(on_gyro_accel_event, on_mag_event);
-  //    OveroLinkEvent(main_on_overo_msg_received);
+  OveroLinkEvent(main_on_overo_msg_received);
 
   BenchSensorsEvent(main_on_bench_sensors);
 

Modified: paparazzi3/trunk/sw/airborne/fms/fms_autopilot_msg.h
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/fms_autopilot_msg.h        2010-06-18 
10:35:34 UTC (rev 4981)
+++ paparazzi3/trunk/sw/airborne/fms/fms_autopilot_msg.h        2010-06-18 
13:51:00 UTC (rev 4982)
@@ -4,10 +4,15 @@
 #include <inttypes.h>
 #include "math/pprz_algebra_int.h"
 
+/*
+ * Testing
+ */
+
 struct AutopilotMessageFoo {
   uint8_t foo;
   uint8_t bar;
   uint8_t blaa;
+  uint8_t bli;
 };
 
 union AutopilotMessageFoo1 {
@@ -15,6 +20,10 @@
   struct AutopilotMessageFoo down;
 };
 
+
+/*
+ * BETH
+ */
 struct AutopilotMessageBethUp {
   struct Int16Vect3 gyro;
   struct Int16Vect3 accel;
@@ -33,6 +42,9 @@
 };
 
 
+/*
+ *  STM Telemetry through wifi
+ */
 #define TW_BUF_LEN 63
 struct AutopilotMessageTWUp {
   uint8_t tw_len;
@@ -49,5 +61,36 @@
   struct AutopilotMessageTWDown down;
 };
 
+/*
+ * Passthrough, aka biplan
+ */
+struct AutopilotMessagePTUp {
+  struct Int16Vect3 gyro;
+  struct Int16Vect3 accel;
+  struct Int16Vect3 mag;
+  int16_t rc_pitch;
+  int16_t rc_roll;
+  int16_t rc_yaw;
+  int16_t rc_thrust;
+  int16_t rc_mode;
+  uint8_t  rc_status;
+};
 
+struct AutopilotMessagePTDown {
+  int16_t command_pitch;
+  int16_t command_roll;
+  int16_t command_yaw;
+  int16_t command_thrust;
+};
+
+union AutopilotMessagePT {
+  struct AutopilotMessageBethUp up;
+  struct AutopilotMessageBethDown down;
+};
+
+
+
+
+
+
 #endif /* FMS_AUTOPILOT_H */

Modified: paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c      2010-06-18 
10:35:34 UTC (rev 4981)
+++ paparazzi3/trunk/sw/airborne/fms/overo_test_spi_link.c      2010-06-18 
13:51:00 UTC (rev 4982)
@@ -49,8 +49,8 @@
     spi_link_send(&msg_out, sizeof(struct AutopilotMessageFoo), &msg_in);
     if (memcmp(&msg_in, &msg_out_prev, sizeof(msg_in))) {
       printf("compare failed\n");
-      printf("expected %d %d %d\n", msg_out_prev.foo, msg_out_prev.bar, 
msg_out_prev.blaa);
-      printf("got      %d %d %d\n\n", msg_in.foo, msg_in.bar, msg_in.blaa);
+      printf("expected %d %d %d %d\n", msg_out_prev.foo, msg_out_prev.bar, 
msg_out_prev.blaa, msg_out_prev.bli);
+      printf("got      %d %d %d %d\n\n", msg_in.foo, msg_in.bar, msg_in.blaa, 
msg_in.bli);
     }
     else {
       static uint32_t foo = 0;
@@ -60,7 +60,7 @@
       }
     }
     usleep(1953);
-    //usleep(50000);
+    //    usleep(50000);
   }
 
   return 0;
@@ -71,7 +71,8 @@
 static void fill_msg(struct AutopilotMessageFoo* msg) {
   static uint32_t foo = 0;
   msg->foo  = foo;
-  msg->bar  = foo+1;
-  msg->blaa = foo+2;
+  msg->bar  = foo+2;
+  msg->blaa = foo+4;
+  msg->bli  = foo+8;
   foo++;
 }

Modified: paparazzi3/trunk/sw/airborne/lisa/stm_test_spi_link.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/stm_test_spi_link.c       2010-06-18 
10:35:34 UTC (rev 4981)
+++ paparazzi3/trunk/sw/airborne/lisa/stm_test_spi_link.c       2010-06-18 
13:51:00 UTC (rev 4982)
@@ -36,8 +36,6 @@
 static inline void on_overo_msg_received(void);
 static inline void on_overo_link_lost(void);
 
-struct AutopilotMessageFoo my_msg;
-
 int main(void) {
 
   hw_init();




reply via email to

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