Skip to content

Commit

Permalink
[nav_airspeed] tune navigation airspeeds for diffent phases of the fl…
Browse files Browse the repository at this point in the history
…ightplan
  • Loading branch information
dewagter committed Nov 28, 2014
1 parent cc5a17c commit e1c2ee6
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion conf/conf_tests.xml
Expand Up @@ -139,7 +139,7 @@
telemetry="telemetry/default_fixedwing.xml"
flight_plan="flight_plans/basic.xml"
settings="settings/fixedwing_basic.xml settings/control/ctl_basic.xml"
settings_modules="modules/nav_smooth.xml modules/infrared_adc.xml"
settings_modules="modules/nav_smooth.xml modules/infrared_adc.xml modules/tune_airspeed.xml"
gui_color="#6293ba"
/>
<aircraft
Expand Down
27 changes: 27 additions & 0 deletions conf/modules/tune_airspeed.xml
@@ -0,0 +1,27 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="nav">
<doc>
<description>NAV AIRSPEED.
Navigation Airspeeds to be called from the flightplan.
</description>
</doc>
<settings>
<dl_settings name="control">
<dl_settings name="airsp">
<dl_setting max="30" min="10" step="0.5" var="set_airspeed_nominal" shortname="nominal"/>
<dl_setting max="30" min="10" step="0.5" var="set_airspeed_tracking" shortname="tracking"/>
<dl_setting max="30" min="10" step="0.5" var="set_airspeed_glide" shortname="glide"/>
<dl_setting max="80" min="-10" step="0.5" var="set_takeoff_pitch" shortname="takeoff_pitch" unit="rad" alt_unit="deg" />
<dl_setting max="80" min="-10" step="0.5" var="set_flare_pitch" shortname="flare_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>

51 changes: 51 additions & 0 deletions sw/airborne/modules/nav/nav_airspeed.c
@@ -0,0 +1,51 @@
/*
* 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 NOMINAL_AIRSPEED
#endif

#ifndef GLIDE_AIRSPEED
#define GLIDE_AIRSPEED NOMINAL_AIRSPEED
#endif

#ifndef TAKEOFF_PITCH_ANGLE
#define TAKEOFF_PITCH_ANGLE 0
#endif

#ifndef FLARE_PITCH_ANGLE
#define FLARE_PITCH_ANGLE 0
#endif

float set_airspeed_nominal = NOMINAL_AIRSPEED;
float set_airspeed_tracking = TRACKING_AIRSPEED;
float set_airspeed_glide = GLIDE_AIRSPEED;
float set_takeoff_pitch = TAKEOFF_PITCH_ANGLE;
float set_flare_pitch = FLARE_PITCH_ANGLE;

40 changes: 40 additions & 0 deletions sw/airborne/modules/nav/nav_airspeed.h
@@ -0,0 +1,40 @@
/*
* 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"
#include "generated/airframe.h"

extern float set_airspeed_nominal;
extern float set_airspeed_tracking;
extern float set_airspeed_glide;
extern float set_takeoff_pitch;
extern float set_flare_pitch;

#endif

0 comments on commit e1c2ee6

Please sign in to comment.