[Top][All Lists]

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

[Paparazzi-devel] change AP mode with joystick?

From: Chris
Subject: [Paparazzi-devel] change AP mode with joystick?
Date: Thu, 15 Nov 2012 09:58:25 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

For Reto: i edited the pages but how can i upload a picture for the Gallery?
Now for my main question, could the airborne code be changed in order to allow for setting the pprz mode from a Joystick through a variable? I will test this method inside main_ap.c but i am not sure if what i am doing is correct :

#if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
static inline uint8_t pprz_mode_update( void ) {
  if ((pprz_mode != PPRZ_MODE_HOME &&
       pprz_mode != PPRZ_MODE_GPS_OUT_OF_ORDER)
      || TRUE
      ) {
    return ModeUpdate(pprz_mode, pprz_mode_joystick);
return ModeUpdate(pprz_mode, PPRZ_MODE_OF_PULSE(fbw_state->channels[RADIO_MODE]));

pprz_mode_joystick is a variable that i set from the joystick's xml file like this:

  <message class="ground" name="DL_SETTING" on_event="lower_hut_left">
   <field name="index" value="IndexOfSetting(pprz_mode_joystick)"/>
   <field name="value" value="1"/>

  <message class="ground" name="DL_SETTING" on_event="lower_hut_right">
   <field name="index" value="IndexOfSetting(pprz_mode_joystick)"/>
   <field name="value" value="2"/>

  <message class="ground" name="DL_SETTING" on_event="lower_hut_down">
   <field name="index" value="IndexOfSetting(pprz_mode_joystick)"/>
   <field name="value" value="0"/>

reply via email to

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