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

Add LoadMap service definition #152

Merged
merged 4 commits into from
Aug 13, 2020
Merged

Add LoadMap service definition #152

merged 4 commits into from
Aug 13, 2020

Conversation

jacobperron
Copy link

Continuation of #95. Now targeting the default branch.


Original description:

The service is for loading a map as an nav_msgs/OccupancyGrid given a resource ID. It also features a result member to encode errors. I tried to make the result codes generic enough for support of arbitrary backends and underlying data structures.

This could be implemented in a map_loader node or directly in map_server seeing how it already "loads" a map on startup.


I've updated the definition to take a URL as suggested by @jack-oquin (774d96f) and fixed an error (a12d806).

jacobperron and others added 3 commits November 25, 2019 13:45
@mkhansenbot
Copy link

If you merge this for Eloquent, I'll change my Nav2 PR to be based on this service.

@jacobperron
Copy link
Author

If you merge this for Eloquent, I'll change my Nav2 PR to be based on this service.

@mkhansen-intel This PR is targeting ROS 1. But if it is approved and merged, I'll port it to ROS 2.
Since this may take some time, I would go ahead with the nav2 version of the service definition and we can make the change to the common type in the future. Hopefully it's as easy as swapping the package name 🤞

@mkhansenbot
Copy link

@jacobperron - so I started changing my PR to use this format by temporarily adding this to our nav2_msgs until you merge this for Eloquent.

However, there is a minor issue to discuss. Inside each map.yaml file is a path to the image file:

image: testmap.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0

So, do we now require that every image is a full path?
file://home/user/ros/testmap.png
https:/server/ros/testmap.png

If so it means we're not backwards compatible with existing map.yaml files, they'll need to be updated.

Thoughts on this?

@jacobperron
Copy link
Author

jacobperron commented Nov 27, 2019

So, do we now require that every image is a full path?

Good question. I figured that the path to image file is assumed relative to the location of the YAML file. I'd say no, we shouldn't use URLs for the image files. I think we should be compatible with whatever map saver is doing.

@mkhansenbot
Copy link

I think we should be compatible with whatever map saver is doing.

I agree, I'll see what I can do to stay compatible. I think it's reasonable to assume the yaml file and pgm file are in the same relative path. I'll see if using that assumption can keep this simple.

# URL of map resource
# Can be an absolute path to a file: file:///path/to/maps/floor1.yaml
# Or, relative to a ROS package: package://my_ros_package/maps/floor2.yaml
string map_url
Copy link
Author

Choose a reason for hiding this comment

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

I'd like to posit that how the map is loaded or what type of file the URL points to is up to the node implementing the service. E.g. it might point to a yaml file containing the metadata, or maybe an image file directly.

See ros-navigation/navigation2#1303 (comment) for a relevant discussion.

cc @SteveMacenski

Copy link
Member

Choose a reason for hiding this comment

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

@jacobperron this is also for ROS1, I'm not as concerned about it.

However you think we can change this to map_uri? I typically think of URLs as links to a server rather than a URI which can be a local path.

Copy link
Author

Choose a reason for hiding this comment

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

A URL can also be a local path. It describes a way to locate a resource.
I'm okay with changing this to a more general URI, but would like to hear what others think. It might make the semantics more ambiguous.

Copy link
Member

@SteveMacenski SteveMacenski Dec 5, 2019

Choose a reason for hiding this comment

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

I know a URL 'is' that, but in vernacular we usually talk about servers. A URL is a subclass of URI. 100% agree its semantics. I just think it makes it more clear actually because of the vernacular uses and URI is what is used in SDF for getting models/packages/files in the same way this is attempting to so its consistent with other ROS-y tools.

I don't care that much one way or another since I know what it means, but I could see someone just looking at a message definition in ros2 msg show ... and thinking it had to be a web link. If no one else agrees, I'm not going to push it.

# URL of map resource
# Can be an absolute path to a file: file:///path/to/maps/floor1.yaml
# Or, relative to a ROS package: package://my_ros_package/maps/floor2.yaml
string map_url
Copy link
Member

Choose a reason for hiding this comment

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

@jacobperron this is also for ROS1, I'm not as concerned about it.

However you think we can change this to map_uri? I typically think of URLs as links to a server rather than a URI which can be a local path.

string map_url
---
# Result code defintions
uint8 RESULT_SUCCESS=0
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if these were just SUCCESS etc without the RESULT_ prefix since in use it would be nav_msgs::msg::LoadMap::Result::RESULT_MAP_DOES_NOT_EXIST and we see result twice in a row.

Choose a reason for hiding this comment

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

Actually, its not:
nav_msgs::msg::LoadMap::Result::RESULT_MAP_DOES_NOT_EXIST
It's
nav_msgs::msg::LoadMap::Response::RESULT_MAP_DOES_NOT_EXIST

Subtle difference.

Copy link
Member

Choose a reason for hiding this comment

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

ah, yes sorry.

Its not something I care deeply about, just a comment that it seems related enough with the namespace the additional wording just uses linespace. If no one else agrees, I'm certainly not going to push it.

@mkhansenbot
Copy link

What happened with this PR? I merged my Nav2 PR awhile back assuming this would be completed shortly. Who needs to approve it?

@SteveMacenski
Copy link
Member

I believe we're using the Nav2 msgs for now on this: https://github.com/ros-planning/navigation2/blob/master/nav2_msgs/srv/LoadMap.srv

I'm not too concerned personally with this being merged (at this point, I think the PR should be closed). In the medium term future, I want nav2_msgs put into nav_msgs, but I want to wait until the APIs settle down. We're still working on adding result and feedback types to all actions.

@jacobperron
Copy link
Author

I think @tfoote is the maintainer of this package and should be the one to review / merge.

@mkhansenbot
Copy link

@SteveMacenski - I'm still hoping that the nav2_msgs LoadMap.srv will be replaced by this.

@SteveMacenski
Copy link
Member

That's also fine.

@DLu
Copy link
Contributor

DLu commented Jul 3, 2020

Alternative: We could put it in map_msgs

@SteveMacenski
Copy link
Member

Also fine with that.

@SteveMacenski
Copy link
Member

@jacobperron what's the blocker from this being merged? It looks like Matt, David, and I all approve it. I don't know if David has admin here to merge it but I don't. What's the reason this isn't in / does this just need someone to hit the button?

@jacobperron
Copy link
Author

@SteveMacenski I'm not the maintainer of this package. I believe the responsibility lies on @tfoote.

Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

We can add this here. Especially since it's been proven out in the nav2_msgs already.

It's purely an addition so it will be backwards compatible. What distributions are most important to target? By default I'm going to retarget this to noetic-devel to merge.

@tfoote tfoote self-assigned this Jul 21, 2020
@SteveMacenski
Copy link
Member

Throw it into Foxy as well, I'll file a ticket then to migrate to this message uses' over nav2_msgs

@DLu DLu mentioned this pull request Jul 24, 2020
@DLu
Copy link
Contributor

DLu commented Jul 24, 2020

This PR is for the jade-devel branch, but confusingly, that branch is used for kinetic and melodic, so merging this should update both those distros. I've cherry-picked the commits for noetic in #164

@tfoote tfoote merged commit 10bcfe7 into jade-devel Aug 13, 2020
@tfoote tfoote deleted the jacob/load_map branch August 13, 2020 20:48
@SteveMacenski
Copy link
Member

Is there a potential to have an analog for ROS2?

@jacobperron
Copy link
Author

If you propose a PR to the default branch of https://github.com/ros2/common_interfaces I can review it.

@SteveMacenski
Copy link
Member

ros2/common_interfaces#129 done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants