Skip to content
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

Merged
merged 18 commits into from
May 21, 2024

Conversation

nfranczak
Copy link
Member

We add bounding regions as a value to the navigation service config

@nfranczak nfranczak requested review from nicksanford and raybjork May 17, 2024 21:04
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label May 17, 2024
Copy link
Contributor

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base IsMoving
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
motion GetPose
vision ClassificationsFromCamera

@@ -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
Copy link
Member

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?

Copy link
Member

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...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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

@@ -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
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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.

services/navigation/builtin/builtin.go Show resolved Hide resolved
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@nfranczak nfranczak requested a review from nicksanford May 20, 2024 15:28
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
…te or reconfigure with details added for which part of the cfg was faulty
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@@ -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())
Copy link
Member

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

Copy link
Member Author

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())
Copy link
Member

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

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label May 20, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 20, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels May 21, 2024
@nfranczak nfranczak merged commit 32cf7f5 into viamrobotics:main May 21, 2024
16 checks passed
@nfranczak nfranczak deleted the RSDK-7466 branch June 12, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants