paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [5298] thrust cast and size check increase to 100


From: Paul Cox
Subject: [paparazzi-commits] [5298] thrust cast and size check increase to 100
Date: Tue, 10 Aug 2010 14:32:59 +0000

Revision: 5298
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5298
Author:   paulcox
Date:     2010-08-10 14:32:58 +0000 (Tue, 10 Aug 2010)
Log Message:
-----------
thrust cast and size check increase to 100

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/beth/main_stm32.c

Modified: paparazzi3/trunk/sw/airborne/beth/main_stm32.c
===================================================================
--- paparazzi3/trunk/sw/airborne/beth/main_stm32.c      2010-08-10 00:30:22 UTC 
(rev 5297)
+++ paparazzi3/trunk/sw/airborne/beth/main_stm32.c      2010-08-10 14:32:58 UTC 
(rev 5298)
@@ -70,7 +70,7 @@
 
 
 static inline void main_periodic( void ) {
-  int8_t pitch;
+  int8_t pitch,thrust;
   booz_imu_periodic();
 
   OveroLinkPeriodic(main_on_overo_link_lost)
@@ -90,18 +90,21 @@
   read_bench_sensors();
 
   pitch = (int8_t)((0xFF) & overo_link.down.msg.pitch);
+  thrust =(int8_t)((0xFF) & overo_link.down.msg.thrust);
+
   if (pitch > 10) pitch = 10; else 
    if (pitch < -10) pitch = -10; 
 
   booz2_commands[COMMAND_PITCH] = pitch;
   booz2_commands[COMMAND_ROLL] = 0;
   booz2_commands[COMMAND_YAW] = 0;
-  if ( overo_link.down.msg.thrust < 20) {
-    booz2_commands[COMMAND_THRUST] = overo_link.down.msg.thrust;
+  
+  if ( thrust < 100) {
+    booz2_commands[COMMAND_THRUST] = thrust;
   } else { 
-    booz2_commands[COMMAND_THRUST] = 20;
+    booz2_commands[COMMAND_THRUST] = 100;
   }
-  if (my_cnt == 0) {
+  if ((my_cnt == 0) || ((pitch == 0) && (thrust == 0) )) {
     actuators_set(FALSE);
   } else {
     actuators_set(TRUE);




reply via email to

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