-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Nav2 route server start pose orientation scorer #4950
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
SteveMacenski
merged 56 commits into
ros-navigation:nav2_route_server
from
alexanderjyuen:nav2_route_server_start_pose_orientation_scorer
Mar 27, 2025
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
b7230b7
adding flag to identify start node, passing tf_buffer to edge scorer
alexanderjyuen cb665ef
passing tf to route planner
alexanderjyuen 178cc21
added null buffer to tests
alexanderjyuen eb6e17e
added null buffer to planner configure in performance bench marking test
alexanderjyuen 8707ef2
changed arguments of all old edge scorers to also take tf_buffer
alexanderjyuen 9021151
changed configure to take tf_buffer, added bool to identify start_edg…
alexanderjyuen f6db192
added start_pose_orientation_scorer to CMake
alexanderjyuen d507f40
added StartPoseOrientationScorer as and edge scroer
alexanderjyuen bedf5fc
added tf_buffer to constructor, added start edge bool on score method…
alexanderjyuen 80f1189
added tf_buffer to configure method, added start_id_ member variable,…
alexanderjyuen 7f7e84e
modified all configures to take a tf_buffer, modified all score funct…
alexanderjyuen 63d02ac
adding start_pose_orientation_scorer.cpp
alexanderjyuen d02bb47
edge scorer modified to take in tf_buffer and pass it to scorer plugi…
alexanderjyuen be1a59f
removed redundant parameter declarations, changed robot frame to base…
alexanderjyuen 2917ff7
changed robot frame to base frame, year bump on copy right
alexanderjyuen b54c47b
removed unnecessary tf_buffer_ from edge_scorer
alexanderjyuen 95e4f1a
added EdgeType enum class
alexanderjyuen 6bf96d0
all edge scorer plugins changed to use EdgeType
alexanderjyuen b51f535
edge_scorer modified to use EdgeType enum class
alexanderjyuen d87a888
edge_cost_function base class modified to use EdgeType enum class
alexanderjyuen 78451ac
modified tests for new scorer signature
alexanderjyuen feeff0d
added method to classify edge type
alexanderjyuen 7a27675
ament_cpplinting
alexanderjyuen d1d6303
linting
alexanderjyuen 743fc09
changed EdgeType to const ref
alexanderjyuen 4bb3131
added option to score orientations instead of outright rejecting star…
alexanderjyuen 4124841
updated docstrings to have better description for goal pose and start…
alexanderjyuen 224218d
Merge branch 'nav2_route_server' into nav2_route_server_start_pose_or…
alexanderjyuen 5c56e61
fixed merge conflict in goal_orientation_scorer.hpp
alexanderjyuen b946857
fixed merge conflict in edge_cost_function.hpp
alexanderjyuen 3f23b82
removed TODO from costmap_scorer.cpp
alexanderjyuen 1d4bd2d
added getStart method to goal_intent_extract and start pose argument …
alexanderjyuen d395cc3
added RouteData struct to types.hpp
alexanderjyuen b2f9010
added start_pose to edge scorer hpp and cpp
alexanderjyuen 9d7bdd7
fixed type getStart return type in goal_intent_extractor.cpp
alexanderjyuen 529b8c9
added passing of start_pose down to scorer in route_planner
alexanderjyuen 9a2e60b
added start pose to base edge cost function class
alexanderjyuen 6188fd3
underscore fix for goal_intent_extractor_
alexanderjyuen 9d63e2f
changed signature of all edge cost functions to take start_pose
alexanderjyuen 305b028
populating RouteData and passing it into findRoute
alexanderjyuen 4c3a96f
passing route_data down to getTraversalCost
alexanderjyuen e2c763d
plugins modified to take in route_data, tests updated accordingly
alexanderjyuen 96ae07d
using route data for goal_orientation_scorer and start_pose_orientati…
alexanderjyuen 34edfc2
removed route frame, robot frame, and getRobotPose from start_pose_or…
alexanderjyuen e57e0db
removed used of stat_pose and goal_pose as it is replaced with route …
alexanderjyuen b9ad8bb
added InvalidCriticUse exception to nav2_core, goal_orientation_score…
alexanderjyuen 143a18f
added INVALID_CRITIC_USE error code in route actions
alexanderjyuen d1d2d62
added orientation weighting for cost as an option instead of out righ…
alexanderjyuen cfd4a15
updated docstring for goal orientation scorer
alexanderjyuen 8864fda
renamed Critic to EdgeScorer
alexanderjyuen 0b20cfe
changed Critic to EdgeScorer in edge cost functions
alexanderjyuen e98fbe5
changed Critic to EdgeScorer, storing exception message in error msg
alexanderjyuen 6cd284f
changed Critic to EdgeScorer in edge scorer tests
alexanderjyuen 855f5f5
changed INVALID_CRITIC_USE to IVALID_EDGE_SCORER_US in actions
alexanderjyuen 141fd89
changed RouteData and route_data to RouteRequest and route_request re…
alexanderjyuen 08deb8a
added doxygen for EdgeType
alexanderjyuen 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
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
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
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
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
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
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
93 changes: 93 additions & 0 deletions
93
nav2_route/include/nav2_route/plugins/edge_cost_functions/start_pose_orientation_scorer.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,93 @@ | ||
| // Copyright (c) 2025, Polymath Robotics Inc. | ||
| // | ||
| // 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. | ||
|
|
||
| #ifndef NAV2_ROUTE__PLUGINS__EDGE_COST_FUNCTIONS__START_POSE_ORIENTATION_SCORER_HPP_ | ||
| #define NAV2_ROUTE__PLUGINS__EDGE_COST_FUNCTIONS__START_POSE_ORIENTATION_SCORER_HPP_ | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "rclcpp/rclcpp.hpp" | ||
| #include "rclcpp_lifecycle/lifecycle_node.hpp" | ||
| #include "nav2_core/route_exceptions.hpp" | ||
| #include "nav2_route/interfaces/edge_cost_function.hpp" | ||
| #include "nav2_util/line_iterator.hpp" | ||
| #include "nav2_util/node_utils.hpp" | ||
| #include "nav2_util/robot_utils.hpp" | ||
| #include "nav2_costmap_2d/costmap_subscriber.hpp" | ||
| #include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" | ||
| #include "tf2/utils.h" | ||
| #include "angles/angles.h" | ||
|
|
||
| namespace nav2_route | ||
| { | ||
|
|
||
| /** | ||
| * @class StartPoseOrientationScorer | ||
| * @brief Scores initial edge by comparing the orientation of the robot's current | ||
| * pose and the orientation of the edge by multiplying the deviation from the desired | ||
| * orientation with a user defined weight. An alternative method can be selected, with | ||
| * the use_orientation_threshold flag, which rejects the edge it is greater than some | ||
| * tolerance | ||
| */ | ||
| class StartPoseOrientationScorer : public EdgeCostFunction | ||
| { | ||
| public: | ||
| /** | ||
| * @brief Constructor | ||
| */ | ||
| StartPoseOrientationScorer() = default; | ||
|
|
||
| /** | ||
| * @brief destructor | ||
| */ | ||
| virtual ~StartPoseOrientationScorer() = default; | ||
|
|
||
| /** | ||
| * @brief Configure | ||
| */ | ||
| void configure( | ||
| const rclcpp_lifecycle::LifecycleNode::SharedPtr node, | ||
| const std::shared_ptr<tf2_ros::Buffer> tf_buffer, | ||
| const std::string & name) override; | ||
|
|
||
| /** | ||
| * @brief Main scoring plugin API | ||
| * @param edge The edge pointer to score, which has access to the | ||
| * start/end nodes and their associated metadata and actions | ||
| * @param cost of the edge scored | ||
| * @return bool if this edge is open valid to traverse | ||
| */ | ||
| bool score( | ||
| const EdgePtr edge, const RouteRequest & route_request, | ||
| const EdgeType & edge_type, float & cost) override; | ||
|
|
||
| /** | ||
| * @brief Get name of the plugin for parameter scope mapping | ||
| * @return Name | ||
| */ | ||
| std::string getName() override; | ||
|
|
||
| protected: | ||
| rclcpp::Logger logger_{rclcpp::get_logger("StartPoseOrientationScorer")}; | ||
| std::string name_; | ||
| std::shared_ptr<tf2_ros::Buffer> tf_buffer_; | ||
| double orientation_tolerance_; | ||
| float orientation_weight_; | ||
| bool use_orientation_threshold_; | ||
| }; | ||
|
|
||
| } // namespace nav2_route | ||
|
|
||
| #endif // NAV2_ROUTE__PLUGINS__EDGE_COST_FUNCTIONS__START_POSE_ORIENTATION_SCORER_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
Oops, something went wrong.
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.