mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
started reviving settings via remote control, to use it add <subsystem name=settings type=rc/> to your airframe file
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
@@ -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 : \
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user