Skip to content

Commit

Permalink
Merge pull request #877 from paparazzi/airspeed_tuning
Browse files Browse the repository at this point in the history
[nav_airspeed] tune navigation airspeeds for diffent phases of the FP
  • Loading branch information
dewagter committed Dec 17, 2014
2 parents b93546f + 6f9b3d9 commit 40263e8
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/airframes/examples/microjet.xml
Expand Up @@ -204,6 +204,7 @@
<load name="nav_vertical_raster.xml"/>
<load name="nav_bungee_takeoff.xml"/>
<load name="infrared_adc.xml"/>
<load name="tune_airspeed.xml"/>
<load name="digital_cam_servo.xml">
<define name="DC_SHUTTER_SERVO" value="COMMAND_SHUTTER" />
</load>
Expand Down
35 changes: 35 additions & 0 deletions conf/modules/tune_airspeed.xml
@@ -0,0 +1,35 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="nav">
<doc>
<description>NAV AIRSPEED.
Navigation Airspeeds to be called from the flightplan.
The included settings allow tuning of your different airspeeds
In your flightplans you call the airspeeds with
set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_nominal_setting
set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_tracking_setting
set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_landing_setting
attitude pitch=DegOfRad(nav_takeoff_pitch_setting) ...
</description>
<define name="NOMINAL_AIRSPEED" value="15" description="m/s (required))"/>
<define name="TRACKING_AIRSPEED" value="20" description="m/s (default: (1.25f * NOMINAL_AIRSPEED))"/>
<define name="LANDING_AIRSPEED" value="12" description="m/s (default: (0.8f * NOMINAL_AIRSPEED)"/>
</doc>
<settings>
<dl_settings name="control">
<dl_settings name="airspeed">
<dl_setting max="50" min="5" step="0.5" var="nav_airspeed_nominal_setting" shortname="nominal"/>
<dl_setting max="50" min="5" step="0.5" var="nav_airspeed_tracking_setting" shortname="tracking"/>
<dl_setting max="50" min="5" step="0.5" var="nav_airspeed_landing_setting" shortname="landing"/>
<dl_setting max="80" min="-10" step="0.5" var="nav_takeoff_pitch_setting" shortname="takeoff_pitch" unit="rad" alt_unit="deg" />
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="nav_airspeed.h"/>
</header>
<makefile>
<file name="nav_airspeed.c"/>
</makefile>
</module>

48 changes: 48 additions & 0 deletions sw/airborne/modules/nav/nav_airspeed.c
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2014 OpenUAS
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/

#include "nav_airspeed.h"
#include "generated/airframe.h"

#ifndef NOMINAL_AIRSPEED
#error Please define NOMINAL_AIRSPEED in airframe file
#endif

#ifndef TRACKING_AIRSPEED
#define TRACKING_AIRSPEED (1.25f * NOMINAL_AIRSPEED)
#endif

#ifndef LANDING_AIRSPEED
#define LANDING_AIRSPEED (0.8f * NOMINAL_AIRSPEED)
#endif

#ifndef TAKEOFF_PITCH_ANGLE
#define TAKEOFF_PITCH_ANGLE 0
#endif


float nav_airspeed_nominal_setting = NOMINAL_AIRSPEED;
float nav_airspeed_tracking_setting = TRACKING_AIRSPEED;
float nav_airspeed_landing_setting = LANDING_AIRSPEED;

float nav_takeoff_pitch_setting = TAKEOFF_PITCH_ANGLE;

37 changes: 37 additions & 0 deletions sw/airborne/modules/nav/nav_airspeed.h
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2014 OpenUAS
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/

/** \file nav_airspeed.h
*
* NAV Tunable standard airspeed settings to be called from the flight plan
*/

#ifndef NAV_AIRSPEED_H
#define NAV_AIRSPEED_H

#include "std.h"

extern float nav_airspeed_nominal_setting;
extern float nav_airspeed_tracking_setting;
extern float nav_airspeed_landing_setting;
extern float nav_takeoff_pitch_setting;
#endif

0 comments on commit 40263e8

Please sign in to comment.