Skip to content

Commit 93b0933

Browse files
Lint
1 parent 8ba4d1b commit 93b0933

File tree

8 files changed

+50
-49
lines changed

8 files changed

+50
-49
lines changed

include/ur_client_library/primary/robot_message.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RobotMessage : public PrimaryPackage
6666
RobotMessage(const uint64_t timestamp, const uint8_t source) : timestamp_(timestamp), source_(source)
6767
{
6868
}
69-
/*!
69+
/*!
7070
* \brief Creates a new RobotMessage object to be filled from a package.
7171
*
7272
* \param timestamp Timestamp of the package

include/ur_client_library/primary/robot_message/error_code_message.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Below code is copied from a branch on the Universal_Robot_Client_Library
2-
// with some modification. Link to branch:
2+
// with some modification. Link to branch:
33
// https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/improve_primary_interface
4-
//
4+
//
55
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
66

77
// -- BEGIN LICENSE BLOCK ----------------------------------------------
@@ -52,15 +52,15 @@ enum class ReportLevel : int32_t
5252
DEVL_FAULT = 132
5353
};
5454

55-
struct ErrorCode
55+
struct ErrorCode
5656
{
57-
int32_t message_code{-1};
58-
int32_t message_argument{-1};
59-
ReportLevel report_level{ReportLevel::DEBUG};
60-
uint32_t data_type{0};
61-
uint32_t data{0};
57+
int32_t message_code{ -1 };
58+
int32_t message_argument{ -1 };
59+
ReportLevel report_level{ ReportLevel::DEBUG };
60+
uint32_t data_type{ 0 };
61+
uint32_t data{ 0 };
6262
std::string text;
63-
uint64_t timestamp{0};
63+
uint64_t timestamp{ 0 };
6464
std::string to_string;
6565
};
6666

@@ -112,7 +112,7 @@ class ErrorCodeMessage : public RobotMessage
112112
int32_t message_code_;
113113
int32_t message_argument_;
114114
ReportLevel report_level_;
115-
uint8_t data_type_;
115+
uint32_t data_type_;
116116
uint32_t data_;
117117
std::string text_;
118118
};

include/ur_client_library/ur/error_code_client.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ namespace urcl
1010
{
1111
class ErrorCodeClient
1212
{
13-
public:
13+
public:
1414
ErrorCodeClient() = delete;
15-
ErrorCodeClient(comm::URStream<primary_interface::PrimaryPackage>& stream, comm::INotifier& notifier,
16-
primary_interface::PrimaryParser& parser);
15+
ErrorCodeClient(comm::URStream<primary_interface::PrimaryPackage>& stream, comm::INotifier& notifier,
16+
primary_interface::PrimaryParser& parser);
1717
~ErrorCodeClient();
1818

19-
void start();
19+
void start();
2020

21-
std::deque<urcl::primary_interface::ErrorCode> getErrorCodes();
21+
std::deque<urcl::primary_interface::ErrorCode> getErrorCodes();
2222

2323
private:
2424
comm::URStream<primary_interface::PrimaryPackage>& stream_;
@@ -27,4 +27,4 @@ std::deque<urcl::primary_interface::ErrorCode> getErrorCodes();
2727
comm::URProducer<primary_interface::PrimaryPackage> prod_;
2828
comm::Pipeline<primary_interface::PrimaryPackage> pipeline_;
2929
};
30-
}
30+
} // namespace urcl

include/ur_client_library/ur/error_code_reader.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace urcl
1111
{
1212
/*!
1313
* \brief The ErrorCodeReader class consumes primary packages ignoring all but RobotCommMessage
14-
* packages to retrieve the latest code reported by the robot.
14+
* packages to retrieve the latest code reported by the robot.
1515
*/
1616
class ErrorCodeReader : public comm::IConsumer<primary_interface::PrimaryPackage>
1717
{
@@ -53,15 +53,15 @@ class ErrorCodeReader : public comm::IConsumer<primary_interface::PrimaryPackage
5353
virtual bool consume(std::shared_ptr<primary_interface::PrimaryPackage> product);
5454

5555
/*!
56-
* \brief Retrieves a list of error codes from the queue if there are any.
57-
*
58-
* \return A list of error codes
59-
*/
56+
* \brief Retrieves a list of error codes from the queue if there are any.
57+
*
58+
* \return A list of error codes
59+
*/
6060
std::deque<primary_interface::ErrorCode> getErrorCodesFromQueue();
61+
6162
private:
6263
std::deque<primary_interface::ErrorCode> queue_;
6364
std::mutex queue_mutex_;
64-
6565
};
6666
} // namespace urcl
6767

include/ur_client_library/ur/ur_driver.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@ class UrDriver
536536
bool checkCalibration(const std::string& checksum);
537537

538538
/*!
539-
* \brief Retrieves error codes ErrorCodeClient.
540-
*
541-
* \returns list of error codes
542-
*
543-
*/
539+
* \brief Retrieves error codes ErrorCodeClient.
540+
*
541+
* \returns list of error codes
542+
*
543+
*/
544544
std::deque<urcl::primary_interface::ErrorCode> getErrorCodes();
545545

546546
/*!
@@ -657,11 +657,10 @@ class UrDriver
657657
double target_frequency = 0.0, bool ignore_unavailable_outputs = false);
658658

659659
/*!
660-
* \brief Starts the error code client
661-
*/
660+
* \brief Starts the error code client
661+
*/
662662
void startErrorCodeClientCommunication();
663663

664-
665664
private:
666665
static std::string readScriptFile(const std::string& filename);
667666
/*!

src/primary/robot_message/error_code_message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Below code is copied from a branch on the Universal_Robot_Client_Library
22
// with some modification. Link to branch:
33
// https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/improve_primary_interface
4-
//
4+
//
55
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
66

77
// -- BEGIN LICENSE BLOCK ----------------------------------------------

src/ur/error_code_client.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
namespace urcl
66
{
7-
ErrorCodeClient::ErrorCodeClient(comm::URStream<primary_interface::PrimaryPackage>& stream, comm::INotifier& notifier,
8-
primary_interface::PrimaryParser& parser)
9-
: stream_(stream)
10-
, parser_(parser)
11-
, prod_(stream_, parser_)
12-
, pipeline_(prod_, &consumer_, "ErrorCodeClient Pipeline", notifier)
7+
ErrorCodeClient::ErrorCodeClient(comm::URStream<primary_interface::PrimaryPackage>& stream, comm::INotifier& notifier,
8+
primary_interface::PrimaryParser& parser)
9+
: stream_(stream)
10+
, parser_(parser)
11+
, prod_(stream_, parser_)
12+
, pipeline_(prod_, &consumer_, "ErrorCodeClient Pipeline", notifier)
1313
{
1414
}
1515

1616
ErrorCodeClient::~ErrorCodeClient()
1717
{
18-
URCL_LOG_INFO("Stopping error code client pipeline");
19-
pipeline_.stop();
18+
URCL_LOG_INFO("Stopping error code client pipeline");
19+
pipeline_.stop();
2020
}
2121

2222
void ErrorCodeClient::start()
2323
{
24-
URCL_LOG_INFO("Starting error code client pipeline");
25-
pipeline_.run();
24+
URCL_LOG_INFO("Starting error code client pipeline");
25+
pipeline_.run();
2626
}
2727

2828
std::deque<urcl::primary_interface::ErrorCode> ErrorCodeClient::getErrorCodes()
2929
{
30-
return consumer_.getErrorCodesFromQueue();
31-
}
30+
return consumer_.getErrorCodesFromQueue();
3231
}
32+
} // namespace urcl

src/ur/error_code_reader.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ bool ErrorCodeReader::consume(std::shared_ptr<primary_interface::PrimaryPackage>
1717
code.timestamp = error_code_message->timestamp_;
1818
code.to_string = error_code_message->toString();
1919

20-
const auto logContents = "Logging an ErrorCodeMessage from the UR Controller Box: " + error_code_message->toString();
20+
const auto logContents =
21+
"Logging an ErrorCodeMessage from the UR Controller Box: " + error_code_message->toString();
2122

22-
switch(code.report_level) {
23+
switch (code.report_level)
24+
{
2325
case urcl::primary_interface::ReportLevel::DEBUG:
2426
case urcl::primary_interface::ReportLevel::DEVL_DEBUG:
2527
case urcl::primary_interface::ReportLevel::DEVL_INFO:
@@ -35,8 +37,8 @@ bool ErrorCodeReader::consume(std::shared_ptr<primary_interface::PrimaryPackage>
3537
URCL_LOG_WARN(logContents.c_str());
3638
break;
3739
default:
38-
//urcl::primary_interface::ReportLevel::VIOLATION:
39-
//urcl::primary_interface::ReportLevel::FAULT:
40+
// urcl::primary_interface::ReportLevel::VIOLATION:
41+
// urcl::primary_interface::ReportLevel::FAULT:
4042
URCL_LOG_ERROR(logContents.c_str());
4143
break;
4244
}
@@ -47,7 +49,7 @@ bool ErrorCodeReader::consume(std::shared_ptr<primary_interface::PrimaryPackage>
4749
return true;
4850
}
4951

50-
std::deque<primary_interface::ErrorCode> ErrorCodeReader::getErrorCodesFromQueue()
52+
std::deque<primary_interface::ErrorCode> ErrorCodeReader::getErrorCodesFromQueue()
5153
{
5254
std::lock_guard<std::mutex> lock_guard(queue_mutex_);
5355
std::deque<primary_interface::ErrorCode> error_codes;

0 commit comments

Comments
 (0)