MotionTarget helpers - #558
Conversation
And add a helper to access them when they are in a `urcl::MotionTarget`.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 17f0822. Configure here.
| ss << "Pose(x = " << x << ", y = " << y << ", z = " << z << ", rx = " << rx << ", ry = " << ry << ", rz = " << rz | ||
| << ")"; | ||
| return ss.str(); | ||
| } |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 17f0822. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds human-readable formatting helpers for joint, pose, and variant-based motion targets.
Changes:
- Adds
toString()toQandPose. - 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; |


Adding string representations of
urcl::Qandurcl::Pose, to use instead of having to access individual elements.Add
stringFromMotionTargetto access the string representations whenQorPoseis in aurcl::MotionTarget.Also added a test of
stringFromMotionTargetin 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::Qandurcl::PosegaintoString()(joint values asQ([...]), pose as labeledx/y/z/rx/ry/rz).stringFromMotionTargetin helpers dispatches over theMotionTargetvariant viastd::visitand returns the appropriate string.Unit tests in
test_helpers.cpplock 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.