[Instruction Executor] Allow joint and pose targets for all motion functions - #491
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #491 +/- ##
==========================================
- Coverage 76.91% 76.69% -0.23%
==========================================
Files 113 114 +1
Lines 6048 6251 +203
Branches 2640 2732 +92
==========================================
+ Hits 4652 4794 +142
- Misses 1060 1110 +50
- Partials 336 347 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
76cc550 to
151a5a3
Compare
Co-authored-by: Rune Søe-Knudsen <41109954+urrsk@users.noreply.github.com>
cd6ad52 to
d8e3824
Compare
d4996d9 to
b0fed74
Compare
It should always be constructed with 6 doubles
| if has_qnear: | ||
| target_q = get_inverse_kin(p[q[0], q[1], q[2], q[3], q[4], q[5]], second_block) | ||
| else: | ||
| target_q = get_inverse_kin(p[q[0], q[1], q[2], q[3], q[4], q[5]], get_target_joint_positions()) | ||
| end | ||
| optimovej(target_q, a = acceleration, v = velocity, r = blend_radius) |
There was a problem hiding this comment.
See my comment regarding inverse_kin and movej
|
| * Unlike raw initializer lists (``{...}``) which may bind to either \ref vector6d_t or | ||
| * \ref Pose, wrapping values in ``urcl::Q{...}`` always forces a joint-target interpretation. | ||
| */ | ||
| struct Q |
There was a problem hiding this comment.
Suggest changing Q to a class and add set and get function just like Pose
There was a problem hiding this comment.
Pose isn't a class either and doesn't have get functions. But I can definitively make Q a class and protect the data member.
There was a problem hiding this comment.
I made Pose also a class, which should be fine from an API stability standpoint, as long as we leave the x,y,z,rx,ry,rz members public.
Co-authored-by: Rune Søe-Knudsen <41109954+urrsk@users.noreply.github.com>
c056349 to
af4f7f0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
Reviewed by Cursor Bugbot for commit af4f7f0. Configure here.
Since the via_point is set in the initializer list already, and setTarget handles all recomputation, we can skip this redundant step.

All script functions interfaced through the InstructionExecutor allow their targets to be either defined as joint array or as poses. This change makes the same interface available on the c++ Instruction executor. See the example for different calls.
I fixed a mismatch in the trajectory interface wire protocol in the
moveccommand. There, acceleration and velocity were mixed up between the c++ sender and the urscript. I went with the order as it was documented in the protocol descroption, which is velocity first, acceleration second. However, all other motion commands use acceleration first, velocity second. Since mixing them up was clearly a bug, I think it would also be fine breaking the documentation and changing this to acceleration first, as all the others. What is your opinion on this @urrsk?Note
Medium Risk
Updates the trajectory wire protocol handling and bundled
external_control.urscriptfor new motion-type variants andq_nearhints; mistakes here can break robot motion execution or change kinematics behavior. Changes are fairly broad across motion primitives, encoding, and tests but include extensive test coverage updates.Overview
Adds mixed joint-space and Cartesian targets across all InstructionExecutor motion APIs. Introduces strong types
urcl::Qandurcl::MotionTarget(Q|Pose) plus newInstructionExecutor/Move*Primitiveoverloads so callers can explicitly choose joint vs pose targets (including mixedmoveCvia/target combinations) while preserving legacy brace-init behavior.Extends motion encoding/decoding end-to-end. Adds new
MotionTypevariants (e.g.,MOVEJ_POSE,MOVEL_JOINT,OPTIMOVEL_JOINT,MOVEC_*) and updatesTrajectoryPointInterfacepacking to flattenMotionTarget, propagate optionalPose::q_nearhints, and align the on-wire field meanings (including fixing MOVEC velocity/acceleration ordering).Updates robot-side script + docs/tests/examples.
resources/external_control.urscriptnow interprets the new motion types (IK/FK behaviors and optionalq_nearseed), documentation describes the revised protocol/overloads, examples demonstrate usage, and new/updated GTests cover the new types and wire round-trips. Also adds portableURCL_SILENCE_DEPRECATED_*macros and uses them to suppress deprecation warnings in implementation/tests.Reviewed by Cursor Bugbot for commit 3616b95. Bugbot is set up for automated code reviews on this repo. Configure here.