-
Notifications
You must be signed in to change notification settings - Fork 11
Accept incoming routes #81
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
maps_managers/easynav_routes_maps_manager/include/easynav_routes_maps_manager/route_io.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| // Copyright 2025 Intelligent Robotics Lab | ||
| // | ||
| // This file is part of the project Easy Navigation (EasyNav in short) | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| /// \file | ||
| /// \brief Routes YAML input, and RoutesMap <-> RoutesMap.msg conversion. | ||
| /// | ||
| /// Free functions, not RoutesMapsManager members, so that any other | ||
| /// node (e.g. a fleet-wide navigation manager publishing on | ||
| /// /global_routes) can load/convert routes the exact same way | ||
| /// RoutesMapsManager itself does, without depending on | ||
| /// RoutesMapsManager's own heavier machinery (pluginlib, | ||
| /// interactive_markers, ...). | ||
|
|
||
| #ifndef EASYNAV_ROUTES_MAPS_MANAGER__ROUTE_IO_HPP_ | ||
| #define EASYNAV_ROUTES_MAPS_MANAGER__ROUTE_IO_HPP_ | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "easynav_routes_maps_manager/msg/routes_map.hpp" | ||
| #include "easynav_routes_maps_manager/routes_map.hpp" | ||
|
|
||
| namespace easynav | ||
| { | ||
|
|
||
| /** | ||
| * @brief Load a RoutesMap from a routes YAML file. | ||
| * | ||
| * Same format used by RoutesMapsManager's own `map_path_file` | ||
| * parameter: a top-level `routes: [name, ...]` list plus one | ||
| * `start`/`end` pose-pair entry per name. Falls back to a single | ||
| * default segment ((0,0,0) -> (1,0,0), id "route0") when the file is | ||
| * empty, missing, invalid, or has no "routes" key. | ||
| * @param yaml_file Path to the routes YAML file (empty means "use the | ||
| * default segment"). | ||
| * @return The parsed (or default) RoutesMap. | ||
| */ | ||
| RoutesMap load_routes_from_yaml(const std::string & yaml_file); | ||
|
|
||
| /** | ||
| * @brief Convert an in-memory RoutesMap to its wire message form. | ||
| * @param routes Routes to convert. | ||
| * @return The equivalent RoutesMap message (edit_mode is not carried | ||
| * over -- it is UI-editor-only state). | ||
| */ | ||
| easynav_routes_maps_manager::msg::RoutesMap to_msg(const RoutesMap & routes); | ||
|
|
||
| /** | ||
| * @brief Convert a wire RoutesMap message back to the in-memory form. | ||
| * @param msg Message to convert. | ||
| * @return The equivalent RoutesMap. | ||
| */ | ||
| RoutesMap from_msg(const easynav_routes_maps_manager::msg::RoutesMap & msg); | ||
|
|
||
| } // namespace easynav | ||
|
|
||
| #endif // EASYNAV_ROUTES_MAPS_MANAGER__ROUTE_IO_HPP_ |
59 changes: 59 additions & 0 deletions
59
maps_managers/easynav_routes_maps_manager/include/easynav_routes_maps_manager/routes_map.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright 2025 Intelligent Robotics Lab | ||
| // | ||
| // This file is part of the project Easy Navigation (EasyNav in short) | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| /// \file | ||
| /// \brief Declaration of RouteSegment/RoutesMap, split out of | ||
| /// RoutesMapsManager.hpp so that code needing only the plain data types | ||
| /// (e.g. route_io.hpp, or an external publisher) doesn't have to pull in | ||
| /// RoutesMapsManager's own heavier dependencies (pluginlib, | ||
| /// interactive_markers, ...). | ||
|
|
||
| #ifndef EASYNAV_ROUTES_MAPS_MANAGER__ROUTES_MAP_HPP_ | ||
| #define EASYNAV_ROUTES_MAPS_MANAGER__ROUTES_MAP_HPP_ | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "geometry_msgs/msg/pose.hpp" | ||
|
|
||
| namespace easynav | ||
| { | ||
|
|
||
| /// @brief Simple directed segment between two poses. | ||
| /// | ||
| /// Each RouteSegment represents a straight-line connection between two | ||
| /// poses in the navigation frame. The segment can be individually | ||
| /// edited and identified via its @ref id field. | ||
| struct RouteSegment | ||
| { | ||
| /// @brief Unique identifier for this segment. | ||
| std::string id; | ||
|
|
||
| /// @brief Start pose of the segment. | ||
| geometry_msgs::msg::Pose start; | ||
|
|
||
| /// @brief End pose of the segment. | ||
| geometry_msgs::msg::Pose end; | ||
|
|
||
| /// @brief Whether this segment is currently in edit mode. | ||
| bool edit_mode{false}; | ||
| }; | ||
|
|
||
| /// @brief Container type representing a full set of navigation routes. | ||
| using RoutesMap = std::vector<RouteSegment>; | ||
|
|
||
| } // namespace easynav | ||
|
|
||
| #endif // EASYNAV_ROUTES_MAPS_MANAGER__ROUTES_MAP_HPP_ |
7 changes: 7 additions & 0 deletions
7
maps_managers/easynav_routes_maps_manager/msg/RouteSegment.msg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # A single directed segment between two poses -- the wire form of | ||
| # easynav::RouteSegment (see routes_map.hpp), minus its UI-editor-only | ||
| # `edit_mode` field. | ||
|
|
||
| string id | ||
| geometry_msgs/Pose start | ||
| geometry_msgs/Pose end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # A full set of navigation routes -- the wire form of easynav::RoutesMap | ||
| # (see routes_map.hpp). Published on /global_routes by | ||
| # easyfleet_navigation_manager, and accepted by RoutesMapsManager's own | ||
| # "incoming_routes" subscription (same convention as | ||
| # easynav_costmap_maps_manager's "incoming_map"): a message received | ||
| # there replaces whatever was loaded from map_path_file at startup. | ||
|
|
||
| RouteSegment[] routes | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.