Skip to content
Draft
Show file tree
Hide file tree
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
some missed cleanup
  • Loading branch information
gvaradarajan authored and nicksanford committed Aug 6, 2025
commit e4c8551f1e57a1e9a237654c3d39dcd68f40da39
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 *Limit, limit2 *Limit) bool {
func limitAlmostEqual(limit1, limit2 *Limit) bool {
if math.Abs(limit1.Max-limit2.Max) > 1e-8 {
return false
} else if math.Abs(limit1.Min-limit2.Min) > 1e-8 {
Expand Down Expand Up @@ -103,7 +103,7 @@ type Limited interface {
DoF() []Limit
}

func limitsAlmostEqual(limits1 []Limit, limits2 []Limit) bool {
func limitsAlmostEqual(limits1, limits2 []Limit) bool {
if len(limits1) != len(limits2) {
return false
}
Expand Down Expand Up @@ -666,7 +666,7 @@ func PoseToInputs(p spatial.Pose) []Input {
})
}

func framesAlmostEqual(frame1 Frame, frame2 Frame) bool {
func framesAlmostEqual(frame1, frame2 Frame) bool {
switch {
case reflect.TypeOf(frame1) != reflect.TypeOf(frame2):
return false
Expand Down
6 changes: 5 additions & 1 deletion referenceframe/frame_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,13 @@ func jsonToFrame(data json.RawMessage) (Frame, error) {
}
frameZeroStruct := reflect.New(implementer).Elem()
frame := frameZeroStruct.Addr().Interface()
frameI, err := utils.AssertType[Frame](frame)
if err != nil {
return nil, err
}
if err := json.Unmarshal(sF["frame"], frame); err != nil {
return nil, err
}

return utils.AssertType[Frame](frame)
return frameI, nil
}