Skip to content

Commit e09d4f5

Browse files
committed
This is a cleanup of our current CI jobs. Particularly, this chages: - Push event triggers only for master branch - Updated clang-format - Removed iron workflow - Improved running ICI in ACT - Enabled clang-tidy in ICI
1 parent e968196 commit e09d4f5

20 files changed

+270
-265
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Integration tests
2-
on: [push, pull_request]
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
38

49
jobs:
510
build:

.github/workflows/industrial-ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: ROS industrial ci
2-
on: [push, pull_request]
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
38

49
jobs:
510
industrial_ci:
@@ -11,7 +16,6 @@ jobs:
1116
ROS_DISTRO:
1217
- {NAME: noetic, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS_Driver#master https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.noetic.rosinstall"}
1318
- {NAME: humble, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#humble"}
14-
- {NAME: iron, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#iron"}
1519
- {NAME: jazzy, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"}
1620
- {NAME: rolling, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"}
1721
ROS_REPO:
@@ -22,6 +26,7 @@ jobs:
2226
steps:
2327
- uses: actions/checkout@v4
2428
- run: docker network create --subnet=192.168.56.0/24 ursim_net
29+
if: ${{ !env.ACT }}
2530
- uses: 'ros-industrial/industrial_ci@master'
2631
env:
2732
IMMEDIATE_TEST_OUTPUT: true
@@ -30,3 +35,4 @@ jobs:
3035
DOWNSTREAM_WORKSPACE: ${{matrix.ROS_DISTRO.DOWNSTREAM_WORKSPACE}}
3136
ROS_DISTRO: ${{matrix.ROS_DISTRO.NAME}}
3237
ROS_REPO: ${{matrix.ROS_REPO}}
38+
CLANG_TIDY: true

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99
push:
1010
branches:
11-
- main
11+
- master
1212

1313
jobs:
1414
pre-commit:
@@ -19,8 +19,6 @@ jobs:
1919
- uses: actions/setup-python@v5
2020
with:
2121
python-version: 3.10.4
22-
- name: Install system hooks
23-
run: sudo apt-get install clang-format-14 cppcheck
2422
- uses: pre-commit/[email protected]
2523
with:
2624
extra_args: --all-files --hook-stage manual

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-clang-format
3-
rev: 'v14.0.6'
3+
rev: 'v19.1.5'
44
hooks:
55
- id: clang-format
66
- repo: https://github.com/DavidAnson/markdownlint-cli2

examples/force_mode_example.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const std::string CALIBRATION_CHECKSUM = "calib_12788084448423163542";
5555
std::unique_ptr<UrDriver> g_my_driver;
5656
std::unique_ptr<DashboardClient> g_my_dashboard;
5757

58-
std::condition_variable g_program_running_cv_;
59-
std::mutex g_program_running_mutex_;
58+
std::condition_variable g_program_running_cv;
59+
std::mutex g_program_running_mutex;
6060
bool g_program_running;
6161

6262
// We need a callback function to register. See UrDriver's parameters for details.
@@ -66,9 +66,9 @@ void handleRobotProgramState(bool program_running)
6666
std::cout << "\033[1;32mProgram running: " << std::boolalpha << program_running << "\033[0m\n" << std::endl;
6767
if (program_running)
6868
{
69-
std::lock_guard<std::mutex> lk(g_program_running_mutex_);
69+
std::lock_guard<std::mutex> lk(g_program_running_mutex);
7070
g_program_running = program_running;
71-
g_program_running_cv_.notify_one();
71+
g_program_running_cv.notify_one();
7272
}
7373
}
7474

@@ -84,8 +84,8 @@ void sendFreedriveMessageOrDie(const control::FreedriveControlMessage freedrive_
8484

8585
bool waitForProgramRunning(int milliseconds = 100)
8686
{
87-
std::unique_lock<std::mutex> lk(g_program_running_mutex_);
88-
if (g_program_running_cv_.wait_for(lk, std::chrono::milliseconds(milliseconds)) == std::cv_status::no_timeout ||
87+
std::unique_lock<std::mutex> lk(g_program_running_mutex);
88+
if (g_program_running_cv.wait_for(lk, std::chrono::milliseconds(milliseconds)) == std::cv_status::no_timeout ||
8989
g_program_running == true)
9090
{
9191
return true;
@@ -149,8 +149,8 @@ int main(int argc, char* argv[])
149149

150150
// Now the robot is ready to receive a program
151151
std::unique_ptr<ToolCommSetup> tool_comm_setup;
152-
const bool HEADLESS = true;
153-
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, HEADLESS,
152+
const bool headless = true;
153+
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, headless,
154154
std::move(tool_comm_setup)));
155155

156156
if (!g_my_driver->checkCalibration(CALIBRATION_CHECKSUM))

examples/freedrive_example.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ int main(int argc, char* argv[])
128128

129129
// Now the robot is ready to receive a program
130130
std::unique_ptr<ToolCommSetup> tool_comm_setup;
131-
const bool HEADLESS = true;
132-
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, HEADLESS,
131+
const bool headless = true;
132+
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, headless,
133133
std::move(tool_comm_setup), CALIBRATION_CHECKSUM));
134134

135135
// Once RTDE communication is started, we have to make sure to read from the interface buffer, as

examples/full_driver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ int main(int argc, char* argv[])
107107
// Now the robot is ready to receive a program
108108

109109
std::unique_ptr<ToolCommSetup> tool_comm_setup;
110-
const bool HEADLESS = true;
111-
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, HEADLESS,
110+
const bool headless = true;
111+
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, headless,
112112
std::move(tool_comm_setup), CALIBRATION_CHECKSUM));
113113

114114
// Once RTDE communication is started, we have to make sure to read from the interface buffer, as

examples/primary_pipeline_calibration.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using namespace urcl;
2626
class CalibrationConsumer : public urcl::comm::IConsumer<urcl::primary_interface::PrimaryPackage>
2727
{
2828
public:
29-
CalibrationConsumer() : calibrated_(0), have_received_data(false)
29+
CalibrationConsumer() : calibrated_(0), have_received_data_(false)
3030
{
3131
}
3232
virtual ~CalibrationConsumer() = default;
@@ -38,25 +38,25 @@ class CalibrationConsumer : public urcl::comm::IConsumer<urcl::primary_interface
3838
{
3939
URCL_LOG_INFO("%s", product->toString().c_str());
4040
calibrated_ = kin_info->calibration_status_;
41-
have_received_data = true;
41+
have_received_data_ = true;
4242
}
4343
return true;
4444
}
4545

4646
bool isCalibrated() const
4747
{
48-
const uint32_t LINEARIZED = 2;
49-
return calibrated_ == LINEARIZED;
48+
const uint32_t linearized = 2;
49+
return calibrated_ == linearized;
5050
}
5151

5252
bool calibrationStatusReceived()
5353
{
54-
return have_received_data;
54+
return have_received_data_;
5555
}
5656

5757
private:
5858
uint32_t calibrated_;
59-
bool have_received_data;
59+
bool have_received_data_;
6060
};
6161

6262
// In a real-world example it would be better to get those values from command line parameters / a better configuration

examples/rtde_client.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ int main(int argc, char* argv[])
7070
// loop.
7171
my_client.start();
7272

73-
unsigned long startTime = clock();
74-
while (second_to_run < 0 || ((clock() - startTime) / CLOCKS_PER_SEC) < static_cast<unsigned int>(second_to_run))
73+
unsigned long start_time = clock();
74+
while (second_to_run < 0 || ((clock() - start_time) / CLOCKS_PER_SEC) < static_cast<unsigned int>(second_to_run))
7575
{
7676
// Read latest RTDE package. This will block for READ_TIMEOUT, so the
7777
// robot will effectively be in charge of setting the frequency of this loop unless RTDE
@@ -93,9 +93,7 @@ int main(int argc, char* argv[])
9393
{
9494
// This will happen for example, when the required keys are not configured inside the input
9595
// recipe.
96-
std::cout << "\033[1;31mSending RTDE data failed."
97-
<< "\033[0m\n"
98-
<< std::endl;
96+
std::cout << "\033[1;31mSending RTDE data failed." << "\033[0m\n" << std::endl;
9997
return 1;
10098
}
10199

examples/spline_example.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ std::unique_ptr<UrDriver> g_my_driver;
5252
std::unique_ptr<DashboardClient> g_my_dashboard;
5353
vector6d_t g_joint_positions;
5454

55-
void SendTrajectory(const std::vector<vector6d_t>& p_p, const std::vector<vector6d_t>& p_v,
55+
void sendTrajectory(const std::vector<vector6d_t>& p_p, const std::vector<vector6d_t>& p_v,
5656
const std::vector<vector6d_t>& p_a, const std::vector<double>& time, bool use_spline_interpolation_)
5757
{
5858
assert(p_p.size() == time.size());
@@ -146,8 +146,8 @@ int main(int argc, char* argv[])
146146
}
147147

148148
// if the robot is not powered on and ready
149-
std::string robotModeRunning("RUNNING");
150-
while (!g_my_dashboard->commandRobotMode(robotModeRunning))
149+
std::string robot_mode_running("RUNNING");
150+
while (!g_my_dashboard->commandRobotMode(robot_mode_running))
151151
{
152152
// Power it off
153153
if (!g_my_dashboard->commandPowerOff())
@@ -174,8 +174,8 @@ int main(int argc, char* argv[])
174174
// Now the robot is ready to receive a program
175175

176176
std::unique_ptr<ToolCommSetup> tool_comm_setup;
177-
const bool HEADLESS = true;
178-
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, HEADLESS,
177+
const bool headless = true;
178+
g_my_driver.reset(new UrDriver(robot_ip, SCRIPT_FILE, OUTPUT_RECIPE, INPUT_RECIPE, &handleRobotProgramState, headless,
179179
std::move(tool_comm_setup), CALIBRATION_CHECKSUM));
180180

181181
g_my_driver->registerTrajectoryDoneCallback(&handleTrajectoryState);
@@ -241,7 +241,7 @@ int main(int argc, char* argv[])
241241
}
242242

243243
// CUBIC
244-
SendTrajectory(p, v, std::vector<vector6d_t>(), time, true);
244+
sendTrajectory(p, v, std::vector<vector6d_t>(), time, true);
245245

246246
g_trajectory_running = true;
247247
while (g_trajectory_running)
@@ -272,7 +272,7 @@ int main(int argc, char* argv[])
272272
URCL_LOG_INFO("CUBIC Movement done");
273273

274274
// QUINTIC
275-
SendTrajectory(p, v, a, time, true);
275+
sendTrajectory(p, v, a, time, true);
276276

277277
g_trajectory_running = true;
278278
while (g_trajectory_running)

0 commit comments

Comments
 (0)