Skip to content

MotionTarget helpers - #558

Open
URJala wants to merge 2 commits into
UniversalRobots:masterfrom
URJala:MotionTarget_helpers
Open

MotionTarget helpers#558
URJala wants to merge 2 commits into
UniversalRobots:masterfrom
URJala:MotionTarget_helpers

Conversation

@URJala

@URJala URJala commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Adding string representations of urcl::Q and urcl::Pose, to use instead of having to access individual elements.
Add stringFromMotionTarget to access the string representations when Q or Pose is in a urcl::MotionTarget.
Also added a test of stringFromMotionTarget in the helpers test.


Note

Low Risk
Additive API and formatting helpers only; no changes to motion, networking, or control behavior.

Overview
Adds human-readable string formatting for motion targets so callers can log or debug joint and Cartesian goals without manually formatting each field.

urcl::Q and urcl::Pose gain toString() (joint values as Q([...]), pose as labeled x/y/z/rx/ry/rz). stringFromMotionTarget in helpers dispatches over the MotionTarget variant via std::visit and returns the appropriate string.

Unit tests in test_helpers.cpp lock in expected output for both variant arms.

Reviewed by Cursor Bugbot for commit 17f0822. Bugbot is set up for automated code reviews on this repo. Configure here.

URJala added 2 commits August 25, 2026 13:45
And add a helper to access them when they are in a `urcl::MotionTarget`.
Copilot AI balanced review requested due to automatic review settings August 25, 2026 13:56
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.16%. Comparing base (dde4869) to head (17f0822).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
- Coverage   80.46%   80.16%   -0.31%     
==========================================
  Files         116      116              
  Lines        6976     6991      +15     
  Branches     3083     3096      +13     
==========================================
- Hits         5613     5604       -9     
- Misses        984     1006      +22     
- Partials      379      381       +2     
Flag Coverage Δ
check_version_ur10-3.15.8 11.72% <0.00%> (-1.26%) ⬇️
check_version_ur10e-10.11.0 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur10e-5.15.2 11.67% <0.00%> (-0.46%) ⬇️
check_version_ur12e-10.12.1 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur12e-5.25.1 11.47% <0.00%> (-0.50%) ⬇️
check_version_ur15-10.12.1 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur15-5.25.1 11.47% <0.00%> (-0.28%) ⬇️
check_version_ur16e-10.12.1 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur16e-5.25.1 11.47% <0.00%> (-0.55%) ⬇️
check_version_ur18-10.12.1 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur18-5.25.1 11.67% <0.00%> (-0.08%) ⬇️
check_version_ur20-10.12.1 11.47% <0.00%> (-0.03%) ⬇️
check_version_ur20-5.25.1 11.47% <0.00%> (-0.23%) ⬇️
check_version_ur3-3.14.3 11.72% <0.00%> (-1.29%) ⬇️
check_version_ur30-10.12.1 11.47% <0.00%> (-0.03%) ⬇️
check_version_ur30-5.25.1 11.67% <0.00%> (+0.12%) ⬆️
check_version_ur3e-10.11.0 11.52% <0.00%> (-0.03%) ⬇️
check_version_ur3e-5.9.4 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur5-3.15.8 11.52% <0.00%> (-1.79%) ⬇️
check_version_ur5e-10.11.0 11.47% <0.00%> (-0.12%) ⬇️
check_version_ur5e-5.12.8 11.72% <0.00%> (-0.08%) ⬇️
check_version_ur7e-10.11.0 11.47% <0.00%> (-0.03%) ⬇️
check_version_ur7e-5.22.2 11.47% <0.00%> (-0.23%) ⬇️
check_version_ur8long-10.12.1 11.47% <0.00%> (-0.08%) ⬇️
check_version_ur8long-5.25.1 11.47% <0.00%> (-0.28%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 85.57% <ø> (-1.03%) ⬇️
ur20-latest 75.55% <100.00%> (-0.10%) ⬇️
ur5-3.14.3 75.25% <100.00%> (-0.23%) ⬇️
ur5e-10.11.0 70.11% <100.00%> (-0.19%) ⬇️
ur5e-10.12.0 71.19% <100.00%> (-0.09%) ⬇️
ur5e-10.7.0 69.54% <100.00%> (-0.13%) ⬇️
ur5e-5.9.4 ?
ur7e-10.13.0 71.87% <100.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 17f0822. Configure here.

Comment thread src/types.cpp
ss << "Pose(x = " << x << ", y = " << y << ", z = " << z << ", rx = " << rx << ", ry = " << ry << ", rz = " << rz
<< ")";
return ss.str();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pose string omits q_near

Low Severity

Pose::toString only formats the Cartesian fields and drops q_near_ when it is set. Equality, constructors, and the trajectory path all treat that hint as part of the pose, so stringFromMotionTarget can hide important IK context in logs and make two unequal poses look identical.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 17f0822. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds human-readable formatting helpers for joint, pose, and variant-based motion targets.

Changes:

  • Adds toString() to Q and Pose.
  • Adds stringFromMotionTarget() using variant dispatch.
  • Tests formatting for both motion-target variants.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/ur_client_library/types.h Declares motion-type formatting APIs.
src/types.cpp Implements Q and Pose formatting.
include/ur_client_library/helpers.h Declares the variant formatting helper.
src/helpers.cpp Dispatches formatting through std::visit.
tests/test_helpers.cpp Tests joint and pose output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

void setValues(const vector6d_t& values);
void setValues(const std::vector<double>& values);

std::string toString() const;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants