Skip to content

Commit 709fb85

Browse files
authored
Add new interface_configuration_types and reusable methods (#2902) (#2935)
1 parent fb50f75 commit 709fb85

File tree

4 files changed

+369
-117
lines changed

4 files changed

+369
-117
lines changed

controller_interface/include/controller_interface/controller_interface_base.hpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,27 @@ enum class return_type : std::uint8_t
4646
/// Indicating which interfaces are to be claimed.
4747
/**
4848
* One might either claim all available command/state interfaces,
49-
* specifying a set of individual interfaces,
50-
* or none at all.
49+
* specifying a set of individual interfaces or none at all.
50+
* @enum ALL - Claim all available interfaces.
51+
* @enum INDIVIDUAL - Claim only the specified individual interfaces.
52+
* @enum NONE - Claim no interfaces.
53+
* @enum INDIVIDUAL_BEST_EFFORT - Claim the available interfaces from the specified individual
54+
* interfaces.
55+
* @enum REGEX - Claim interfaces matching the specified regular expressions.
5156
*/
5257
enum class interface_configuration_type : std::uint8_t
5358
{
5459
ALL = 0,
5560
INDIVIDUAL = 1,
5661
NONE = 2,
62+
INDIVIDUAL_BEST_EFFORT = 3,
63+
REGEX = 10
5764
};
5865

5966
/// Configuring what command/state interfaces to claim.
6067
struct InterfaceConfiguration
6168
{
62-
interface_configuration_type type;
69+
interface_configuration_type type = interface_configuration_type::NONE;
6370
std::vector<std::string> names = {};
6471
};
6572

@@ -369,6 +376,10 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
369376
* If interface_configuration_type::ALL is specified, the order is determined by the internal
370377
* memory of the resource_manager and may not be deterministic. To obtain a consistent order, use
371378
* \ref get_ordered_interfaces() from \ref helpers.hpp.
379+
* If interface_configuration_type::INDIVIDUAL_BEST_EFFORT or REGEX is specified, the order might
380+
* not matched the requested one, as it depends on the available interfaces in the resource
381+
* manager. Use the \ref get_ordered_interfaces() from \ref helpers.hpp to obtain a consistent
382+
* order.
372383
*/
373384
std::vector<hardware_interface::LoanedCommandInterface> command_interfaces_;
374385
/** Loaned state interfaces.
@@ -379,6 +390,10 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
379390
* If interface_configuration_type::ALL is specified, the order is determined by the internal
380391
* memory of the resource_manager and may not be deterministic. To obtain a consistent order, use
381392
* \ref get_ordered_interfaces() from \ref helpers.hpp.
393+
* If interface_configuration_type::INDIVIDUAL_BEST_EFFORT or REGEX is specified, the order might
394+
* not matched the requested one, as it depends on the available interfaces in the resource
395+
* manager. Use the \ref get_ordered_interfaces() from \ref helpers.hpp to obtain a consistent
396+
* order.
382397
*/
383398
std::vector<hardware_interface::LoanedStateInterface> state_interfaces_;
384399

0 commit comments

Comments
 (0)