Skip to content

Commit

Permalink
Merge pull request #1470 from TauLabs/next
Browse files Browse the repository at this point in the history
January Release merge to master
  • Loading branch information
peabody124 committed Jan 31, 2015
2 parents 1f8fa2f + 7e3ba29 commit 4082e9d
Show file tree
Hide file tree
Showing 429 changed files with 504,965 additions and 52,611 deletions.
56 changes: 55 additions & 1 deletion HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,58 @@
Short summary of changes. For a complete list see the git log.
Short summary of changes. For a complete list see the git log.

- MWRate mode - a flight control mode very similar to that from MultiWii that allows extremely aggressive flying while being totally locked in
- Improved behavior of altitude hold for takeoff and landing. Arming allowed in AH mode. It is now possible to have entire flights in Altitude Hold mode.
- MWRate settings import from BaseFlight/CleanFlight. No need to retune when switching over.
- DSM Resolution autodetection. Simplifies input configuration.
- Removed feedforward from GCS. This is stage one of deprecating this feature which should not be used with modern ESCs.
- Flight logging to flash support. Used for creating “black box” logs while flying.
- Spektrum binding fix. This requires an updated boot loader and will not work on ports that support SBUS on F4 platforms (because of the inverter).

2014-10-26 release
- Team Black Sheet Gemini support. This runs a tiny little flight controller called Colibri, a derivative of Quanton, and provides an exciting ready to fly target for FPV and racing.
- Improved autotuning algorithm. Now all the parameters of your control loop, including the derivative and the cutoff for the low pass filter are optimized. Two sliders provide easy control from smooth to aggressive tuning. Also easily share your settings to the forums for others. Video
- ESC calibration wizard
- FrSky SmartPort support
- PicoC programming and debugging gadget. Easily write snippets of code that run on your flight controller (F4 targets only) and allow extending the functionality.
- Session Management - only see the UAVO objects available on your flight controller, faster telemetry reconnects
- Telemetry Manager improvements with confirmation that settings are stored and saved
- Updated Uploader which allows backing up or overwriting the partitions in your flash. Create a complete snapshot of your UAV settings and firmware.
- Updated GCS configuration screen. Get the Telemetry Scheduler and others by default.
- Large internal overhaul of the RTOS API to allow upgrading to ChiBiOS

2014-04-05 release
Loiter mode. Smoothly move your position while in position hold.
- RTH now has ascends to a safe altitude before returning home, hovers before landing
Improved altitude estimation and altitude hold control. Ability to aggressively change altitude with exponential for smooth control too.
- picoC scripting support
- Improved position hold performance
- Frksy telemetry support

2013-12-12 release
Numerous features and bug fixes since the last release, including:
- Horizon mode
- Exponential control for rate mode
- Improved battery processing
- Native MavLink output
- HoTT telemetry and receiver support
- Safety fixes
- Setup wizard
- Support for Sparky
- Modules configuration tab
- UI improvements
- Altitude hold refactoring and baro accuracy
- I2C code rework
- Unified bootloader code
- Gimbal and CANBus support

2013-08-11 release
- First Tau Labs release
- improved failsafe handling code
- fixing and reenabling the setup wizard
- support for Sparky
- adc support for quanton
- bootloader updater for all platforms
- support for MavLink output

2013-05-24
Support for new target Sparky
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ $(eval $(call SIM_TEMPLATE,openpilot,OpenPilot,'op ',win32,exe))
#
##############################

ALL_UNITTESTS := logfs i2c_vm misc_math sin_lookup coordinate_conversions
ALL_UNITTESTS := logfs i2c_vm misc_math sin_lookup coordinate_conversions error_correcting streamfs dsm
ALL_PYTHON_UNITTESTS := python_ut_test

UT_OUT_DIR := $(BUILD_DIR)/unit_tests
Expand Down
21 changes: 15 additions & 6 deletions androidgcs/src/org/taulabs/androidgcs/HomeAdjustment.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.LightingColorFilter;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
Expand Down Expand Up @@ -114,20 +116,26 @@ public void homeToTablet(View v) {
*/
public void poiToUAV(View v) {
UAVObject gps = objMngr.getObject("GPSPosition");
UAVObject position = objMngr.getObject("PositionActual");
UAVObject tablet = objMngr.getObject("TabletInfo");
UAVObject home = objMngr.getObject("HomeLocation");

if (gps == null || tablet == null || home == null)

if (gps == null || tablet == null || position == null) {
v.getBackground().setColorFilter(new LightingColorFilter(0x11111111, 0xFFFF0000));
return;
}

LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Location current = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (current == null) {
v.getBackground().setColorFilter(new LightingColorFilter(0x11111111, 0xFFFF0000));
return;
}

// Altitude on the flight controller is always used as altitude
// plug geoid separation
double gps_altitude = gps.getField("Altitude").getDouble() +
gps.getField("GeoidSeparation").getDouble();
double alt_offset = gps_altitude - current.getLatitude();
double uav_altitude = -position.getField("Down").getDouble();
double alt_offset = uav_altitude;

double lat_offset = gps.getField("Latitude").getDouble() - current.getLatitude() * 10e6;
double lon_offset = gps.getField("Longitude").getDouble() - current.getLongitude() * 10e6;
Expand All @@ -139,8 +147,9 @@ public void poiToUAV(View v) {
editor.putInt("alt_offset", (int) alt_offset);
editor.putInt("lat_offset", (int) lat_offset);
editor.putInt("lon_offset", (int) lon_offset);
editor.commit();
editor.commit();

v.getBackground().setColorFilter(new LightingColorFilter(0x11111111, 0xFF00FF00));
}

//! Verify the FC id disarmed
Expand Down
40 changes: 40 additions & 0 deletions androidgcs/src/org/taulabs/androidgcs/fragments/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public void objectUpdated(UAVObject obj) {
} else {
mPoiMarker.setPosition((new LatLng(poiLocation.getLatitudeE6() / 1e6, poiLocation.getLongitudeE6() / 1e6)));
}
mPoiMarker.setDraggable(true);
} else if (obj.getName().compareTo("PositionActual") == 0) {
uavLocation = getUavLocation();
LatLng loc = new LatLng(uavLocation.getLatitudeE6() / 1e6, uavLocation.getLongitudeE6() / 1e6);
Expand Down Expand Up @@ -497,6 +498,45 @@ public void onMarkerDragEnd(Marker arg0) {
pos.getField("End").setDouble(NED1, 1);
pos.updated();
}

if (arg0.equals(mPoiMarker)) {
if (DEBUG) Log.d(TAG, "POI Marker moved");
LatLng newPos = mPoiMarker.getPosition();

// TODO: check only in position hold tablet mode

UAVObject poi = objMngr.getObject("PoiLocation");
if (poi == null)
return;

UAVObject home = objMngr.getObject("HomeLocation");
if (home == null)
return;

double home_lat, home_lon, home_alt;
home_lat = home.getField("Latitude").getDouble() / 10.0e6;
home_lon = home.getField("Longitude").getDouble() / 10.0e6;
home_alt = home.getField("Altitude").getDouble();

// Get the home coordinates
double T0, T1;
T0 = home_alt+6.378137E6;
T1 = Math.cos(home_lat * Math.PI / 180.0)*(home_alt+6.378137E6);

// Get the NED coordinates
double NED0, NED1;
NED0 = (newPos.latitude - home_lat) * Math.PI / 180.0 * T0;
NED1 = (newPos.longitude - home_lon) * Math.PI / 180.0 * T1;

SharedPreferences settings = getActivity().getSharedPreferences("TabletOffset", 0);
int alt_offset = settings.getInt("alt_offset", 0);

poi.getField("North").setDouble(NED0);
poi.getField("East").setDouble(NED1);
poi.getField("Down").setDouble(-alt_offset);

poi.updated();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ public void onLocationChanged(Location location) {
return;
field.setValue(location.getLongitude() * 10e6 + lon_offset);

// Because the altitude measurement from phone GPS is so inaccurate, use
// the altitude offset only (which should make it track the ground level).
// some phones have built in pressure sensors, so later we can use that for
// a more accurate relative altitude.
field = obj.getField("Altitude");
if (field == null)
return;
if (location.hasAltitude())
field.setValue(alt_offset + location.getAltitude());
else
field.setValue("0");
field.setValue(alt_offset);

field = obj.getField("Connected");
if (field != null) {
Expand Down
1 change: 1 addition & 0 deletions flight/Libraries/sanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ static int32_t check_safe_to_arm()
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED1:
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED2:
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED3:
case FLIGHTSTATUS_FLIGHTMODE_ALTITUDEHOLD:
break;
default:
// Any mode not specifically allowed prevents arming
Expand Down
32 changes: 24 additions & 8 deletions flight/Modules/AltitudeHold/altitudehold.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ static void altitudeHoldTask(void *parameters)
altitudeHoldSettings.VelocityKi, 0.0f, 1.0f);
}

bool landing = altitudeHoldDesired.Land == ALTITUDEHOLDDESIRED_LAND_TRUE;

// For landing mode allow throttle to go negative to allow the integrals
// to stop winding up
const float min_throttle = landing ? -0.1f : 0.0f;

// When engaged compute altitude controller output
if (engaged) {
float position_z, velocity_z, altitude_error;
Expand All @@ -191,7 +197,7 @@ static void altitudeHoldTask(void *parameters)
float velocity_desired = altitude_error * altitudeHoldSettings.PositionKp + altitudeHoldDesired.ClimbRate;
float throttle_desired = pid_apply_antiwindup(&velocity_pid,
velocity_desired - velocity_z,
0, 1.0f, // positive limits since this is throttle
min_throttle, 1.0f, // positive limits since this is throttle
dt_s);

if (altitudeHoldSettings.AttitudeComp > 0) {
Expand Down Expand Up @@ -219,13 +225,23 @@ static void altitudeHoldTask(void *parameters)
}

StabilizationDesiredGet(&stabilizationDesired);
stabilizationDesired.Throttle = bound_min_max(throttle_desired, 0.0f, 1.0f);
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_ROLL] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_PITCH] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_YAW] = STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK;
stabilizationDesired.Roll = altitudeHoldDesired.Roll;
stabilizationDesired.Pitch = altitudeHoldDesired.Pitch;
stabilizationDesired.Yaw = altitudeHoldDesired.Yaw;
stabilizationDesired.Throttle = bound_min_max(throttle_desired, min_throttle, 1.0f);

if (landing) {
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_ROLL] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_PITCH] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_YAW] = STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK;
stabilizationDesired.Roll = 0;
stabilizationDesired.Pitch = 0;
stabilizationDesired.Yaw = 0;
} else {
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_ROLL] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_PITCH] = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
stabilizationDesired.StabilizationMode[STABILIZATIONDESIRED_STABILIZATIONMODE_YAW] = STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK;
stabilizationDesired.Roll = altitudeHoldDesired.Roll;
stabilizationDesired.Pitch = altitudeHoldDesired.Pitch;
stabilizationDesired.Yaw = altitudeHoldDesired.Yaw;
}
StabilizationDesiredSet(&stabilizationDesired);
}

Expand Down
Loading

0 comments on commit 4082e9d

Please sign in to comment.