@@ -12,15 +12,16 @@ import (
1212// Gripper is an injected gripper.
1313type Gripper struct {
1414 gripper.Gripper
15- name resource.Name
16- DoFunc func (ctx context.Context , cmd map [string ]interface {}) (map [string ]interface {}, error )
17- OpenFunc func (ctx context.Context , extra map [string ]interface {}) error
18- GrabFunc func (ctx context.Context , extra map [string ]interface {}) (bool , error )
19- StopFunc func (ctx context.Context , extra map [string ]interface {}) error
20- IsMovingFunc func (context.Context ) (bool , error )
21- CloseFunc func (ctx context.Context ) error
22- GeometriesFunc func (ctx context.Context ) ([]spatialmath.Geometry , error )
23- KinematicsFunc func (ctx context.Context ) (referenceframe.Model , error )
15+ name resource.Name
16+ DoFunc func (ctx context.Context , cmd map [string ]interface {}) (map [string ]interface {}, error )
17+ OpenFunc func (ctx context.Context , extra map [string ]interface {}) error
18+ GrabFunc func (ctx context.Context , extra map [string ]interface {}) (bool , error )
19+ StopFunc func (ctx context.Context , extra map [string ]interface {}) error
20+ IsHoldingSomethingFunc func (ctx context.Context , extra map [string ]interface {}) (gripper.HoldingStatus , error )
21+ IsMovingFunc func (context.Context ) (bool , error )
22+ CloseFunc func (ctx context.Context ) error
23+ GeometriesFunc func (ctx context.Context ) ([]spatialmath.Geometry , error )
24+ KinematicsFunc func (ctx context.Context ) (referenceframe.Model , error )
2425}
2526
2627// NewGripper returns a new injected gripper.
@@ -49,6 +50,14 @@ func (g *Gripper) Grab(ctx context.Context, extra map[string]interface{}) (bool,
4950 return g .GrabFunc (ctx , extra )
5051}
5152
53+ // IsHoldingSomething calls the injected IsHoldingSomething or the real version.
54+ func (g * Gripper ) IsHoldingSomething (ctx context.Context , extra map [string ]interface {}) (gripper.HoldingStatus , error ) {
55+ if g .IsHoldingSomethingFunc == nil {
56+ return g .Gripper .IsHoldingSomething (ctx , extra )
57+ }
58+ return g .IsHoldingSomethingFunc (ctx , extra )
59+ }
60+
5261// Stop calls the injected Stop or the real version.
5362func (g * Gripper ) Stop (ctx context.Context , extra map [string ]interface {}) error {
5463 if g .StopFunc == nil {
0 commit comments