Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pass Limits by value
  • Loading branch information
gvaradarajan authored and nicksanford committed Aug 6, 2025
commit 6c24169e77b832cd4a65d59cbc3cc3ab9e47ce11
6 changes: 3 additions & 3 deletions referenceframe/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Limit struct {
Max float64
}

func limitAlmostEqual(limit1, limit2 *Limit, epsilon float64) bool {
func limitAlmostEqual(limit1, limit2 Limit, epsilon float64) bool {
if math.Abs(limit1.Max-limit2.Max) > epsilon {
return false
} else if math.Abs(limit1.Min-limit2.Min) > epsilon {
Expand Down Expand Up @@ -108,7 +108,7 @@ func limitsAlmostEqual(limits1, limits2 []Limit, epsilon float64) bool {
return false
}
for i, limit := range limits1 {
if !limitAlmostEqual(&limit, &limits2[i], epsilon) {
if !limitAlmostEqual(limit, limits2[i], epsilon) {
return false
}
}
Expand Down Expand Up @@ -673,7 +673,7 @@ func PoseToInputs(p spatial.Pose) []Input {
// NOTE: for ease, this function only takes one epsilon parameter because we have yet
// to see a case of quantity where we want accept different levels of floating point error.
// If the time comes where we want a different allowance for limits, vectors, and geometries,
// this function should be changed accordingly
// this function should be changed accordingly.
func framesAlmostEqual(frame1, frame2 Frame, epsilon float64) (bool, error) {
switch {
case reflect.TypeOf(frame1) != reflect.TypeOf(frame2):
Expand Down