@@ -164,14 +164,14 @@ func (ptgk *ptgBaseKinematics) GoToInputs(ctx context.Context, inputSteps ...[]r
164164 return tryStop (ctx .Err ())
165165 }
166166 }
167- inputValDiff := step .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]. Value -
168- step .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ]. Value
167+ inputValDiff := step .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ] -
168+ step .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ]
169169 elapsedPct := math .Min (1.0 , timeElapsedSeconds / step .durationSeconds )
170170 currentInputs := []referenceframe.Input {
171171 step .arcSegment .StartConfiguration [ptgIndex ],
172172 step .arcSegment .StartConfiguration [trajectoryAlphaWithinPTG ],
173173 step .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ],
174- { step .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ]. Value + inputValDiff * elapsedPct } ,
174+ step .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ] + inputValDiff * elapsedPct ,
175175 }
176176 ptgk .inputLock .Lock ()
177177 ptgk .currentState .currentInputs = currentInputs
@@ -231,12 +231,12 @@ func (ptgk *ptgBaseKinematics) trajectoryArcSteps(
231231 startPose spatialmath.Pose ,
232232 inputs []referenceframe.Input ,
233233) ([]arcStep , error ) {
234- selectedPTG := int (math .Round (inputs [ptgIndex ]. Value ))
234+ selectedPTG := int (math .Round (inputs [ptgIndex ]))
235235
236236 traj , err := ptgk .ptgs [selectedPTG ].Trajectory (
237- inputs [trajectoryAlphaWithinPTG ]. Value ,
238- inputs [startDistanceAlongTrajectoryIndex ]. Value ,
239- inputs [endDistanceAlongTrajectoryIndex ]. Value ,
237+ inputs [trajectoryAlphaWithinPTG ],
238+ inputs [startDistanceAlongTrajectoryIndex ],
239+ inputs [endDistanceAlongTrajectoryIndex ],
240240 stepDistResolution ,
241241 )
242242 if err != nil {
@@ -245,7 +245,7 @@ func (ptgk *ptgBaseKinematics) trajectoryArcSteps(
245245
246246 finalSteps := []arcStep {}
247247 timeStep := 0.
248- curDist := inputs [startDistanceAlongTrajectoryIndex ]. Value
248+ curDist := inputs [startDistanceAlongTrajectoryIndex ]
249249 startInputs := []referenceframe.Input {
250250 inputs [ptgIndex ],
251251 inputs [trajectoryAlphaWithinPTG ],
@@ -289,7 +289,7 @@ func (ptgk *ptgBaseKinematics) trajectoryArcSteps(
289289 inputs [ptgIndex ],
290290 inputs [trajectoryAlphaWithinPTG ],
291291 nextStep .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ],
292- { curDist } ,
292+ curDist ,
293293 }
294294 nextStep .arcSegment .EndConfiguration = stepEndInputs
295295
@@ -304,8 +304,8 @@ func (ptgk *ptgBaseKinematics) trajectoryArcSteps(
304304 stepStartInputs := []referenceframe.Input {
305305 inputs [ptgIndex ],
306306 inputs [trajectoryAlphaWithinPTG ],
307- { curDist } ,
308- { curDist } ,
307+ curDist ,
308+ curDist ,
309309 }
310310 segment = motionplan.Segment {
311311 StartConfiguration : stepStartInputs ,
@@ -328,7 +328,7 @@ func (ptgk *ptgBaseKinematics) trajectoryArcSteps(
328328 inputs [ptgIndex ],
329329 inputs [trajectoryAlphaWithinPTG ],
330330 nextStep .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ],
331- { curDist } ,
331+ curDist ,
332332 }
333333 nextStep .arcSegment .EndConfiguration = finalInputs
334334 arcPose , err := ptgk .planningModel .Transform (finalInputs )
@@ -399,7 +399,7 @@ func (ptgk *ptgBaseKinematics) courseCorrect(
399399 // We've got a course correction solution. Swap out the relevant arcsteps.
400400 newArcSteps , err := ptgk .trajectoryArcSteps (
401401 actualPoseTracked ,
402- []referenceframe.Input {{ float64 (ptgk .courseCorrectionIdx )} , solution .Solution [i ], { 0 } , solution .Solution [i + 1 ]},
402+ []referenceframe.Input {float64 (ptgk .courseCorrectionIdx ), solution .Solution [i ], 0 , solution .Solution [i + 1 ]},
403403 )
404404 if err != nil {
405405 return nil , err
@@ -422,8 +422,8 @@ func (ptgk *ptgBaseKinematics) courseCorrect(
422422 connectionPointDeepCopy := copyArcStep (connectionPoint )
423423
424424 arcOriginalLength := math .Abs (
425- connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]. Value -
426- connectionPointDeepCopy .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ]. Value ,
425+ connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ] -
426+ connectionPointDeepCopy .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ],
427427 )
428428
429429 // Use distances to calculate the % completion of the arc, used to update the time remaining.
@@ -444,24 +444,24 @@ func (ptgk *ptgBaseKinematics) courseCorrect(
444444 connectionPointDeepCopy .arcSegment .EndConfiguration [ptgIndex ],
445445 connectionPointDeepCopy .arcSegment .EndConfiguration [trajectoryAlphaWithinPTG ],
446446 connectionPointDeepCopy .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ],
447- { startVal } ,
447+ startVal ,
448448 }
449449 skippedPose , err := ptgk .planningModel .Transform (skippedSegment )
450450 if err != nil {
451451 return nil , err
452452 }
453453
454- isReverse := connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]. Value < 0
454+ isReverse := connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ] < 0
455455 if isReverse {
456- startVal += connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]. Value
456+ startVal += connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]
457457 }
458458
459- connectionPointDeepCopy .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ]. Value = startVal
460- connectionPointDeepCopy .arcSegment .StartConfiguration [endDistanceAlongTrajectoryIndex ]. Value = startVal
459+ connectionPointDeepCopy .arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ] = startVal
460+ connectionPointDeepCopy .arcSegment .StartConfiguration [endDistanceAlongTrajectoryIndex ] = startVal
461461 if isReverse {
462- connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ]. Value = startVal
462+ connectionPointDeepCopy .arcSegment .EndConfiguration [endDistanceAlongTrajectoryIndex ] = startVal
463463 } else {
464- connectionPointDeepCopy .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ]. Value = startVal
464+ connectionPointDeepCopy .arcSegment .EndConfiguration [startDistanceAlongTrajectoryIndex ] = startVal
465465 }
466466 // The start position should be where the connection tried to get to.
467467 // This needs to be the Goal, as that is the point along the original path, not the solved point, which is just somewhere near
@@ -497,11 +497,11 @@ func (ptgk *ptgBaseKinematics) getCorrectionSolution(ctx context.Context, goals
497497 for _ , goal := range goals {
498498 solveMetric := motionplan .NewScaledSquaredNormMetric (goal .Goal , 50 )
499499 ptgk .logger .Debug ("attempting goal" , goal .Goal )
500- seed := []referenceframe.Input {{ math .Pi / 2 }, { ptgk .linVelocityMMPerSecond / 2 }, { math .Pi / 2 }, { ptgk .linVelocityMMPerSecond / 2 } }
500+ seed := []referenceframe.Input {math .Pi / 2 , ptgk .linVelocityMMPerSecond / 2 , math .Pi / 2 , ptgk .linVelocityMMPerSecond / 2 }
501501 if goal .Goal .Point ().X > 0 {
502- seed [0 ]. Value *= - 1
502+ seed [0 ] *= - 1
503503 } else {
504- seed [2 ]. Value *= - 1
504+ seed [2 ] *= - 1
505505 }
506506 // Attempt to use our course correction solver to solve for a new set of trajectories which will get us from our current position
507507 // to our goal point along our original trajectory.
@@ -515,7 +515,7 @@ func (ptgk *ptgBaseKinematics) getCorrectionSolution(ctx context.Context, goals
515515 }
516516 ptgk .logger .Debug ("solution" , solution )
517517 if solution .Score < courseCorrectionMaxScore {
518- goal .Solution = referenceframe . FloatsToInputs ( solution .Configuration )
518+ goal .Solution = solution .Configuration
519519 return goal , nil
520520 }
521521 }
@@ -531,7 +531,7 @@ func (ptgk *ptgBaseKinematics) makeCourseCorrectionGoals(
531531 currentInputs []referenceframe.Input ,
532532) []courseCorrectionGoal {
533533 goals := []courseCorrectionGoal {}
534- currDist := currentInputs [endDistanceAlongTrajectoryIndex ]. Value
534+ currDist := currentInputs [endDistanceAlongTrajectoryIndex ]
535535 stepsPerGoal := int ((ptgk .nonzeroBaseTurningRadiusMeters * lookaheadDistMult * 1000 )/ stepDistResolution ) / nGoals
536536
537537 if stepsPerGoal < 1 {
@@ -568,7 +568,7 @@ func (ptgk *ptgBaseKinematics) makeCourseCorrectionGoals(
568568 steps [i ].arcSegment .StartConfiguration [ptgIndex ],
569569 steps [i ].arcSegment .StartConfiguration [trajectoryAlphaWithinPTG ],
570570 steps [i ].arcSegment .StartConfiguration [startDistanceAlongTrajectoryIndex ],
571- { steps [i ].subTraj [goalTrajPtIdx ].Dist } ,
571+ steps [i ].subTraj [goalTrajPtIdx ].Dist ,
572572 }
573573
574574 arcPose , err := ptgk .planningModel .Transform (arcTrajInputs )
0 commit comments