1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-13 19:29:10 +08:00
deadprogram 47a13159ef ardrone: add ValidatePitch helper function for ARDrone 2.0 to package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-02-07 11:31:27 +01:00

20 lines
425 B
Go

package ardrone
import (
"testing"
"gobot.io/x/gobot/gobottest"
)
func TestArdroneValidatePitchWhenEqualOffset(t *testing.T) {
gobottest.Assert(t, ValidatePitch(32767.0, 32767.0), 1.0)
}
func TestArdroneValidatePitchWhenTiny(t *testing.T) {
gobottest.Assert(t, ValidatePitch(1.1, 32767.0), 0.0)
}
func TestArdroneValidatePitchWhenCentered(t *testing.T) {
gobottest.Assert(t, ValidatePitch(16383.5, 32767.0), 0.5)
}