felixge / node-ar-drone

A node.js client for controlling Parrot AR Drone 2.0 quad-copters.
http://nodecopter.com/
MIT License
1.76k stars 428 forks source link

Fix trimming on `takeoff()` #25

Closed janl closed 11 years ago

janl commented 11 years ago

mmmh I suck at PRs. sorry for the two commits.

janl commented 11 years ago

Also, this is all a bit ugly, but it should be good for demonstration purposes.

The reasoning is this entry in the drone PDF:

AT*FTRIM

Summary : Flat trims - Tells the drone it is lying horizontally Corresponding API function : ardrone_at_set_flat_trim

Syntax : AT*FTRIM=%d, Argument 1 : the sequence number Description :

This command sets a reference of the horizontal plane for the drone internal control system.

It must be called after each drone start up, while making sure the drone actually sits on a horizontal ground. Not doing so before taking-off will result in the drone not being able to stabilize itself when flying, as it would not be able to know its actual tilt. This command MUST NOT be sent when the AR.Drone is flying.

When receiving this command, the drone will automatically adjust the trim on pitch and roll controls.

janl commented 11 years ago

Cleaned up PR at #27.