Skip to content

Commit

Permalink
RSDK-2692 - Add collectors for MovementSensor LinearAcceleration and …
Browse files Browse the repository at this point in the history
…Orientation (#2258)
  • Loading branch information
tessavitabile authored Apr 24, 2023
1 parent 538506e commit e36b2c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/movementsensor/movementsensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ func init() {
h, err := ms.CompassHeading(ctx, make(map[string]interface{}))
return Heading{Heading: h}, err
})
registerCollector("LinearAcceleration", func(ctx context.Context, ms MovementSensor) (interface{}, error) {
v, err := ms.LinearAcceleration(ctx, make(map[string]interface{}))
return v, err
})
registerCollector("Orientation", func(ctx context.Context, ms MovementSensor) (interface{}, error) {
v, err := ms.Orientation(ctx, make(map[string]interface{}))
return v, err
})
}

// SubtypeName is a constant that identifies the component resource API string "movement_sensor".
Expand Down

0 comments on commit e36b2c3

Please sign in to comment.