Pose Transform 2D — Robotics/Planar Kinematics
Robotics/Planar_Kinematics/Pose_Transform_2D · 2 input / 1 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Pose Transform 2D
Robotics / Planar Kinematics
The three rigid-body operations a planar pose supports, selected by Operation. A pose is (x, y, θ) as a [3,1] column: the position and heading of one frame expressed in another, with θ in radians and never wrapped.
- Compose – Tc = Ta·Tb, with Tb read in Ta's frame: xc = xa + cosθa·xb − sinθa·yb, yc = ya + sinθa·xb + cosθa·yb, θc = θa + θb.
- Apply to point – p = Ta·p_local, the same two position rows against a [2,1] point instead of a pose: x = xa + cosθa·px − sinθa·py, y = ya + sinθa·px + cosθa·py.
- Invert – Tc = Ta⁻¹, the pose that undoes Ta: xc = −(cosθa·xa + sinθa·ya), yc = sinθa·xa − cosθa·ya, θc = −θa.
The rotation is active and counter-clockwise, the same sense Rotation 2D uses, so composing Ta = (0, 0, +90°) with the pure translation Tb = (0.1, 0, 0) gives (0, +0.1, +90°).
Ports
The input port count follows Operation, so it is editable and the block checks it rather than changing it underneath you. Add or remove an input to match.
- Ta – the pose that acts, a [3,1] column (x, y, θ). Present in all three operations.
- Tb – in Compose the second pose, [3,1], read in Ta's frame; in Apply to point the point (x, y), [2,1], likewise in Ta's frame. Invert reads Ta alone: it needs only one input port, and a second one is ignored if it is left in place. Remove it for a diagram that says what it means.
- Tc – the result. [3,1] under Compose and Invert, [2,1] under Apply to point. Its size is fixed by the operation, not inherited.
Parameters
- Operation – which of the three the block computes. It selects a different
computation AND a different port list, so it is not a tuning knob:
- Compose (Tc = Ta * Tb) – two [3,1] inputs, a [3,1] output. The default.
- Apply to point (p = Ta * p_local) – a [3,1] and a [2,1] in, a [2,1] out.
- Invert (Tc = Ta inverse) – reads Ta only, a [3,1] output. One input port is enough; a second is ignored.
- Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
Code export
All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. There is no tunable parameter on the generated core: Operation chooses which body is emitted, so it is a structural choice baked in at export time rather than something retuned afterwards.
The three HDL targets are simulation-only: they carry the arithmetic in
real and quantize only at the port boundary. A sine and a cosine per sample have no
Q16.16 form. Compose's angle row and Invert's would each be exact in fixed point on
their own, and are still carried in real with the rest – a body mixing the two
domains would buy no accuracy the port boundary does not take straight back.
Simulink bridge
None, measured rather than assumed: SE(2) pose algebra ships in the Robotics System
Toolbox and the Navigation Toolbox, and neither is installed on this machine
(robotics, nav and shared_robotics are all absent from
matlabroot/toolbox). The same arithmetic is easy to rebuild there from
Trigonometric Function, Product and Sum blocks – keeping the active,
counter-clockwise sense this block uses, and the argument order Ta then Tb.
Notes
- Algebraic and stateless.
- θ is RAW in every operation, deliberately – including Compose, which ADDS two angles and so can leave (−π, π] in one step. Unicycle Odometry and Planar Arm Forward Kinematics both publish a raw heading and both chain into this block; wrapping here would contradict them and would hide the wrap from the diagram. Put an Angle Wrap where a bounded angle is wanted.
- Compose does not commute, and the order is the contract: Ta is the parent-frame pose and Tb is read in Ta's frame, so Tc = Ta·Tb reads left to right the way a frame chain does. Swapping the two inputs is a different answer wherever the two headings differ.
- The inverse is exact algebra, not a solve: composing a pose with its own inverse returns (0, 0, 0) to the last bit of the arithmetic.
- Bilinear, so deliberately no state space – each operation is linear in its second input for a fixed θa, but θa arrives as a signal.
- For the 3-D case use Quaternion Rotate Vector with a translation, or Quaternion To Rotation Matrix with Matrix Multiply.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Planar_Kinematics/Pose_Transform_2D |
| family | Robotics/Planar_Kinematics |
| solver environment class | ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Pose_Transform_2D |
| source | src/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Planar_Kinematics/Pose_Transform_2D/ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Pose_Transform_2D.cpp |
| header | src/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Planar_Kinematics/Pose_Transform_2D/ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Pose_Transform_2D.h |
| default size on canvas | 140 × 84 px |
| ports at insert | 2 in, 1 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | Ta |
| 2 | in | ICoreDouble | Tb |
| 3 | out | ICoreDouble | Tc |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Operation | Compose (Tc = Ta * Tb)%~%Apply to point (p = Ta * p_local… | — |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::None |
| Simulink path | — |
| port-count rule | PortsParam::None |
SampleTime parameter | yes |
Caveat (shown to the user): no Simulink equivalent available: SE(2) pose composition, transformation and inversion ship in the Robotics System Toolbox and the Navigation Toolbox, neither of which is installed. Rebuild it from Trigonometric Function, Product and Sum blocks, keeping the active counter-clockwise sense and the Ta-then-Tb order this block uses
Catalog contract: src/ICoreSDK/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0every stimulus in the sample errored — cross-checks skipped
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Pose Transform 2D — the three SE(2) operations, as three modes of one block Compose xc = xa + cos(ta)*xb - sin(ta)*yb yc = ya + sin(ta)*xb + cos(ta)*yb tc = ta + tb Apply to point xo = xa + cos(ta)*px - sin(ta)*py yo = ya + sin(ta)*px + cos(ta)*py Invert xc = -(cos(ta)*xa + sin(ta)*ya) yc = sin(ta)*xa - cos(ta)*ya tc = -ta
The rows are built ONCE, in rowExpr() below, from per-language spellings of cos/sin and the element accessors - so the reference and the ten backends cannot drift in a term or a sign, which on this block is the whole risk: a transposed rotation is self-consistent and no suite here can see it (see the header).
cos and sin are spelled INLINE over the pose's third element rather than held in a scratch, Rotation_2D's constraint verbatim: VHDL supplies a block body two FIXED-POINT process variables and no real one, so a shared trig intermediate is not expressible there. Every backend therefore evaluates the same four calls per sample in the same places.
Verified against the convention when written, since nothing downstream can:
- Compose(Ta = (0, 0, +pi/2), Tb = (0.1, 0, 0)) = (0, +0.1, +pi/2) - the active,
counter-clockwise R the ledger fixes for Rotation_2D.
- Compose(Ta, Invert(Ta)) = (0, 0, 0) exactly, for every Ta - the algebra is closed, and
that identity is checked in verifyInitializedPortSignals()'s sibling test below.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Pose Transform 2D block: ICore Blocks/Home/Pose Transform 2D. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit ccf005c8 · produced by docsSample --out <folder> --steps 60
Sample data: docs/generated/samples/Robotics__Planar_Kinematics__Pose_Transform_2D.json