Skip to content

Commit

Permalink
started reviving settings via remote control, to use it add <subsyste…
Browse files Browse the repository at this point in the history
…m name=settings type=rc/> to your airframe file
  • Loading branch information
flixr committed Oct 19, 2011
1 parent adf8753 commit 7dfc6f9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions conf/airframes/flixr_discovery.xml
Expand Up @@ -32,6 +32,7 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation
<!-- Communication -->
<subsystem name="telemetry" type="transparent"/>
<subsystem name="radio_control" type="ppm"/>
<!--subsystem name="settings" type="rc"/-->

<!-- Control -->
<subsystem name="control" type="new"/>
Expand Down
6 changes: 6 additions & 0 deletions conf/autopilot/subsystems/fixedwing/settings_rc.makefile
@@ -0,0 +1,6 @@
# Hey Emacs, this is a -*- makefile -*-

# change settings via Remote Control, e.g. tune your aircraft

$(TARGET).srcs += rc_settings.c
$(TARGET).CFLAGS += -DRADIO_CONTROL_SETTINGS
18 changes: 18 additions & 0 deletions conf/settings/tuning_ins_rc.xml
@@ -0,0 +1,18 @@
<!--<!DOCTYPE settings SYSTEM "settings.dtd">-->

<!-- A conf to use to tune an A/C using only the rc -->

<settings>

<rc_settings>
<rc_mode NAME="AUTO1">
<rc_setting VAR="ins_pitch_neutral" RANGE="0.2" RC="gain_1_up" TYPE="float"/>
<rc_setting VAR="ins_roll_neutral" RANGE="-0.2" RC="gain_1_down" TYPE="float"/>
</rc_mode>
<rc_mode NAME="AUTO2">
<rc_setting VAR="h_ctl_course_pgain" RANGE="0.5" RC="gain_1_up" TYPE="float"/>
<rc_setting VAR="flight_altitude" RANGE="-100" RC="gain_1_down" TYPE="float"/>
</rc_mode>
</rc_settings>

</settings>
2 changes: 1 addition & 1 deletion sw/airborne/rc_settings.c
Expand Up @@ -25,8 +25,8 @@


#include <inttypes.h>
#include "rc_settings.h"
#include "generated/radio.h"
#include "rc_settings.h"
#include "autopilot.h"
#include "subsystems/nav.h"
#include "subsystems/sensors/infrared.h"
Expand Down
12 changes: 5 additions & 7 deletions sw/airborne/rc_settings.h
Expand Up @@ -28,11 +28,8 @@
*
* The 'rc_control' section of a XML flight plan allows the user to change the
* value of an autopilot internal variable through the rc transmitter.
* C code is generated from this XML code (var/AC/inflight_calib.h). This
* module handles the control of this setting mode.
* This module handles the control of this setting mode.
*
* Note that this functionnality is deprecated since datalink use is a lot more
* easier ('dl_settings' section)
*/

#ifndef RC_SETTINGS_H
Expand All @@ -46,6 +43,10 @@
#define RC_SETTINGS_MODE_DOWN 1
#define RC_SETTINGS_MODE_UP 2

extern uint8_t rc_settings_mode;

void rc_settings(bool_t mode_changed);

#define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE)

#define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < TRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
Expand All @@ -55,9 +56,6 @@
#define RcSettingsModeUpdate(_rc_channels) \
ModeUpdate(rc_settings_mode, RC_SETTINGS_MODE_OF_PULSE(_rc_channels[RADIO_CALIB]))

extern uint8_t rc_settings_mode;
void rc_settings(bool_t mode_changed);


#else /* RADIO_CALIB && defined RADIO_CONTROL_SETTINGS */

Expand Down

0 comments on commit 7dfc6f9

Please sign in to comment.