Skip to content

Commit fa093f1

Browse files
committed
FIX: precommit formatting
1 parent 1f41ebf commit fa093f1

File tree

5 files changed

+53
-42
lines changed

5 files changed

+53
-42
lines changed

robotiq_hande_driver/include/application.hpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef APPLICATION_H_
2+
#define APPLICATION_H_
3+
14
#include <stdint.h>
25

36
#include "protocol_logic.hpp"
@@ -32,7 +35,7 @@ class ApplicationLayer{
3235

3336
/**
3437
* @brief Stops movement of the gripper
35-
*
38+
*
3639
* @param none
3740
* @return none
3841
* @note see status on success, exception thrown if communicatoin issues
@@ -41,7 +44,7 @@ class ApplicationLayer{
4144

4245
/**
4346
* @brief Resets the gripper: deactivate and activate again
44-
*
47+
*
4548
* @param none
4649
* @return none
4750
* @note see status on success, exception thrown if communicatoin issues
@@ -50,16 +53,16 @@ class ApplicationLayer{
5053

5154
/**
5255
* Emergency auto-release, gripper fingers are slowly opened, reactivation necessary
53-
*
56+
*
5457
* @param none
5558
* @return none
5659
* @note see status on success, exception thrown if communicatoin issues
5760
*/
5861
void AutoRelease();
5962

6063
/**
61-
* @brief Activates the gripper, after that it can be used
62-
*
64+
* @brief Activates the gripper, after that it can be used
65+
*
6366
* @param none
6467
* @return none
6568
* @note see status on success, exception thrown if communicatoin issues
@@ -68,7 +71,7 @@ class ApplicationLayer{
6871

6972
/**
7073
* @brief Opens the gripper
71-
*
74+
*
7275
* @param none
7376
* @return none
7477
* @note see status on success, exception thrown if communicatoin issues
@@ -77,7 +80,7 @@ class ApplicationLayer{
7780

7881
/**
7982
* @brief Closes the gripper
80-
*
83+
*
8184
* @param none
8285
* @return none
8386
* @note see status on success, exception thrown if communicatoin issues
@@ -86,25 +89,25 @@ class ApplicationLayer{
8689

8790
/**
8891
* @brief Returns the gripper status
89-
*
92+
*
9093
* @param none
9194
* @return Gripper status
9295
* @note see status on success, exception thrown if communicatoin issues
9396
*/
94-
Status GetStatus();
97+
Status GetStatus();
9598

9699
/**
97100
* @brief Returns the gripper fault status
98-
*
101+
*
99102
* @param none
100103
* @return Fault Status
101104
* @note see status on success, exception thrown if communicatoin issues
102105
*/
103-
FaultStatus GetFaultStatus();
106+
FaultStatus GetFaultStatus();
104107

105108
/**
106109
* @brief Returns the gripper requsted position
107-
*
110+
*
108111
* @param none
109112
* @return Gripper requested position
110113
* @note see status on success, exception thrown if communicatoin issues
@@ -113,7 +116,7 @@ class ApplicationLayer{
113116

114117
/**
115118
* @brief Returns the gripper position
116-
*
119+
*
117120
* @param none
118121
* @return Gripper position in [m]
119122
* @note see status on success, exception thrown if communicatoin issues
@@ -131,9 +134,9 @@ class ApplicationLayer{
131134

132135
/**
133136
* @brief Returns the gripper current
134-
*
137+
*
135138
* @param none
136-
* @return Gripper current in [A] (range: 0-2.55A)
139+
* @return Gripper current in [A] (range: 0-2.55A)
137140
* @note see status on success, exception thrown if communicatoin issues
138141
*/
139142
double Current();
@@ -173,6 +176,7 @@ class ApplicationLayer{
173176
* Current flowin through the gripper, in [A]
174177
*/
175178
double current_;
176-
179+
177180
};
178-
} // namespace hande_driver
181+
} // namespace hande_driver
182+
#endif // APPLICATION_H_

robotiq_hande_driver/include/communication.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef COMMUNICATION_H_
2+
#define COMMUNICATION_H_
3+
14
#include <stdint.h>
25
#include <stddef.h>
36
#include <vector>
@@ -19,7 +22,7 @@ class Communication{
1922

2023
/**
2124
* @brief Connect to gripper using modbus rtu and virtual socket
22-
*
25+
*
2326
* @param none
2427
* @return none
2528
* @note see status on success, exception thrown in case of communication issues
@@ -28,7 +31,7 @@ class Communication{
2831

2932
/**
3033
* @brief Disconnect from gripper using modbus rtu and virtual socket
31-
*
34+
*
3235
* @param none
3336
* @return none
3437
* @note see status on success, exception thrown in case of communication issues
@@ -37,7 +40,7 @@ class Communication{
3740

3841
/**
3942
* @brief Read and write input.output registers at once
40-
*
43+
*
4144
* @param none
4245
* @return none
4346
* @note see status on success, exception thrown in case of communication issues
@@ -52,3 +55,4 @@ class Communication{
5255

5356
};
5457
} // namespace hande_driver
58+
#endif // COMMUNICATION_H_

robotiq_hande_driver/include/protocol_logic.hpp

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef PROTOCOL_LOGIC_H_
2+
#define PROTOCOL_LOGIC_H_
3+
14
#include <stdint.h>
25

36
#include <communication.hpp>
@@ -98,7 +101,7 @@ class ProtocolLogic{
98101

99102
/**
100103
* @brief Resets the gripper
101-
*
104+
*
102105
* @param none
103106
* @return none
104107
* @note see status on success, exception thrown if communicatoin issues
@@ -107,7 +110,7 @@ class ProtocolLogic{
107110

108111
/**
109112
* @brief Sets the gripper
110-
*
113+
*
111114
* @param none
112115
* @return none
113116
* @note see status on success, exception thrown if communicatoin issues
@@ -116,7 +119,7 @@ class ProtocolLogic{
116119

117120
/**
118121
* @brief Emergency auto-release, gripper fingers are slowly opened, reactivation necessary
119-
*
122+
*
120123
* @param none
121124
* @return none
122125
* @note see status on success, exception thrown if communicatoin issues
@@ -125,7 +128,7 @@ class ProtocolLogic{
125128

126129
/**
127130
* @brief Activates the gripper, after that it can be used
128-
*
131+
*
129132
* @param none
130133
* @return none
131134
* @note see status on success, exception thrown if communicatoin issues
@@ -134,7 +137,7 @@ class ProtocolLogic{
134137

135138
/**
136139
* @brief Moves the gripper
137-
*
140+
*
138141
* @param position requested position
139142
* @param velocity requested position
140143
* @param force requested position
@@ -145,43 +148,43 @@ class ProtocolLogic{
145148

146149
/**
147150
* @brief Stops the gripper
148-
*
151+
*
149152
* @return none
150153
* @note see status on success, exception thrown if communicatoin issues
151154
*/
152155
void Stop();
153156

154157
/**
155158
* @brief Logic for reset state
156-
*
159+
*
157160
* @return True if gripper is in reset state
158161
*/
159162
bool IsReset();
160163

161164
/**
162165
* @brief Logic for ready state
163-
*
166+
*
164167
* @return True if gripper is ready
165168
*/
166169
bool IsReady();
167170

168171
/**
169172
* @brief Logic for moving state
170-
*
173+
*
171174
* @return True if gripper is moving
172175
*/
173176
bool IsMoving();
174177

175178
/**
176179
* @brief Logic for stopped state
177-
*
180+
*
178181
* @return True if gripper is stopped
179182
*/
180183
bool IsStopped();
181184

182185
/**
183186
* @brief Logic for closed state
184-
*
187+
*
185188
* @return True if gripper is closed
186189
*/
187190
bool IsClosed();
@@ -223,14 +226,14 @@ class ProtocolLogic{
223226

224227
/**
225228
* @brief Decode modbus registers and refresh apropriate data
226-
*
229+
*
227230
* @return none
228231
*/
229232
void RefreshRegisters();
230233

231234
/**
232235
* @brief Read 8bit registers from 16bit words
233-
*
236+
*
234237
* @param reg pointer to 8bit register
235238
* @param byte 8bit register position in 16bit modbus frame
236239
* @return none
@@ -239,10 +242,10 @@ class ProtocolLogic{
239242

240243
/**
241244
* @brief Set n-th bit to x value
242-
*
245+
*
243246
* @param number
244247
* @param n n-th bit in number
245-
* @param x bool value
248+
* @param x bool value
246249
* @return uint number with n-th bit set to x
247250
*/
248251
uint BitSetTo(uint number, uint n, bool x);
@@ -274,4 +277,5 @@ class ProtocolLogic{
274277

275278
Communication communication_;
276279
};
277-
} // namespace hande_driver
280+
} // namespace hande_driver
281+
#endif // PROTOCOL_LOGIC_H_

robotiq_hande_driver/src/application.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,4 @@ void ApplicationLayer::Read(){
9797
void ApplicationLayer::Write(){
9898
protocol_logic_.RefreshRegisters();
9999
}
100-
101-
} // namespace hande_driver
100+
} // namespace hande_driver

robotiq_hande_driver/src/protocol_logic.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ void ProtocolLogic::Stop(){
9191
}
9292

9393
bool ProtocolLogic::IsReset(){
94-
return (gripper_status_ == GRIPPER_IN_RESET &&
94+
return (gripper_status_ == GRIPPER_IN_RESET &&
9595
activation_status_ == GRIPPER_RESET);
9696
}
9797

9898
bool ProtocolLogic::IsReady(){
99-
return (gripper_status_ == ACTIVATION_COMPLETE &&
99+
return (gripper_status_ == ACTIVATION_COMPLETE &&
100100
activation_status_ == GRIPPER_ACTIVATION);
101101
}
102102

@@ -147,14 +147,14 @@ void ProtocolLogic::RefreshRegisters(){
147147

148148
ReadRegister(fault_status_, kFaultStatusByte);
149149
//To bo specified
150-
150+
151151
ReadRegister(position_request_echo_, kPositionRequestEchoByte);
152152
ReadRegister(position_, kPositionByte);
153153
ReadRegister(current_, kCurrentByte);
154154
}
155155

156156
void ProtocolLogic::ReadRegister(uint8_t &reg, uint8_t byte){
157-
reg = byte % 2 == 1 ?
157+
reg = byte % 2 == 1 ?
158158
communication_.input_registers_[byte / 2] & 255u :
159159
communication_.input_registers_[byte / 2] >> 8u;
160160
}

0 commit comments

Comments
 (0)