-
Notifications
You must be signed in to change notification settings - Fork 122
[RSDK-10933] use PlanningAlgorithm enum in favor of function pointer #5067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[RSDK-10933] use PlanningAlgorithm enum in favor of function pointer #5067
Conversation
motionplan/planning_algorithms.go
Outdated
} | ||
} | ||
|
||
func getPlanner( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been using the idiom of newX
when writing functions that are constructors. This one definitely feels like a constructor rather than a getter. newPlanner
is already taken so not sure what we should call this though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a naming note that would be nice to address but won't block over it.
motionplan/planning_algorithms.go
Outdated
} | ||
} | ||
|
||
func getPlanner( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually think of "get" as returning an existing thing.
We're actually calling the constructor here and generating a new planner. Maybe we name this "constructPlanner"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM mod one naming comment
motionplan/plannerOptions.go
Outdated
// Note the direct reference to a default here. | ||
// This is due to a Go compiler issue where it will incorrectly refuse to compile with a circular reference error if this | ||
// is placed in a global default var. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also not sure if this is relevant anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
First of many PRs to clean up
PlanRequest
andplannerOptions
.This particular PR is the start of trying to remove function pointers from these structs wherever possible (due to them not being serializable or explicit)