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
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion nav_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ add_service_files(
FILES
GetMap.srv
GetPlan.srv
SetMap.srv)
SetMap.srv
LoadMap.srv)

add_action_files(
FILES
Expand Down
15 changes: 15 additions & 0 deletions nav_msgs/srv/LoadMap.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.

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

uint8 RESULT_MAP_DOES_NOT_EXIST=1
uint8 RESULT_INVALID_MAP_DATA=2
uint8 RESULT_INVALID_MAP_METADATA=3
uint8 RESULT_UNDEFINED_FAILURE=255

# Returned map is only valid if result equals RESULT_SUCCESS
nav_msgs/OccupancyGrid map
uint8 result