@@ -42,6 +42,7 @@ type ptgBaseKinematics struct {
42
42
inputLock sync.RWMutex
43
43
currentInput []referenceframe.Input
44
44
origin spatialmath.Pose
45
+ geometries []spatialmath.Geometry
45
46
}
46
47
47
48
// wrapWithPTGKinematics takes a Base component and adds a PTG kinematic model so that it can be controlled.
@@ -75,8 +76,9 @@ func wrapWithPTGKinematics(
75
76
}
76
77
77
78
geometries , err := b .Geometries (ctx , nil )
78
- if err != nil {
79
- return nil , err
79
+ if len (geometries ) == 0 || err != nil {
80
+ logger .CWarn (ctx , "base %s not configured with a geometry, will be considered a point mass for collision detection purposes." )
81
+ geometries = []spatialmath.Geometry {spatialmath .NewPoint (r3.Vector {}, b .Name ().Name )}
80
82
}
81
83
82
84
frame , err := tpspace .NewPTGFrameFromKinematicOptions (
@@ -115,6 +117,7 @@ func wrapWithPTGKinematics(
115
117
ptgs : ptgs ,
116
118
currentInput : zeroInput ,
117
119
origin : origin ,
120
+ geometries : geometries ,
118
121
}, nil
119
122
}
120
123
@@ -243,3 +246,7 @@ func (ptgk *ptgBaseKinematics) ErrorState(ctx context.Context, plan [][]referenc
243
246
244
247
return spatialmath .PoseBetween (nominalPose , actualPIF ), nil
245
248
}
249
+
250
+ func (ptgk * ptgBaseKinematics ) Geometries (ctx context.Context , extra map [string ]interface {}) ([]spatialmath.Geometry , error ) {
251
+ return ptgk .geometries , nil
252
+ }
0 commit comments