-
Notifications
You must be signed in to change notification settings - Fork 0
Nav feature refactor #13
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
Open
FabianEP11
wants to merge
12
commits into
feature-wrapper-dev
Choose a base branch
from
nav-feature-refactor
base: feature-wrapper-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d1987cb
Adding nav feature as plugin base
FabianEP11 a78b7aa
Testing feedback
FabianEP11 13af592
cancel goal
FabianEP11 9a6e98e
Working version
FabianEP11 8a3065a
Clean up code
FabianEP11 dc04753
wait for finish state on RMI
FabianEP11 c266da1
Fixed RMI - wait for feedback
FabianEP11 8ce3b82
changes on nav requests & Add priority
FabianEP11 b869e6a
Fixed issue passing data to the lambda function
FabianEP11 9f557a4
Use RobotCancelNavigationGoal instead just robot name on RMI
FabianEP11 20e3a25
Included request_id / priority on navigation and cancel goal requests
FabianEP11 9b9c4b1
Fixed navigation mutex & removed move_base dependencies
FabianEP11 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #ifndef TEMOTO_ROBOT_MANAGER__NAVIGATION_DATASTRUCTURES_H | ||
| #define TEMOTO_ROBOT_MANAGER__NAVIGATION_DATASTRUCTURES_H | ||
|
|
||
| #include "temoto_robot_manager/rm_datastructures.h" | ||
|
|
||
| namespace temoto_robot_manager | ||
| { | ||
|
|
||
| struct RmNavigationGoal | ||
| { | ||
| PoseStamped goal_pose; | ||
| }; | ||
|
|
||
| struct RmNavigationFeedback | ||
| { | ||
| uint8_t status; | ||
| double progress; | ||
| PoseStamped base_position; | ||
| }; | ||
|
|
||
| } // temoto_robot_manager | ||
|
|
||
| #endif |
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,23 @@ | ||
| #ifndef TEMOTO_ROBOT_MANAGER__NAVIGATION_PLUGIN_BASE_H | ||
| #define TEMOTO_ROBOT_MANAGER__NAVIGATION_PLUGIN_BASE_H | ||
|
|
||
| #include "temoto_robot_manager/navigation_datastructures.h" | ||
| #include <optional> | ||
|
|
||
| namespace temoto_robot_manager | ||
| { | ||
|
|
||
| class NavigationPluginBase | ||
| { | ||
| public: | ||
| virtual bool initialize(const std::string& robot_ns) = 0; | ||
| virtual bool sendGoal(RmNavigationGoal goal) = 0; | ||
| virtual std::optional<RmNavigationFeedback> getFeedback() = 0; | ||
| virtual bool cancelGoal() = 0; | ||
| virtual bool deinitialize() = 0; | ||
| virtual ~NavigationPluginBase(){}; | ||
| }; | ||
|
|
||
| } // temoto_robot_manager | ||
|
|
||
| #endif |
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,69 @@ | ||
| #ifndef TEMOTO_ROBOT_MANAGER__NAVIGATION_PLUGIN_HELPER_H | ||
| #define TEMOTO_ROBOT_MANAGER__NAVIGATION_PLUGIN_HELPER_H | ||
|
|
||
| #include "class_loader/class_loader.hpp" | ||
| #include "temoto_robot_manager/navigation_plugin_base.h" | ||
| #include <memory> | ||
| #include <thread> | ||
|
|
||
| namespace temoto_robot_manager | ||
| { | ||
|
|
||
| struct RmNavigationFeedbackWrap : RmNavigationFeedback | ||
| { | ||
| std::string robot_name; | ||
| std::string request_id; | ||
| }; | ||
|
|
||
| struct RmNavigationRequestWrap : RmNavigationGoal | ||
| { | ||
| std::string robot_name; | ||
| std::string request_id; | ||
| }; | ||
|
|
||
| class NavigationPluginHelper; | ||
|
|
||
| typedef std::shared_ptr<NavigationPluginHelper> NavigationPluginHelperPtr; | ||
| typedef std::function<void(const RmNavigationFeedbackWrap&)> NavigationFeatureUpdateCb; | ||
|
|
||
| class NavigationPluginHelper | ||
| { | ||
| public: | ||
| enum class State | ||
| { | ||
| NOT_LOADED, | ||
| UNINITIALIZED, | ||
| INITIALIZED, | ||
| PROCESSING, | ||
| FINISHED, | ||
| STOPPING, | ||
| ERROR | ||
| }; | ||
|
|
||
| NavigationPluginHelper(const std::string& plugin_path, const std::string& robot_ns, NavigationFeatureUpdateCb update_cb); | ||
| ~NavigationPluginHelper(); | ||
| void initialize(); | ||
| void sendGoal(const RmNavigationRequestWrap& request); | ||
| void sendUpdate() const; | ||
| void cancelGoal(); | ||
| void deinitialize(); | ||
| State getState() const; | ||
|
|
||
| private: | ||
| void setState(State state); | ||
|
|
||
| std::shared_ptr<NavigationPluginBase> plugin; | ||
| std::shared_ptr<class_loader::ClassLoader> class_loader; | ||
| std::thread exec_thread_; | ||
| std::string plugin_path_; | ||
| std::string robot_ns_; | ||
| bool is_thread_running_ = false; | ||
|
|
||
| State state_; | ||
| mutable std::mutex mutex_state_; | ||
|
|
||
| std::optional<RmNavigationRequestWrap> current_request_; | ||
| NavigationFeatureUpdateCb update_cb_; | ||
| }; | ||
| } // temoto_robot_manager namespace | ||
| #endif |
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,46 @@ | ||
| #ifndef TEMOTO_ROBOT_MANAGER__RM_DATASTRUCTURES_H | ||
| #define TEMOTO_ROBOT_MANAGER__RM_DATASTRUCTURES_H | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| namespace temoto_robot_manager | ||
| { | ||
|
|
||
| struct Header | ||
| { | ||
| std::string frame_id; | ||
| uint64_t timestamp; | ||
| uint64_t sequence_id; | ||
| }; | ||
|
|
||
| struct Position | ||
| { | ||
| double x; | ||
| double y; | ||
| double z; | ||
| }; | ||
|
|
||
| struct Orientation | ||
| { | ||
| double x; | ||
| double y; | ||
| double z; | ||
| double w; | ||
| }; | ||
|
|
||
| struct Pose | ||
| { | ||
| Position position; | ||
| Orientation orientation; | ||
| }; | ||
|
|
||
| struct PoseStamped | ||
| { | ||
| Header header; | ||
| Pose pose; | ||
| }; | ||
|
|
||
| } // temoto_robot_manager | ||
|
|
||
| #endif |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the difference between
poseanddata_pose, a small inline comment wouldn't do harm.