Skip to content

Commit 179224f

Browse files
committed
Merge branch 'main' into tool_contact
2 parents bd7d050 + 7c63057 commit 179224f

20 files changed

+63
-374
lines changed

.github/workflows/coverage-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
required-ros-distributions: ${{ env.ROS_DISTRO }}
2222
use-ros2-testing: true
2323
- uses: actions/checkout@v4
24-
- uses: ros-tooling/action-ros-ci@v0.3
24+
- uses: ros-tooling/action-ros-ci@v0.4
2525
with:
2626
target-ros2-distro: ${{ env.ROS_DISTRO }}
2727
# build all packages listed in the meta package

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
args: [--py36-plus]
4040

4141
- repo: https://github.com/psf/black
42-
rev: 24.10.0
42+
rev: 25.1.0
4343
hooks:
4444
- id: black
4545
args: ["--line-length=100"]
@@ -51,7 +51,7 @@ repos:
5151
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D401,D404"]
5252

5353
- repo: https://github.com/pycqa/flake8
54-
rev: 7.1.1
54+
rev: 7.1.2
5555
hooks:
5656
- id: flake8
5757
args: ["--ignore=E501,W503"]
@@ -135,7 +135,7 @@ repos:
135135
# Spellcheck in comments and docs
136136
# skipping of *.svg files is not working...
137137
- repo: https://github.com/codespell-project/codespell
138-
rev: v2.3.0
138+
rev: v2.4.1
139139
hooks:
140140
- id: codespell
141141
args: ['--write-changes', '-L bootup,assertIn']

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ For getting started, you'll basically need three steps:
9999

100100
2. **Start & Setup the robot**. Once you've installed the driver, [setup the
101101
robot](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/robot_setup.html)
102-
and [create a program for external
103-
control](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/install_urcap_e_series.html).
102+
to be able to communicate with this driver correctly.
104103

105104
Please do this step carefully and extract the calibration as explained
106105
[here](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/robot_setup.html#extract-calibration-information).

Universal_Robots_ROS2_Driver.jazzy.repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repositories:
3434
realtime_tools:
3535
type: git
3636
url: https://github.com/ros-controls/realtime_tools.git
37-
version: master
37+
version: jazzy
3838
moveit2:
3939
type: git
4040
url: https://github.com/ros-planning/moveit2.git

ur_controllers/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This controller publishes the current actual execution speed as reported by the
3636
floating points between 0 and 1.
3737

3838
In the `ur_robot_driver
39-
<https://index.ros.org/p/ur_robot_driver/github-UniversalRobots-Universal_Robots_ROS2_Driver/>`_
39+
<https://index.ros.org/p/ur_robot_driver>`_
4040
this is calculated by multiplying the two `RTDE
4141
<https://www.universal-robots.com/articles/ur/real-time-data-exchange-rtde-guide/>`_ data
4242
fields ``speed_scaling`` (which should be equal to the value shown by the speed slider position on the

ur_controllers/src/scaled_joint_trajectory_controller.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
128128
const auto active_goal = *rt_active_goal_.readFromRT();
129129

130130
// Check if a new external message has been received from nonRT threads
131-
auto current_external_msg = traj_external_point_ptr_->get_trajectory_msg();
132-
auto new_external_msg = traj_msg_external_point_ptr_.readFromRT();
131+
auto current_external_msg = current_trajectory_->get_trajectory_msg();
132+
auto new_external_msg = new_trajectory_msg_.readFromRT();
133133
// Discard, if a goal is pending but still not active (somewhere stuck in goal_handle_timer_)
134134
if (current_external_msg != *new_external_msg && (*(rt_has_pending_goal_.readFromRT()) && !active_goal) == false) {
135135
fill_partial_goal(*new_external_msg);
136136
sort_to_local_joint_order(*new_external_msg);
137137
// TODO(denis): Add here integration of position and velocity
138-
traj_external_point_ptr_->update(*new_external_msg);
138+
current_trajectory_->update(*new_external_msg);
139139
}
140140

141141
// TODO(anyone): can I here also use const on joint_interface since the reference_wrapper is not
@@ -166,22 +166,22 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
166166

167167
bool first_sample = false;
168168
// if sampling the first time, set the point before you sample
169-
if (!traj_external_point_ptr_->is_sampled_already()) {
169+
if (!current_trajectory_->is_sampled_already()) {
170170
first_sample = true;
171171
if (params_.open_loop_control) {
172-
traj_external_point_ptr_->set_point_before_trajectory_msg(traj_time, last_commanded_state_);
172+
current_trajectory_->set_point_before_trajectory_msg(traj_time, last_commanded_state_);
173173
} else {
174-
traj_external_point_ptr_->set_point_before_trajectory_msg(traj_time, state_current_);
174+
current_trajectory_->set_point_before_trajectory_msg(traj_time, state_current_);
175175
}
176176
}
177177

178178
// find segment for current timestamp
179179
joint_trajectory_controller::TrajectoryPointConstIter start_segment_itr, end_segment_itr;
180-
const bool valid_point = traj_external_point_ptr_->sample(traj_time, interpolation_method_, state_desired_,
181-
start_segment_itr, end_segment_itr);
180+
const bool valid_point = current_trajectory_->sample(traj_time, interpolation_method_, state_desired_,
181+
start_segment_itr, end_segment_itr);
182182

183183
if (valid_point) {
184-
const rclcpp::Time traj_start = traj_external_point_ptr_->time_from_start();
184+
const rclcpp::Time traj_start = current_trajectory_->time_from_start();
185185
// this is the time instance
186186
// - started with the first segment: when the first point will be reached (in the future)
187187
// - later: when the point of the current segment was reached
@@ -193,16 +193,16 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
193193
bool tolerance_violated_while_moving = false;
194194
bool outside_goal_tolerance = false;
195195
bool within_goal_time = true;
196-
const bool before_last_point = end_segment_itr != traj_external_point_ptr_->end();
196+
const bool before_last_point = end_segment_itr != current_trajectory_->end();
197197

198198
// have we reached the end, are not holding position, and is a timeout configured?
199199
// Check independently of other tolerances
200200
if (!before_last_point && *(rt_is_holding_.readFromRT()) == false && cmd_timeout_ > 0.0 &&
201201
time_difference > cmd_timeout_) {
202202
RCLCPP_WARN(get_node()->get_logger(), "Aborted due to command timeout");
203203

204-
traj_msg_external_point_ptr_.reset();
205-
traj_msg_external_point_ptr_.initRT(set_hold_position());
204+
new_trajectory_msg_.reset();
205+
new_trajectory_msg_.initRT(set_hold_position());
206206
}
207207

208208
// Check state/goal tolerance
@@ -237,8 +237,7 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
237237
// Update PIDs
238238
for (auto i = 0ul; i < dof_; ++i) {
239239
tmp_command_[i] = (state_desired_.velocities[i] * ff_velocity_scale_[i]) +
240-
pids_[i]->computeCommand(state_error_.positions[i], state_error_.velocities[i],
241-
(uint64_t)period.nanoseconds());
240+
pids_[i]->compute_command(state_error_.positions[i], state_error_.velocities[i], period);
242241
}
243242
}
244243

@@ -292,8 +291,8 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
292291

293292
RCLCPP_WARN(get_node()->get_logger(), "Aborted due to state tolerance violation");
294293

295-
traj_msg_external_point_ptr_.reset();
296-
traj_msg_external_point_ptr_.initRT(set_hold_position());
294+
new_trajectory_msg_.reset();
295+
new_trajectory_msg_.initRT(set_hold_position());
297296
} else if (!before_last_point) { // check goal tolerance
298297
if (!outside_goal_tolerance) {
299298
auto res = std::make_shared<FollowJTrajAction::Result>();
@@ -306,8 +305,8 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
306305

307306
RCLCPP_INFO(get_node()->get_logger(), "Goal reached, success!");
308307

309-
traj_msg_external_point_ptr_.reset();
310-
traj_msg_external_point_ptr_.initRT(set_hold_position());
308+
new_trajectory_msg_.reset();
309+
new_trajectory_msg_.initRT(set_hold_position());
311310
} else if (!within_goal_time) {
312311
auto result = std::make_shared<FollowJTrajAction::Result>();
313312
result->set__error_code(FollowJTrajAction::Result::GOAL_TOLERANCE_VIOLATED);
@@ -320,21 +319,21 @@ controller_interface::return_type ScaledJointTrajectoryController::update(const
320319
RCLCPP_WARN(get_node()->get_logger(), "Aborted due goal_time_tolerance exceeding by %f seconds",
321320
time_difference);
322321

323-
traj_msg_external_point_ptr_.reset();
324-
traj_msg_external_point_ptr_.initRT(set_hold_position());
322+
new_trajectory_msg_.reset();
323+
new_trajectory_msg_.initRT(set_hold_position());
325324
}
326325
}
327326
} else if (tolerance_violated_while_moving && *(rt_has_pending_goal_.readFromRT()) == false) {
328327
// we need to ensure that there is no pending goal -> we get a race condition otherwise
329328
RCLCPP_ERROR(get_node()->get_logger(), "Holding position due to state tolerance violation");
330329

331-
traj_msg_external_point_ptr_.reset();
332-
traj_msg_external_point_ptr_.initRT(set_hold_position());
330+
new_trajectory_msg_.reset();
331+
new_trajectory_msg_.initRT(set_hold_position());
333332
} else if (!before_last_point && !within_goal_time && *(rt_has_pending_goal_.readFromRT()) == false) {
334333
RCLCPP_ERROR(get_node()->get_logger(), "Exceeded goal_time_tolerance: holding position...");
335334

336-
traj_msg_external_point_ptr_.reset();
337-
traj_msg_external_point_ptr_.initRT(set_hold_position());
335+
new_trajectory_msg_.reset();
336+
new_trajectory_msg_.initRT(set_hold_position());
338337
}
339338
// else, run another cycle while waiting for outside_goal_tolerance
340339
// to be satisfied (will stay in this state until new message arrives)

ur_robot_driver/doc/dashboard_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _dashboard_client:
1+
.. _dashboard_client_ros2:
22

33
Dashboard client
44
================

ur_robot_driver/doc/installation/install_urcap_cb3.rst

Lines changed: 0 additions & 67 deletions
This file was deleted.

ur_robot_driver/doc/installation/install_urcap_e_series.rst

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)