Skip to content

Commit 3943aff

Browse files
committed
pre-commit changes
1 parent 545d28d commit 3943aff

15 files changed

+721
-582
lines changed

io_gripper_controller/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if(BUILD_TESTING)
7474
ros2_control_test_assets
7575
)
7676

77-
ament_add_gmock(test_io_gripper_controller
77+
ament_add_gmock(test_io_gripper_controller
7878
test/test_io_gripper_controller.cpp
7979
test/test_io_gripper_controller_open.cpp
8080
test/test_io_gripper_controller_close.cpp

io_gripper_controller/doc/userdoc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ io_gripper_controller:
9696
hohenabfrage:
9797
input: "EL1008/Hohenabfrage_BG5"
9898
bauteilabfrage:
99-
input: "EL1008/Bauteilabfrage_BG06"
99+
input: "EL1008/Bauteilabfrage_BG06"

io_gripper_controller/include/io_gripper_controller/io_gripper_controller.hpp

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
#ifndef GRIPPER_IO_CONTROLLER__GRIPPER_IO_CONTROLLER_HPP_
1616
#define GRIPPER_IO_CONTROLLER__GRIPPER_IO_CONTROLLER_HPP_
1717

18+
#include <atomic>
19+
#include <functional>
1820
#include <memory>
21+
#include <set>
1922
#include <string>
2023
#include <vector>
21-
#include <functional>
22-
#include <set>
23-
#include <atomic>
2424

2525
#include "controller_interface/controller_interface.hpp"
2626
#include "io_gripper_controller_parameters.hpp"
@@ -33,19 +33,20 @@
3333

3434
#include <sensor_msgs/msg/joint_state.hpp>
3535

36-
#include "control_msgs/srv/set_io_gripper_config.hpp"
37-
#include "control_msgs/msg/interface_value.hpp"
38-
#include "control_msgs/msg/dynamic_interface_values.hpp"
3936
#include "control_msgs/action/io_gripper_command.hpp"
4037
#include "control_msgs/action/set_io_gripper_config.hpp"
38+
#include "control_msgs/msg/dynamic_interface_values.hpp"
39+
#include "control_msgs/msg/interface_value.hpp"
40+
#include "control_msgs/srv/set_io_gripper_config.hpp"
4141
#include "rclcpp_action/rclcpp_action.hpp"
4242

4343
namespace io_gripper_controller
4444
{
4545

4646
/**
4747
* @enum service_mode_type
48-
* @brief Represents the various service modes of the gripper. These modes represents the high level states of the gripper.
48+
* @brief Represents the various service modes of the gripper. These modes represents the high level
49+
* states of the gripper.
4950
*
5051
* - IDLE: The gripper is in an idle state, not performing any action.
5152
* - OPEN: The gripper is in the process of opening.
@@ -63,7 +64,8 @@ enum class service_mode_type : std::uint8_t
6364
* @brief Represents the various states of the gripper.
6465
*
6566
* - IDLE: The gripper is in an idle state, not performing any action.
66-
* - SET_BEFORE_COMMAND: Executing commands for io defined in the yaml which are required before opening the gripper.
67+
* - SET_BEFORE_COMMAND: Executing commands for io defined in the yaml which are required before
68+
* opening the gripper.
6769
* - CLOSE_GRIPPER: Executing commands to close the gripper.
6870
* - CHECK_GRIPPER_STATE: Checking the state of the gripper to make sure the gripper is closed.
6971
* - OPEN_GRIPPER: Executing commands to open the gripper.
@@ -83,7 +85,8 @@ enum class gripper_state_type : std::uint8_t
8385

8486
/**
8587
* @enum reconfigure_state_type
86-
* @brief Represents the various states of the reconfiguration process, which means that the gripper is reconfiguring to new state based on the configuration defined in the yaml params.
88+
* @brief Represents the various states of the reconfiguration process, which means that the gripper
89+
* is reconfiguring to new state based on the configuration defined in the yaml params.
8790
*
8891
* - IDLE: The reconfiguration process is idle, not performing any action.
8992
* - FIND_CONFIG: Finding the configuration settings.
@@ -207,14 +210,17 @@ class IOGripperController : public controller_interface::ControllerInterface
207210
rclcpp::Service<ConfigSrvType>::SharedPtr configure_gripper_service_;
208211
rclcpp_action::Server<GripperAction>::SharedPtr gripper_action_server_;
209212
rclcpp_action::Server<GripperConfigAction>::SharedPtr gripper_config_action_server_;
210-
211-
// Realtime buffer to store the state for outer gripper_service (e.g. idel, open, close)
213+
214+
// Realtime buffer to store the state for outer gripper_service (e.g. idle, open, close)
212215
realtime_tools::RealtimeBuffer<service_mode_type> gripper_service_buffer_;
213-
// Realtime buffer to store the state for switching the gripper state (e.g. idle, set_before_command, close_gripper, check_gripper_state, open_gripper, set_after_command, halted)
216+
// Realtime buffer to store the state for switching the gripper state (e.g. idle,
217+
// set_before_command, close_gripper, check_gripper_state, open_gripper, set_after_command,
218+
// halted)
214219
realtime_tools::RealtimeBuffer<gripper_state_type> gripper_state_buffer_;
215220
// Realtime buffer to store the name of the configuration which needs to be set
216221
realtime_tools::RealtimeBuffer<std::string> configure_gripper_buffer_;
217-
// Realtime buffer to store the state for switching the reconfigure state (e.g. idle, find_config, set_command, check_state)
222+
// Realtime buffer to store the state for switching the reconfigure state (e.g. idle, find_config,
223+
// set_command, check_state)
218224
realtime_tools::RealtimeBuffer<reconfigure_state_type> reconfigure_state_buffer_;
219225

220226
using ControllerStatePublisher = realtime_tools::RealtimePublisher<JointStateMsg>;
@@ -243,15 +249,15 @@ class IOGripperController : public controller_interface::ControllerInterface
243249
* @param value The value to get.
244250
* @return True if the state was found and retrieved, false otherwise.
245251
*/
246-
bool find_and_get_state(const std::string & name, double& value);
252+
bool find_and_get_state(const std::string & name, double & value);
247253

248254
/**
249255
* @brief Finds and gets a command value.
250256
* @param name The name of the command.
251257
* @param value The value to get.
252258
* @return True if the command was found and retrieved, false otherwise.
253259
*/
254-
bool find_and_get_command(const std::string & name, double& value);
260+
bool find_and_get_command(const std::string & name, double & value);
255261

256262
/**
257263
* @brief Handles the state transition when opening the gripper.
@@ -310,7 +316,8 @@ class IOGripperController : public controller_interface::ControllerInterface
310316

311317
std::vector<std::string> configurations_list_;
312318
std::vector<io_gripper_controller::Params::ConfigurationSetup::MapConfigurations> config_map_;
313-
std::vector<io_gripper_controller::Params::SensorsInterfaces::MapGripperSpecificSensors> sensors_map_;
319+
std::vector<io_gripper_controller::Params::SensorsInterfaces::MapGripperSpecificSensors>
320+
sensors_map_;
314321
double state_value_;
315322
std::string configuration_key_;
316323
bool check_state_ios_;
@@ -325,24 +332,22 @@ class IOGripperController : public controller_interface::ControllerInterface
325332
std::shared_ptr<control_msgs::action::IOGripperCommand_Result> gripper_result_;
326333
std::shared_ptr<control_msgs::action::SetIOGripperConfig_Feedback> gripper_config_feedback_;
327334
std::shared_ptr<control_msgs::action::SetIOGripperConfig_Result> gripper_config_result_;
328-
335+
329336
/**
330337
* @brief Handles the goal for the gripper action.
331338
* @param uuid The UUID of the goal.
332339
* @param goal The goal to handle.
333340
* @return GoalResponse indicating acceptance or rejection of the goal.
334341
*/
335342
rclcpp_action::GoalResponse handle_goal(
336-
const rclcpp_action::GoalUUID & uuid,
337-
std::shared_ptr<const GripperAction::Goal> goal);
343+
const rclcpp_action::GoalUUID & uuid, std::shared_ptr<const GripperAction::Goal> goal);
338344

339345
/**
340346
* @brief Handles the cancellation of the gripper action.
341347
* @param goal_handle The handle of the goal to cancel.
342348
* @return CancelResponse indicating acceptance or rejection of the cancellation.
343349
*/
344-
rclcpp_action::CancelResponse handle_cancel(
345-
const std::shared_ptr<GoalHandleGripper> goal_handle);
350+
rclcpp_action::CancelResponse handle_cancel(const std::shared_ptr<GoalHandleGripper> goal_handle);
346351

347352
/**
348353
* @brief Handles the acceptance of the gripper action.
@@ -363,8 +368,7 @@ class IOGripperController : public controller_interface::ControllerInterface
363368
* @return GoalResponse indicating acceptance or rejection of the goal.
364369
*/
365370
rclcpp_action::GoalResponse config_handle_goal(
366-
const rclcpp_action::GoalUUID & uuid,
367-
std::shared_ptr<const GripperConfigAction::Goal> goal);
371+
const rclcpp_action::GoalUUID & uuid, std::shared_ptr<const GripperConfigAction::Goal> goal);
368372

369373
/**
370374
* @brief Handles the cancellation of the gripper configuration action.

io_gripper_controller/package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<description>gripper io controller used to control the gripper using IOs</description>
77
<author email="yara.shahin@b-robotized.com">Yara Shahin</author>
88
<author email="sachin.kumar@b-robotized.com">Sachin Kumar</author>
9-
9+
1010
<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
1111
<maintainer email="denis@stoglrobotics.de">Denis Štogl</maintainer>
1212
<maintainer email="christoph.froehlich@ait.ac.at">Christoph Froehlich</maintainer>
1313
<maintainer email="sai.kishor@pal-robotics.com">Sai Kishor Kothakota</maintainer>
14-
14+
1515
<license>Apache License 2.0</license>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>

0 commit comments

Comments
 (0)