diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index b2185510c5..b9eaffb7ac 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -91,7 +91,7 @@ main_stm32.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DE 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 @@ main_overo.srcs += $(SRC_FMS)/fms_spi_link.c # include $(PAPARAZZI_SRC)/conf/autopilot/lisa_test_progs.makefile -include $(PAPARAZZI_SRC)/conf/autopilot/lisa_passthrough.makefile - diff --git a/conf/airframes/Poine/booz2_a8.xml b/conf/airframes/Poine/booz2_a8.xml new file mode 100644 index 0000000000..7d27288e83 --- /dev/null +++ b/conf/airframes/Poine/booz2_a8.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + +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 + +# +# +# + + + + +
diff --git a/conf/autopilot/lisa_passthrough.makefile b/conf/autopilot/lisa_passthrough.makefile index b917f0f525..19cf0d49e4 100644 --- a/conf/autopilot/lisa_passthrough.makefile +++ b/conf/autopilot/lisa_passthrough.makefile @@ -29,7 +29,7 @@ pt.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uar 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 @@ pt.CFLAGS += -DRADIO_CONTROL_LINK=Uart3 # 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 diff --git a/conf/autopilot/lisa_test_progs.makefile b/conf/autopilot/lisa_test_progs.makefile index eee1460b44..017e7c3686 100644 --- a/conf/autopilot/lisa_test_progs.makefile +++ b/conf/autopilot/lisa_test_progs.makefile @@ -684,7 +684,7 @@ test_baro3.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c # -# 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_slave.srcs += downlink.c pprz_transport.c # -# test spi slave2 ( with DMA ) +# test spi slave2 ( hardcoded SPI with DMA ) # test_spi_slave2.ARCHDIR = $(ARCHI) test_spi_slave2.TARGET = test_spi_slave2 diff --git a/sw/airborne/beth/main_overo.c b/sw/airborne/beth/main_overo.c index 55c35826c0..fbc7e22f68 100644 --- a/sw/airborne/beth/main_overo.c +++ b/sw/airborne/beth/main_overo.c @@ -60,11 +60,12 @@ static void send_message() { 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++; } diff --git a/sw/airborne/beth/main_stm32.c b/sw/airborne/beth/main_stm32.c index 3c2e7413a5..2a31035df5 100644 --- a/sw/airborne/beth/main_stm32.c +++ b/sw/airborne/beth/main_stm32.c @@ -64,14 +64,14 @@ static inline void main_init( void ) { 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_periodic( void ) { 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); diff --git a/sw/airborne/fms/fms_autopilot_msg.h b/sw/airborne/fms/fms_autopilot_msg.h index 3017244b26..bcccf2ad0a 100644 --- a/sw/airborne/fms/fms_autopilot_msg.h +++ b/sw/airborne/fms/fms_autopilot_msg.h @@ -4,10 +4,15 @@ #include #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 @@ union AutopilotMessageFoo1 { struct AutopilotMessageFoo down; }; + +/* + * BETH + */ struct AutopilotMessageBethUp { struct Int16Vect3 gyro; struct Int16Vect3 accel; @@ -33,6 +42,9 @@ union AutopilotMessageBeth { }; +/* + * STM Telemetry through wifi + */ #define TW_BUF_LEN 63 struct AutopilotMessageTWUp { uint8_t tw_len; @@ -49,5 +61,36 @@ union AutopilotMessageTW { 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 */ diff --git a/sw/airborne/fms/overo_test_spi_link.c b/sw/airborne/fms/overo_test_spi_link.c index ed076fa35b..f09ce84cbf 100644 --- a/sw/airborne/fms/overo_test_spi_link.c +++ b/sw/airborne/fms/overo_test_spi_link.c @@ -49,8 +49,8 @@ int main(int argc, char *argv[]) { 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 @@ int main(int argc, char *argv[]) { } } usleep(1953); - //usleep(50000); + // usleep(50000); } return 0; @@ -71,7 +71,8 @@ int main(int argc, char *argv[]) { 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++; } diff --git a/sw/airborne/lisa/stm_test_spi_link.c b/sw/airborne/lisa/stm_test_spi_link.c index 8cc07e7acc..6f1a1606a7 100644 --- a/sw/airborne/lisa/stm_test_spi_link.c +++ b/sw/airborne/lisa/stm_test_spi_link.c @@ -36,8 +36,6 @@ static inline void main_event( void ); 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();