Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check to ensure that the targets are reachable within the robot… #184

Merged
merged 21 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f5c8f48
Added check to ensure that the targets are reachable within the robot…
urmahp Sep 26, 2023
c91e241
spell correction
fmauch Jun 10, 2024
66f52b6
Apply suggestions from code review
fmauch Jun 10, 2024
92ee816
Use diff between commands instead of distance from current joint pose…
fmauch Jun 27, 2024
b0deed9
Use a separate cutoff velocity and add a popup instead of terminating…
fmauch Jul 10, 2024
950dc3c
Do not terminate program on invalid input but raise a popup
fmauch Jul 15, 2024
7260bad
Make limit_check logic a bit more straight forward
fmauch Jul 15, 2024
8367cef
Merge branch 'master' into limit_check
fmauch Jul 15, 2024
533e9b2
More fixes
fmauch Jul 16, 2024
3405529
Update tests to changes
fmauch Jul 16, 2024
af925db
More fixes
fmauch Jul 16, 2024
765989b
Use string representation of trajectory result
fmauch Jul 18, 2024
f942e0d
Allow 0.0 time in first point of spline
fmauch Jul 18, 2024
f1765a0
Increase trajectory point read timeout in trajectory thread
fmauch Jul 18, 2024
281c797
Update tests
fmauch Jul 18, 2024
35263a3
Have a higher timeout for the first trajectory point while the robot …
fmauch Sep 6, 2024
9ea9723
Merge remote-tracking branch 'origin/master' into limit_check
fmauch Sep 6, 2024
a090e2e
Make spline functions return whether the robot is moving or not
fmauch Sep 6, 2024
a23ed68
Use explicit result to string conversion
fmauch Sep 6, 2024
682f8b7
REVERT_ME: Use fixed ROS1 driver for integration tests
fmauch Sep 9, 2024
7281872
Restore downstream workspace
fmauch Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/industrial-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
ROS_DISTRO:
- {NAME: noetic, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS_Driver#master https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.noetic.rosinstall"}
- {NAME: noetic, DOWNSTREAM_WORKSPACE: "github:fmauch/Universal_Robots_ROS_Driver#fix_trajectory_forward_test https://raw.githubusercontent.com/UniversalRobots/Universal_Robots_ROS_Driver/master/.noetic.rosinstall"}
- {NAME: humble, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#humble"}
- {NAME: iron, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#iron"}
- {NAME: jazzy, DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"}
Expand Down
46 changes: 33 additions & 13 deletions examples/full_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,20 @@ int main(int argc, char* argv[])

g_my_driver->startRTDECommunication();

double increment = 0.01;
// Increment depends on robot version
double increment_constant = 0.0005;
if (g_my_driver->getVersion().major < 5)
{
increment_constant = 0.002;
}
double increment = increment_constant;

bool passed_slow_part = false;
bool passed_fast_part = false;
bool first_pass = true;
bool passed_negative_part = false;
bool passed_positive_part = false;
URCL_LOG_INFO("Start moving the robot");
while (!(passed_slow_part && passed_fast_part))
urcl::vector6d_t joint_target = { 0, 0, 0, 0, 0, 0 };
while (!(passed_positive_part && passed_negative_part))
{
// Read latest RTDE package. This will block for a hard-coded timeout (see UrDriver), so the
// robot will effectively be in charge of setting the frequency of this loop.
Expand All @@ -139,21 +147,33 @@ int main(int argc, char* argv[])
throw std::runtime_error(error_msg);
}

// Simple motion command of last joint
if (g_joint_positions[5] > 3)
if (first_pass)
{
joint_target = g_joint_positions;
first_pass = false;
}

// Open loop control. The target is incremented with a constant each control loop
if (passed_positive_part == false)
{
passed_fast_part = increment > 0.01 || passed_fast_part;
increment = -3; // this large jump will activate speed scaling
increment = increment_constant;
if (g_joint_positions[5] >= 2)
{
passed_positive_part = true;
}
}
else if (g_joint_positions[5] < -3)
else if (passed_negative_part == false)
{
passed_slow_part = increment < 0.01 || passed_slow_part;
increment = 0.02;
increment = -increment_constant;
if (g_joint_positions[5] <= 0)
{
passed_negative_part = true;
}
}
g_joint_positions[5] += increment;
joint_target[5] += increment;
// Setting the RobotReceiveTimeout time is for example purposes only. This will make the example running more
// reliable on non-realtime systems. Use with caution in productive applications.
bool ret = g_my_driver->writeJointCommand(g_joint_positions, comm::ControlMode::MODE_SERVOJ,
bool ret = g_my_driver->writeJointCommand(joint_target, comm::ControlMode::MODE_SERVOJ,
RobotReceiveTimeout::millisec(100));
if (!ret)
{
Expand Down
Loading
Loading