-
Notifications
You must be signed in to change notification settings - Fork 113
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
RSDK-7466 - Change navigation config to include bounding regions #3971
Conversation
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
services/motion/motion.go
Outdated
@@ -56,7 +56,7 @@ type MoveOnGlobeReq struct { | |||
Obstacles []*spatialmath.GeoGeometry | |||
// Optional motion configuration | |||
MotionCfg *MotionConfiguration | |||
|
|||
// Set of obstacles which the robot must remain within while navigating | |||
BoundingRegions []*spatialmath.GeoGeometry |
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.
Can you move this to be with the obstacles?
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.
A bounding region is not an obstacle...
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.
@nicksanford definition taken from API
https://github.com/viamrobotics/api/blob/main/proto/viam/service/motion/v1/motion.proto#L166
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.
Nick is right, we should remove the word "obstacle" when referring to these
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.
ok, what do we think of:
Set of bounds which the robot must remain within while navigating
Is it worth updating the API to match the new definition we are putting forward?
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.
Lets change bounds
above to geometries
. And yeah lets make the 1 line change to the API too. We probably need to clean up the comments in motion.proto
more but this would be a good start
services/motion/motion.go
Outdated
@@ -56,7 +56,7 @@ type MoveOnGlobeReq struct { | |||
Obstacles []*spatialmath.GeoGeometry | |||
// Optional motion configuration | |||
MotionCfg *MotionConfiguration | |||
|
|||
// Set of obstacles which the robot must remain within while navigating | |||
BoundingRegions []*spatialmath.GeoGeometry |
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.
A bounding region is not an obstacle...
for _, region := range conf.BoundingRegions { | ||
for _, geoms := range region.Geometries { | ||
if !geoms.TranslationOffset.ApproxEqual(r3.Vector{}) { | ||
return nil, errGeomWithTranslation |
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.
Is there a test for this new validation?
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 will add this as a unit test.
…te or reconfigure with details added for which part of the cfg was faulty
@@ -181,7 +183,16 @@ func (conf *Config) Validate(path string) ([]string, error) { | |||
for _, obs := range conf.Obstacles { | |||
for _, geoms := range obs.Geometries { | |||
if !geoms.TranslationOffset.ApproxEqual(r3.Vector{}) { | |||
return nil, errors.New("geometries specified through the navigation are not allowed to have a translation") | |||
return nil, errors.New("obstacle " + errGeomWithTranslation.Error()) |
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.
Please use errors.Wrap
rather than string concat with errors.New
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.
will do.
for _, region := range conf.BoundingRegions { | ||
for _, geoms := range region.Geometries { | ||
if !geoms.TranslationOffset.ApproxEqual(r3.Vector{}) { | ||
return nil, errors.New("bounding region " + errGeomWithTranslation.Error()) |
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.
Please use errors.Wrap
rather than string concat with errors.New
We add bounding regions as a value to the navigation service config