-
Notifications
You must be signed in to change notification settings - Fork 427
Use resource manager #236
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
Use resource manager #236
Changes from all commits
f04659b
bfedd30
678ac82
b2ee864
cd1f6b3
7f1fc65
51e73fb
cee842e
9eb2651
348bbce
407ebcd
5b497a5
18c535a
b96a263
9a4f21a
41137d1
0237d16
22c8b59
8e39c92
decf91e
ba6823f
e038910
5b2198f
fb726d2
e99cae7
52bb762
52856e1
6737bf6
3e760ad
bdc620f
0f14004
77f8a14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,10 +17,12 @@ | |||||
|
|
||||||
| #include <memory> | ||||||
| #include <string> | ||||||
| #include <vector> | ||||||
|
|
||||||
| #include "controller_interface/visibility_control.h" | ||||||
|
|
||||||
| #include "hardware_interface/robot_hardware.hpp" | ||||||
| #include "hardware_interface/loaned_command_interface.hpp" | ||||||
| #include "hardware_interface/loaned_state_interface.hpp" | ||||||
|
|
||||||
| #include "rclcpp/rclcpp.hpp" | ||||||
| #include "rclcpp_lifecycle/lifecycle_node.hpp" | ||||||
|
|
@@ -34,6 +36,26 @@ enum class return_type : std::uint8_t | |||||
| ERROR = 1, | ||||||
| }; | ||||||
|
|
||||||
| /// Indicating which interfaces are to be claimed. | ||||||
| /** | ||||||
| * One might either claim all available command/state interfaces, | ||||||
| * specifying a set of individual interfaces, | ||||||
| * or none at all. | ||||||
| */ | ||||||
| enum class interface_configuration_type : std::uint8_t | ||||||
| { | ||||||
| ALL = 0, | ||||||
| INDIVIDUAL = 1, | ||||||
| NONE = 2, | ||||||
| }; | ||||||
|
|
||||||
| /// Configuring what command/state interfaces to claim. | ||||||
| struct InterfaceConfiguration | ||||||
| { | ||||||
| interface_configuration_type type; | ||||||
| std::vector<std::string> names = {}; | ||||||
| }; | ||||||
|
|
||||||
| class ControllerInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface | ||||||
| { | ||||||
| public: | ||||||
|
|
@@ -44,12 +66,26 @@ class ControllerInterface : public rclcpp_lifecycle::node_interfaces::LifecycleN | |||||
| virtual | ||||||
| ~ControllerInterface() = default; | ||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| virtual | ||||||
| InterfaceConfiguration command_interface_configuration() const = 0; | ||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| virtual | ||||||
| InterfaceConfiguration state_interface_configuration() const = 0; | ||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| void assign_interfaces( | ||||||
Karsten1987 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| std::vector<hardware_interface::LoanedCommandInterface> && command_interfaces, | ||||||
| std::vector<hardware_interface::LoanedStateInterface> && state_interfaces); | ||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| void release_interfaces(); | ||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| virtual | ||||||
| return_type | ||||||
| init( | ||||||
| std::weak_ptr<hardware_interface::RobotHardware> robot_hardware, | ||||||
| const std::string & controller_name); | ||||||
| init(const std::string & controller_name); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewing the current controller portings in ros-control/ros2_controllers repository I realized, that this name argument is obsolete. Since controllers are
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #246 says "Hold my beer" |
||||||
|
|
||||||
| CONTROLLER_INTERFACE_PUBLIC | ||||||
| virtual | ||||||
|
|
@@ -61,7 +97,8 @@ class ControllerInterface : public rclcpp_lifecycle::node_interfaces::LifecycleN | |||||
| get_lifecycle_node(); | ||||||
|
|
||||||
| protected: | ||||||
| std::weak_ptr<hardware_interface::RobotHardware> robot_hardware_; | ||||||
| std::vector<hardware_interface::LoanedCommandInterface> command_interfaces_; | ||||||
| std::vector<hardware_interface::LoanedStateInterface> state_interfaces_; | ||||||
| std::shared_ptr<rclcpp_lifecycle::LifecycleNode> lifecycle_node_; | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.