Skip to content

Commit

Permalink
Parser error in Pointable.Bases: Write test and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Kass authored and deadprogram committed May 22, 2019
1 parent 6f900a8 commit 3bdb4d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions platforms/leap/leap_motion_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,14 @@ func TestLeapMotionDriverParser(t *testing.T) {
gobottest.Assert(t, parsedFrame.Hands[0].X(), 247.410)
gobottest.Assert(t, parsedFrame.Hands[0].Y(), 275.868)
gobottest.Assert(t, parsedFrame.Hands[0].Z(), 132.843)

gobottest.Assert(t, parsedFrame.Pointables[0].BTipPosition[0], 214.293)
gobottest.Assert(t, parsedFrame.Pointables[0].BTipPosition[1], 213.865)
gobottest.Assert(t, parsedFrame.Pointables[0].BTipPosition[2], 95.0224)

gobottest.Assert(t, parsedFrame.Pointables[0].Bases[0][0][0], -0.468069)
gobottest.Assert(t, parsedFrame.Pointables[0].Bases[0][0][1], 0.807844)
gobottest.Assert(t, parsedFrame.Pointables[0].Bases[0][0][2], -0.358190)

gobottest.Assert(t, parsedFrame.Pointables[0].Width, 19.7871)
}
2 changes: 1 addition & 1 deletion platforms/leap/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Hand struct {

// Pointable is a Leap Motion pointing motion that has been detected
type Pointable struct {
Bases [][]float64 `json:"bases"`
Bases [][][]float64 `json:"bases"`
BTipPosition []float64 `json:"btipPosition"`
CarpPosition []float64 `json:"carpPosition"`
DipPosition []float64 `json:"dipPosition"`
Expand Down

0 comments on commit 3bdb4d3

Please sign in to comment.