Planar Arm Jacobian — Robotics/Planar Kinematics
Robotics/Planar_Kinematics/Planar_Arm_Jacobian · 1 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.
Planar Arm Jacobian
Robotics / Planar Kinematics
The [3,N] geometric Jacobian of the same N-link planar arm that Planar Arm Forward Kinematics describes – the matrix that maps joint rates to tool rates:
(ẋ, ẏ, φ̇)T = J · q̇
Joint j moves every link from j outwards and none before it, so each column is a suffix sum over the same terms the forward map accumulates in full (with φk = q0 + … + qk):
- J[0][j] = −Σk≥j lk·sin(φk)
- J[1][j] = +Σk≥j lk·cos(φk)
- J[2][j] = 1
The third row is 1 for every joint because each joint contributes exactly one unit of tool rotation. That is the correct value, not a placeholder.
Ports
- q – the joint angles, an [N,1] column in radians, base joint first. N is set by the Link Lengths config, and an input of any other height is an error.
- J – the Jacobian, [3,N]. Feed it to Matrix Multiply against a joint-rate column for the velocity map, or use its transpose against a wrench for the force map.
Parameters
- Link Lengths – an [N,1] column, base link first. Its height is the only source of N and it sizes the output as well as the input. Give this block and Planar Arm Forward Kinematics the same value: they describe one arm, and nothing checks that they agree.
- 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. The link lengths are baked into the emitted body: they are structural, since changing one changes N and therefore the port sizes.
The matrix is fully unrolled at export time, so no emitted body contains a loop or a data-dependent index. Each column is summed ascending in k, which makes the emitted text grow as N² – deliberate: the N-operation suffix accumulation sums each column in the opposite order, and since floating-point addition is not associative that choice would have to be reproduced identically in all ten backends to keep them agreeing.
The three HDL targets are simulation-only real
arithmetic, not synthesizable Q16.16, for the same reason as the forward block:
N sines and N cosines every sample.
Simulink bridge
None, and the reason is measured rather than assumed: Simulink's arm kinematics ship in the Robotics System Toolbox, which is not installed on this machine. A model carrying this block exports with the block reported rather than silently dropped.
Notes
- Algebraic and stateless.
- Column 0 is (−y, x, 1), where (x, y) is the forward block's own output – the full sum is the pose. It is the cheapest check on this block: drive both from the same q and compare.
- At a singular configuration J loses rank – a fully stretched or fully folded arm, where the tool cannot move radially. The block still returns the correct matrix there; it is whatever consumes J (an inverse, a pseudo-inverse) that has to cope, and this block deliberately does not pre-empt that choice.
- Joint angles are RELATIVE, matching the forward block. Both differentiate the same convention.
- Nonlinear, so deliberately no state space.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Planar_Kinematics/Planar_Arm_Jacobian |
| family | Robotics/Planar_Kinematics |
| solver environment class | ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Planar_Arm_Jacobian |
| source | src/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Planar_Kinematics/Planar_Arm_Jacobian/ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Planar_Arm_Jacobian.cpp |
| header | src/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Planar_Kinematics/Planar_Arm_Jacobian/ICoreBlock_0_Robotics_1_Planar_Kinematics_2_Planar_Arm_Jacobian.h |
| default size on canvas | 140 × 88 px |
| ports at insert | 1 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 | q |
| 2 | out | ICoreDouble | J |
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 |
|---|---|---|
Link Lengths | [1; 0.8; 0.5] | — |
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: arm Jacobians ship in the Robotics System Toolbox, which is not installed. Rebuild the matrix on the Simulink side from Trigonometric Function and Sum blocks, keeping the RELATIVE joint-angle convention and the (xdot, ydot, phidot) row 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).
Planar Arm Jacobian — the [3,N] derivative of Planar_Arm_Forward_Kinematics phi_k = q_0 + ... + q_k (the forward block's cumulative angles) J[0][j] = -SUM_{k >= j} l_k * sin(phi_k) J[1][j] = +SUM_{k >= j} l_k * cos(phi_k) J[2][j] = 1
Written together with the forward block: the two share every partial sum, differing only in that the forward map takes the FULL sums and each Jacobian column takes a SUFFIX of them. See the header for the pair's independent cross-check, which is the only thing that can certify a Support::None derivative.
⚠ THE ACCUMULATION ORDER IS THE CONTRACT: ASCENDING k WITHIN EACH COLUMN, in all eleven implementations. A suffix accumulation running k downwards once would be O(N) instead of O(N^2) and is the obvious optimization -- it is deliberately NOT taken, because it sums each column in the opposite order and floating-point addition is not associative, so the two differ in the last ulp and the choice would have to be re-made identically in ten backends to stay consistent. At the sizes an unrolled planar arm reaches, uniformity is worth more than the operation count, and it lets the HDL bodies be structurally identical to the software ones instead of a second design.
⚠ THE GENERATORS BAKE THE LINK LENGTHS IN, so loadBlockConfig() MUST be called from initializePortSignalSize() (§3) -- and here it is doubly required, because the OUTPUT WIDTH is N and is only knowable once the config has been read.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Planar Arm Jacobian block: ICore Blocks/Home/Planar Arm Jacobian. 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__Planar_Arm_Jacobian.json