Skip to content

Commit 0637782

Browse files
saikishorbmagyar
andauthored
enable ReflowComments to also use ColumnLimit on comments (#1037)
* enable ReflowComments to also use ColumnLimit on comments * apply the formatting changes of clang format : ReflowComments --------- Co-authored-by: Bence Magyar <[email protected]>
1 parent bdf7e44 commit 0637782

File tree

19 files changed

+289
-255
lines changed

19 files changed

+289
-255
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ ConstructorInitializerIndentWidth: 0
1010
ContinuationIndentWidth: 2
1111
DerivePointerAlignment: false
1212
PointerAlignment: Middle
13-
ReflowComments: false
13+
ReflowComments: true
1414
IncludeBlocks: Preserve
1515
...

controller_interface/include/controller_interface/chainable_controller_interface.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class ChainableControllerInterface : public ControllerInterfaceBase
4141
virtual ~ChainableControllerInterface() = default;
4242

4343
/**
44-
* Control step update. Command interfaces are updated based on on reference inputs and current states.
44+
* Control step update. Command interfaces are updated based on on reference inputs and current
45+
* states.
4546
* **The method called in the (real-time) control loop.**
4647
*
4748
* \param[in] time The time at the start of this control loop iteration
@@ -83,7 +84,9 @@ class ChainableControllerInterface : public ControllerInterfaceBase
8384
*
8485
* \param[in] flag marking a switch to or from chained mode.
8586
*
86-
* \returns true if controller successfully switched between "chained" and "external" mode. \default returns true so the method don't have to be overridden if controller can always switch chained mode.
87+
* \returns true if controller successfully switched between "chained" and "external" mode.
88+
* \default returns true so the method don't have to be overridden if controller can always switch
89+
* chained mode.
8790
*/
8891
virtual bool on_set_chained_mode(bool chained_mode);
8992

controller_interface/include/controller_interface/controller_interface_base.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,13 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
7474

7575
/// Get configuration for controller's required command interfaces.
7676
/**
77-
* Method used by the controller_manager to get the set of command interfaces used by the controller.
78-
* Each controller can use individual method to determine interface names that in simples case
79-
* have the following format: `<joint>/<interface>`.
80-
* The method is called only in `inactive` or `active` state, i.e., `on_configure` has to be
81-
* called first.
82-
* The configuration is used to check if controller can be activated and to claim interfaces from
83-
* hardware.
84-
* The claimed interfaces are populated in the
85-
* \ref ControllerInterfaceBase::command_interfaces_ "command_interfaces_" member.
77+
* Method used by the controller_manager to get the set of command interfaces used by the
78+
* controller. Each controller can use individual method to determine interface names that in
79+
* simples case have the following format: `<joint>/<interface>`. The method is called only in
80+
* `inactive` or `active` state, i.e., `on_configure` has to be called first. The configuration is
81+
* used to check if controller can be activated and to claim interfaces from hardware. The claimed
82+
* interfaces are populated in the \ref ControllerInterfaceBase::command_interfaces_
83+
* "command_interfaces_" member.
8684
*
8785
* \returns configuration of command interfaces.
8886
*/
@@ -131,7 +129,8 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
131129
virtual CallbackReturn on_init() = 0;
132130

133131
/**
134-
* Control step update. Command interfaces are updated based on on reference inputs and current states.
132+
* Control step update. Command interfaces are updated based on on reference inputs and current
133+
* states.
135134
* **The method called in the (real-time) control loop.**
136135
*
137136
* \param[in] time The time at the start of this control loop iteration

controller_interface/include/controller_interface/helpers.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ namespace controller_interface
2323
{
2424
/// Reorder interfaces with references according to joint names or full interface names.
2525
/**
26-
* Method to reorder and check if all expected interfaces are provided for the joint.
27-
* Fill `ordered_interfaces` with references from `unordered_interfaces` in the same order as in
28-
* `ordered_names`.
29-
*
30-
* \param[in] unordered_interfaces vector with loaned unordered state or command interfaces.
31-
* \param[in] ordered_names vector with ordered names to order \p unordered_interfaces.
32-
* The valued inputs are list of joint names or interface full names.
33-
* If joint names are used for ordering, \p interface_type specifies valid interface.
34-
* If full interface names are used for ordering, \p interface_type should be empty string ("").
35-
* \param[in] interface_type used for ordering interfaces with respect to joint names.
36-
* \param[out] ordered_interfaces vector with ordered interfaces.
37-
* \return true if all interfaces or joints in \p ordered_names are found, otherwise false.
38-
*/
26+
* Method to reorder and check if all expected interfaces are provided for the joint.
27+
* Fill `ordered_interfaces` with references from `unordered_interfaces` in the same order as in
28+
* `ordered_names`.
29+
*
30+
* \param[in] unordered_interfaces vector with loaned unordered state or command interfaces.
31+
* \param[in] ordered_names vector with ordered names to order \p unordered_interfaces.
32+
* The valued inputs are list of joint names or interface full names.
33+
* If joint names are used for ordering, \p interface_type specifies valid interface.
34+
* If full interface names are used for ordering, \p interface_type should be empty string ("").
35+
* \param[in] interface_type used for ordering interfaces with respect to joint names.
36+
* \param[out] ordered_interfaces vector with ordered interfaces.
37+
* \return true if all interfaces or joints in \p ordered_names are found, otherwise false.
38+
*/
3939
template <typename T>
4040
bool get_ordered_interfaces(
4141
std::vector<T> & unordered_interfaces, const std::vector<std::string> & ordered_names,

controller_manager/include/controller_manager/controller_manager.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ class ControllerManager : public rclcpp::Node
318318
const std::string & command_interface);
319319

320320
/**
321-
* Clear request lists used when switching controllers. The lists are shared between "callback" and
322-
* "control loop" threads.
321+
* Clear request lists used when switching controllers. The lists are shared between "callback"
322+
* and "control loop" threads.
323323
*/
324324
void clear_requests();
325325

@@ -428,23 +428,26 @@ class ControllerManager : public rclcpp::Node
428428
* lists match and returns a reference to it
429429
* This referenced list can be modified safely until switch_updated_controller_list()
430430
* is called, at this point the RT thread may start using it at any time
431-
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by rt list
431+
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by
432+
* rt list
432433
*/
433434
std::vector<ControllerSpec> & get_unused_list(
434435
const std::lock_guard<std::recursive_mutex> & guard);
435436

436437
/// get_updated_list Returns a const reference to the most updated list.
437438
/**
438439
* \warning May or may not being used by the realtime thread, read-only reference for safety
439-
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by rt list
440+
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by
441+
* rt list
440442
*/
441443
const std::vector<ControllerSpec> & get_updated_list(
442444
const std::lock_guard<std::recursive_mutex> & guard) const;
443445

444446
/**
445447
* switch_updated_list Switches the "updated" and "outdated" lists, and waits
446448
* until the RT thread is using the new "updated" list.
447-
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by rt list
449+
* \param[in] guard Guard needed to make sure the caller is the only one accessing the unused by
450+
* rt list
448451
*/
449452
void switch_updated_list(const std::lock_guard<std::recursive_mutex> & guard);
450453

hardware_interface/include/hardware_interface/actuator_interface.hpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ namespace hardware_interface
3535
/**
3636
* The typical examples are conveyors or motors.
3737
*
38-
* Methods return values have type rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
39-
* with the following meaning:
38+
* Methods return values have type
39+
* rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn with the following
40+
* meaning:
4041
*
4142
* \returns CallbackReturn::SUCCESS method execution was successful.
4243
* \returns CallbackReturn::FAILURE method execution has failed and and can be called again.
@@ -46,7 +47,8 @@ namespace hardware_interface
4647
* The hardware ends after each method in a state with the following meaning:
4748
*
4849
* UNCONFIGURED (on_init, on_cleanup):
49-
* Hardware is initialized but communication is not started and therefore no interface is available.
50+
* Hardware is initialized but communication is not started and therefore no interface is
51+
* available.
5052
*
5153
* INACTIVE (on_configure, on_deactivate):
5254
* Communication with the hardware is started and it is configured.
@@ -126,12 +128,12 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
126128
*
127129
* \note This is a non-realtime evaluation of whether a set of command interface claims are
128130
* possible, and call to start preparing data structures for the upcoming switch that will occur.
129-
* \note All starting and stopping interface keys are passed to all components, so the function should
130-
* return return_type::OK by default when given interface keys not relevant for this component.
131-
* \param[in] start_interfaces vector of string identifiers for the command interfaces starting.
132-
* \param[in] stop_interfaces vector of string identifiers for the command interfacs stopping.
133-
* \return return_type::OK if the new command interface combination can be prepared,
134-
* or if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
131+
* \note All starting and stopping interface keys are passed to all components, so the function
132+
* should return return_type::OK by default when given interface keys not relevant for this
133+
* component. \param[in] start_interfaces vector of string identifiers for the command interfaces
134+
* starting. \param[in] stop_interfaces vector of string identifiers for the command interfacs
135+
* stopping. \return return_type::OK if the new command interface combination can be prepared, or
136+
* if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
135137
*/
136138
virtual return_type prepare_command_mode_switch(
137139
const std::vector<std::string> & /*start_interfaces*/,
@@ -145,11 +147,11 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
145147
* Perform the mode-switching for the new command interface combination.
146148
*
147149
* \note This is part of the realtime update loop, and should be fast.
148-
* \note All starting and stopping interface keys are passed to all components, so the function should
149-
* return return_type::OK by default when given interface keys not relevant for this component.
150-
* \param[in] start_interfaces vector of string identifiers for the command interfaces starting.
151-
* \param[in] stop_interfaces vector of string identifiers for the command interfacs stopping.
152-
* \return return_type::OK if the new command interface combination can be switched to,
150+
* \note All starting and stopping interface keys are passed to all components, so the function
151+
* should return return_type::OK by default when given interface keys not relevant for this
152+
* component. \param[in] start_interfaces vector of string identifiers for the command interfaces
153+
* starting. \param[in] stop_interfaces vector of string identifiers for the command interfacs
154+
* stopping. \return return_type::OK if the new command interface combination can be switched to,
153155
* or if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
154156
*/
155157
virtual return_type perform_command_mode_switch(

hardware_interface/include/hardware_interface/component_parser.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ namespace hardware_interface
2626
{
2727
/// Search XML snippet from URDF for information about a control component.
2828
/**
29-
* \param[in] urdf string with robot's URDF
30-
* \return vector filled with information about robot's control resources
31-
* \throws std::runtime_error if a robot attribute or tag is not found
32-
*/
29+
* \param[in] urdf string with robot's URDF
30+
* \return vector filled with information about robot's control resources
31+
* \throws std::runtime_error if a robot attribute or tag is not found
32+
*/
3333
HARDWARE_INTERFACE_PUBLIC
3434
std::vector<HardwareInfo> parse_control_resources_from_urdf(const std::string & urdf);
3535

hardware_interface/include/hardware_interface/resource_manager.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ class HARDWARE_INTERFACE_PUBLIC ResourceManager
188188
/**
189189
* Return list of cached controller names that use the hardware with name \p hardware_name.
190190
*
191-
* \param[in] hardware_name the name of the hardware for which cached controllers should be returned.
192-
* \returns list of cached controller names that depend on hardware with name \p hardware_name.
191+
* \param[in] hardware_name the name of the hardware for which cached controllers should be
192+
* returned. \returns list of cached controller names that depend on hardware with name \p
193+
* hardware_name.
193194
*/
194195
std::vector<std::string> get_cached_controllers_to_hardware(const std::string & hardware_name);
195196

hardware_interface/include/hardware_interface/sensor_interface.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ namespace hardware_interface
3535
/**
3636
* The typical examples are Force-Torque Sensor (FTS), Interial Measurement Unit (IMU).
3737
*
38-
* Methods return values have type rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
39-
* with the following meaning:
38+
* Methods return values have type
39+
* rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn with the following
40+
* meaning:
4041
*
4142
* \returns CallbackReturn::SUCCESS method execution was successful.
4243
* \returns CallbackReturn::FAILURE method execution has failed and and can be called again.
@@ -46,7 +47,8 @@ namespace hardware_interface
4647
* The hardware ends after each method in a state with the following meaning:
4748
*
4849
* UNCONFIGURED (on_init, on_cleanup):
49-
* Hardware is initialized but communication is not started and therefore no interface is available.
50+
* Hardware is initialized but communication is not started and therefore no interface is
51+
* available.
5052
*
5153
* INACTIVE (on_configure, on_deactivate):
5254
* Communication with the hardware is started and it is configured.

hardware_interface/include/hardware_interface/system_interface.hpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ namespace hardware_interface
3636
* The common examples for these types of hardware are multi-joint systems with or without sensors
3737
* such as industrial or humanoid robots.
3838
*
39-
* Methods return values have type rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
40-
* with the following meaning:
39+
* Methods return values have type
40+
* rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn with the following
41+
* meaning:
4142
*
4243
* \returns CallbackReturn::SUCCESS method execution was successful.
4344
* \returns CallbackReturn::FAILURE method execution has failed and and can be called again.
@@ -47,7 +48,8 @@ namespace hardware_interface
4748
* The hardware ends after each method in a state with the following meaning:
4849
*
4950
* UNCONFIGURED (on_init, on_cleanup):
50-
* Hardware is initialized but communication is not started and therefore no interface is available.
51+
* Hardware is initialized but communication is not started and therefore no interface is
52+
* available.
5153
*
5254
* INACTIVE (on_configure, on_deactivate):
5355
* Communication with the hardware is started and it is configured.
@@ -127,12 +129,12 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
127129
*
128130
* \note This is a non-realtime evaluation of whether a set of command interface claims are
129131
* possible, and call to start preparing data structures for the upcoming switch that will occur.
130-
* \note All starting and stopping interface keys are passed to all components, so the function should
131-
* return return_type::OK by default when given interface keys not relevant for this component.
132-
* \param[in] start_interfaces vector of string identifiers for the command interfaces starting.
133-
* \param[in] stop_interfaces vector of string identifiers for the command interfacs stopping.
134-
* \return return_type::OK if the new command interface combination can be prepared,
135-
* or if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
132+
* \note All starting and stopping interface keys are passed to all components, so the function
133+
* should return return_type::OK by default when given interface keys not relevant for this
134+
* component. \param[in] start_interfaces vector of string identifiers for the command interfaces
135+
* starting. \param[in] stop_interfaces vector of string identifiers for the command interfacs
136+
* stopping. \return return_type::OK if the new command interface combination can be prepared, or
137+
* if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
136138
*/
137139
virtual return_type prepare_command_mode_switch(
138140
const std::vector<std::string> & /*start_interfaces*/,
@@ -146,11 +148,11 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
146148
* Perform the mode-switching for the new command interface combination.
147149
*
148150
* \note This is part of the realtime update loop, and should be fast.
149-
* \note All starting and stopping interface keys are passed to all components, so the function should
150-
* return return_type::OK by default when given interface keys not relevant for this component.
151-
* \param[in] start_interfaces vector of string identifiers for the command interfaces starting.
152-
* \param[in] stop_interfaces vector of string identifiers for the command interfacs stopping.
153-
* \return return_type::OK if the new command interface combination can be switched to,
151+
* \note All starting and stopping interface keys are passed to all components, so the function
152+
* should return return_type::OK by default when given interface keys not relevant for this
153+
* component. \param[in] start_interfaces vector of string identifiers for the command interfaces
154+
* starting. \param[in] stop_interfaces vector of string identifiers for the command interfacs
155+
* stopping. \return return_type::OK if the new command interface combination can be switched to,
154156
* or if the interface key is not relevant to this system. Returns return_type::ERROR otherwise.
155157
*/
156158
virtual return_type perform_command_mode_switch(

0 commit comments

Comments
 (0)