After a few months of hard work, SplineNav 0.3 is now ready to fly! This SplineNav release started with the goal of simply reducing the yaw jitter issues of SplineNav 0.2, but in the end it turned into a major rewrite of the code.


New Features:


  • Smoother Yaw: Updates x and y spline derivative calculations faster, in a separate loop, for a more precise yaw control. Uses a fast approximation of the atan2 function to compute the yaw angle from the spline derivative.
  • Features yaw rate smoothing for much smoother video, avoiding the small yaw "jerk" at each waypoint.
  • Allows manual override of yaw control, then takes back auto control of yaw if the pilot centers the stick when yaw is directed approximately in the direction of the spline curve.
  • Now enters SplineNav mode smoothly, without an initial jerk.
  • Uses it's own flight mode, so unlike SplineNav 0.2 it doesn't override your Circle mode. To use SplineNav 0.3, set one of your FLTMODE parameters to 14 in the Full Parameter List.


SplineNav Waypoints


We collected the waypoints for this video while flying FPV, and flipping the channel 8 switch at each point to record. Then we loaded the waypoints into Mission Planner, and made some small adjustments:

Waypoints recorded during FPV flight and adjusted in Mission Planner

The GPS track indicates it hit all the waypoints quite precisely, on each lap for a total of 3 laps (72 waypoints in total):

GPS track from dataflash log shows SplineNav hitting each waypoint precisely over 3 complete laps

The waypoints had a range of altitudes set, from 7 to 35 meters. Here is the flight profile from the autopilot logs, imported into Google Earth:

GPS flight profile from dataflash logs after 3 complete laps


Hardware Used:

Airframe: 3D Robotics Quad, with some modifications.

: 3DR APM 2.6, with external compass/GPS module

: T-Motor MT2216 KV800

: APC 11x4.7

: WIND-1 two-axis brushless

: GoPro Hero 3 Silver

: 3DR 433 MHz

: FlySky TH9X(ER9X FW) + 2.4GHz FrSky DJT module + V8R7-II rx

: ImmersionRC 5.8GHz 600mA + FatShark Predator + SecurityCamera2000 CMQ1993X
Also: These mods for longer range FPV.

SplineNav 0.3 Firmware Installation:


  1. First make sure your quad copter is flying well with ArduCopter version 3.0.1, since SplineNav 0.3 is based on this firmware version.
  2. Go to, and click the "Download ZIP" link.
  3. In the special Ardupilot version of Arduino, go to File -> Preferences and set your sketch directory to the path of the "SplineNav-SplineNav-0.3" directory from the extracted zip archive.
  4. Restart Arduino, then choose File -> Sketchbook -> ArduCopter from the menu.
  5. From the ArduPilot menu, make sure your HAL Board is set correctly.
  6. Connect your copter's APM via USB, and from Arduino's Tools menu make sure the serial port is set correctly.
  7. Click the Upload arrow button and wait for the code to compile and upload to your APM.
  8. Set one of your FLTMODE parameters to 14 in Mission Planner's Full Parameter List, set your waypoints (either with Mission Planner or with the channel 7 or 8 switch), then go fly!

Note: If you have any special requirements, such as a frame or orientation other than quad X, remember to make those adjustments in the code before compiling. Or if you'd rather not compile yourself, please contact us to get a hex file you can upload directly via Mission Planner.




Here are the speed and acceleration parameters we used for this video (set in Mission Planner):

WPNAV_SPEED: 1350 cm/s
This should make SplineNav go about 49 km/h on straight segments.

WPNAV_SPEED_UP: 1000 cm/s

WPNAV_SPEED_DN: 650 cm/s

Should be set higher than WPNAV_SPEED.

WPNAV_ACCEL: 180 cm/s/s
Nice low value for a smooth steady start.

Also, the following parameters are #defines in the splinenav.h source code, and can be changed at compile time:

Higher tension splines curve more tightly at waypoints, but straighter in between waypoints. A tension value of 2 makes it a Catmull-Rom spline. We found that slightly lower tensions tend to give nice loose curves for smooth aerial video.

This allows for twice the max curve acceleration as set in the WPNAV_ACCEL parameter. Added this parameter to allow for smooth slow starts without making tight curves overly sluggish.

SPLINE_JERK: 200.0 cm/s/s/s
Jerk is the maximum rate that SplineNav increases or decreases acceleration as it flies the curve.

This makes SplineNav loop the waypoints forever until you exit out into another mode.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Moderator

    It is getting attention, will work best on the pixhawk me thinks.

  • This is the feature that would set APM apart from all other FCs. Why is this getting no love from the APM devs ? Don't they want DJI to have sleepless nights ?


  • This is very cool. I think it should be added to the arducopter code.

  • The SplineNav 0.3 code will slow the forward speed down as the curve gets tighter, so it should be OK for waypoints close together, unless you have a long straighter stretch before those points where it accelerates to a high speed (since currently the processor limitations don't allow us to do look-ahead on the spline curve and slow down ahead of time for sharp curves, so if they come on suddenly instead of gradually you can get some violent jerks; although if you turn your stab P parameters down it will smooth out those jerks a bit). When I update to a Pixhawk I will definitely add the look-ahead, so this will no longer be a problem. For now there's really no extra processor power available though.

    Also turn your waypoint nav speed parameter down if your curves are too tight, or choose your waypoints better so that the curve won't be so tight.

    Do you have a KML file of the flight from the dataflash? If so you can view it in Google Earth, or overlay in on your flight plan in Mission Planner (use the the "Map Tool -> KML Overlay" option from the right-click menu on the Flight Plan screen) and get a good idea of how tight the curve was.

    If you post your log file with parameters I could compare it to mine.

  • Hi,

    This is way cool. Is there something in the way of integrating it into the newest AC code? I could try but not if someone says it needs lots of rework in things I might not understand..

    I tried it yesterday in a flight where the waypoints were just 20 to 100 m apart. The copter made some pretty violent jerks in some very sharp turns. Is there something needing retuning for smaller scale missions?



  • Yep! As mathematical procedure "Spline" is universal method for compensation parametres irregularity =)
    Imho there is many variants smoothing gimbal manipulation depend of camera operation mode.
    Spline processin in manual mode of  gimbal manipulation is highly in demand, but it need "self" set of parameters.

  • That's true, you could have an entirely separate spline curve to control the gimbal pointing, for example the ROI point itself could be made to follow a it's own spline curve (different from the one the aircraft is flying), instead of using a fixed ROI point.

  • Interesting idea, do you mean auto gimbal control, for example the gimbal would always point along the slope of the spline path, so it would angle up during a climb, and down during a decent? That way the video would look more like it was filmed from a fixed-wing aircraft. Although that might not be a good thing all the time, because on a steep climb you'd just see sky in the video. It could be a pretty cool effect though.

    Or SplineNav could recognize ROI commands and point the camera at a given location, that would be pretty useful.

    Of course you can do manual gimbal control already, for example I control the pitch of my gimbal with my channel 6 knob while flying SplineNav.

  • How about adding gimbal control?

    Its may be very useful ...

  • Hi Hotel, I believe Pixhawk is the move of Ardupilot to a faster processor. Having one of those would certainly make coding SplineNav easier, as I wouldn't have to sacrifice speed and precision to save CPU load.

    I expect it should work on a 3DR Y6, if you change the FRAME_CONFIG define before compile of course. I'm looking forward to hearing the results of your SplineNav test on your Y6.

This reply was deleted.