paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [6051] actuators. h moved so I added hardcoded path


From: Paul Cox
Subject: [paparazzi-commits] [6051] actuators. h moved so I added hardcoded path as changing include path in setup. makefile didn't work.
Date: Fri, 01 Oct 2010 14:22:49 +0000

Revision: 6051
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6051
Author:   paulcox
Date:     2010-10-01 14:22:49 +0000 (Fri, 01 Oct 2010)
Log Message:
-----------
actuators.h moved so I added hardcoded path as changing include path in 
setup.makefile didn't work. Also adding DLSetting to setup_actuators to allow 
reception of actuators settings messages (see conf/settings/actuators.xml).

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/actuators.c
    paparazzi3/trunk/sw/airborne/setup_actuators.c

Modified: paparazzi3/trunk/sw/airborne/actuators.c
===================================================================
--- paparazzi3/trunk/sw/airborne/actuators.c    2010-10-01 14:18:46 UTC (rev 
6050)
+++ paparazzi3/trunk/sw/airborne/actuators.c    2010-10-01 14:22:49 UTC (rev 
6051)
@@ -25,6 +25,7 @@
  *
  */
 
-#include "actuators.h"
+#include "firmwares/fixedwing/actuators.h"
+//#include "actuators.h"
 
 uint16_t actuators[SERVOS_NB];

Modified: paparazzi3/trunk/sw/airborne/setup_actuators.c
===================================================================
--- paparazzi3/trunk/sw/airborne/setup_actuators.c      2010-10-01 14:18:46 UTC 
(rev 6050)
+++ paparazzi3/trunk/sw/airborne/setup_actuators.c      2010-10-01 14:22:49 UTC 
(rev 6051)
@@ -3,7 +3,8 @@
 #include "interrupt_hw.h"
 #include "sys_time.h"
 #include "led.h"
-#include "actuators.h"
+#include "firmwares/fixedwing/actuators.h"
+//#include "actuators.h"
 #include "airframe.h"
 #define DATALINK_C
 #include "datalink.h"
@@ -11,6 +12,7 @@
 #include "pprz_transport.h"
 #include "main_fbw.h"
 #include "downlink.h"
+#include "settings.h"
 
 
 #define IdOfMsg(x) (x[1])
@@ -21,9 +23,26 @@
   if (msg_id == DL_SET_ACTUATOR) {
     uint8_t servo_no = DL_SET_ACTUATOR_no(dl_buffer);
     uint16_t servo_value = DL_SET_ACTUATOR_value(dl_buffer);
+    LED_TOGGLE(2);
     if (servo_no < SERVOS_NB)
       SetServo(servo_no, servo_value);
   }
+#ifdef DlSetting
+  else if (msg_id == DL_SETTING && DL_SETTING_ac_id(dl_buffer) == AC_ID) {
+    uint8_t i = DL_SETTING_index(dl_buffer);
+    float val = DL_SETTING_value(dl_buffer);
+    DlSetting(i, val);
+    LED_TOGGLE(2);
+    for (int j=0 ; j<8 ; j++) {
+      SetServo(j,actuators[j]);
+    }
+    DOWNLINK_SEND_DL_VALUE(DefaultChannel, &i, &val);
+  } else if (msg_id == DL_GET_SETTING && DL_GET_SETTING_ac_id(dl_buffer) == 
AC_ID) {
+    uint8_t i = DL_GET_SETTING_index(dl_buffer);
+    float val = settings_get_value(i);
+    DOWNLINK_SEND_DL_VALUE(DefaultChannel, &i, &val);
+  }
+#endif 
 }
 
 #define PprzUartInit() Link(Init())
@@ -52,8 +71,8 @@
    /* t += 1./60.; */
    /* uint16_t servo_value = 1500+ 500*sin(t); */
    /* SetServo(SERVO_THROTTLE, servo_value); */
-
-  //  RunOnceEvery(300, DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM));
+  
+  RunOnceEvery(300, DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM));
   RunOnceEvery(300, DOWNLINK_SEND_ACTUATORS(DefaultChannel, SERVOS_NB, 
actuators ));
 }
 
@@ -64,6 +83,7 @@
   if (pprz_msg_received) {
     pprz_msg_received = FALSE;
     pprz_parse_payload();
+    LED_TOGGLE(3);
   } 
   if (dl_msg_available) {
     dl_parse_msg();




reply via email to

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