Generated reference › Estimate Inertia Tensor — Robotics/Mass Properties
kind: generated#block#robotics-mass-properties

Estimate Inertia Tensor — Robotics/Mass Properties

Robotics/Mass_Properties/Estimate_Inertia_Tensor · 2 input / 2 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.

Estimate Inertia Tensor

Robotics / Mass Properties

Interpolates the inertia tensor between its empty and full values against the current mass, and reports its rate of change from the mass rate. With λ the clamped position of the mass between the two:

  • λ = clamp((m − mempty) / (mfull − mempty), 0, 1)
  • I = (1 − λ)·I_empty + λ·I_full, entry by entry
  • I_dot = ((I_full − I_empty) / (mfull − mempty))·ṁ

Ports

  • Mass – the current mass m, a scalar. It is the only thing λ is computed from.
  • M_dot – the mass rate ṁ, a scalar, in mass units per second.
  • I – the interpolated inertia tensor, the same size as the two tables ([3,3] by default).
  • I_dot – its rate of change, the same size again.

Parameters

  • Empty Mass – mempty, a scalar. Defaults to 1.
  • Full Mass – mfull, a scalar. Defaults to 2, and it must differ from the empty mass: the two are the ends of a division.
  • Empty Inertia Tensor – the inertia tensor at the empty mass, any size [m,n]. Defaults to [0.5 0 0; 0 0.5 0; 0 0 0.5].
  • Full Inertia Tensor – the inertia tensor at the full mass, and it must be the same size as the entry above. Defaults to [1 0 0; 0 1 0; 0 0 1].
  • 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.

Both tables and both masses are baked into the emitted arithmetic at export time rather than exposed as tunables, and so is the per-entry slope derived from them: they describe which vehicle this is, which is structure and not a knob, and deriving the slope once is also what keeps the ten backends from differing by an association order. All are printed at 17 significant digits.

The three hardware targets are simulation-only. The clamp and the interpolation are multiplies and adds, which a Q16.16 datapath has, but λ needs a division by a difference of two masses – and replacing that division by a pre-computed reciprocal is exactly the change that stops this block reproducing its Simulink counterpart to the last bit. Values convert at the port boundary and the arithmetic runs in floating point.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibbdyn/Estimate Inertia Tensor. All four configuration values cross straight through: Empty Mass → emass, Full Mass → fmass, Empty Inertia Tensor → eI and Full Inertia Tensor → fI.

The Simulink block defines no SampleTime parameter, measured, so the rate stays on the ICore side.

Notes

  • Algebraic and stateless: both outputs depend on this sample alone.
  • Not linear – the clamp is what makes it so – so the block carries no state space and model reduction correctly reports it as unmergeable.
  • ⚠ The two outputs do not agree about the ends. I clamps outside the mass range; I_dot does not, and keeps reporting a rate of change at masses where the value it belongs to has stopped changing. That is what the Aerospace Blockset block does, measured, and not an oversight here.
  • Nothing checks that the mass rate is the derivative of the mass. They arrive on separate ports and the block trusts both.
  • Verified against R2026a over two tables, seven masses and seven mass rates: all 63 interpolated values and all 48 rates agree to the last bit.

Code facts#

FactValue
registered typeRobotics/Mass_Properties/Estimate_Inertia_Tensor
familyRobotics/Mass_Properties
solver environment classICoreBlock_0_Robotics_1_Mass_Properties_2_Estimate_Inertia_Tensor
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Mass_Properties/Estimate_Inertia_Tensor/ICoreBlock_0_Robotics_1_Mass_Properties_2_Estimate_Inertia_Tensor.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Mass_Properties/Estimate_Inertia_Tensor/ICoreBlock_0_Robotics_1_Mass_Properties_2_Estimate_Inertia_Tensor.h
default size on canvas170 × 86 px
ports at insert2 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleMass
2inICoreDoubleM_dot
3outICoreDoubleI
4outICoreDoubleI_dot

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 variableDefaultSimulink parameter
Empty MassDEFAULT_EMPTY_MASS—
Full MassDEFAULT_FULL_MASS—
Empty Inertia TensorDEFAULT_EMPTY—
Full Inertia TensorDEFAULT_FULL—

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.

supportSupport::Both
Simulink pathaerolibbdyn/Estimate Inertia Tensor
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
ICore configSimulink parameterValue translation
CONFIG_EMPTY_MASS.c_str()emasspasses through
CONFIG_FULL_MASS.c_str()fmasspasses through
CONFIG_EMPTY.c_str()eIpasses through
CONFIG_FULL.c_str()fIpasses through

Caveat (shown to the user): the mass and the mass rate are scalars on separate ports, and the two outputs are the size of the two tables. ⚠ The interpolated value CLAMPS outside the mass range and the rate does NOT -- that is measured, not an oversight, so a user reading a rate at a clamped mass is reading what Simulink reports too. The Simulink block has no SampleTime, so the rate stays on the ICore side

Catalog contract: src/ICoreBlocks/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:

  • B0 4 Simulink params rule(s) this tool cannot resolve

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).

Estimate Inertia Tensor -- the inertia tensor interpolated between an empty and a full mass lambda = clamp((m - m_empty) / (m_full - m_empty), 0, 1) I = (1 - lambda) * I_empty + lambda * I_full I_dot = ((I_full - I_empty) / (m_full - m_empty)) * m_dot

⚠ THE TWO OUTPUTS DO NOT AGREE ABOUT THE ENDS, AND THAT IS THE BLOCK. I clamps -- below the empty mass it holds I_empty, above the full mass it holds I_full -- and I_dot does not, because it is a constant slope times the mass rate and never sees the mass at all. Measured in R2026a by looking inside the masked subsystem AND by driving it: the clamp is a Prelookup with ExtrapMethod = Clip, the rate is a Constant into an element-wise Product, and over a mass sweep from 0.4 to 3 against a range of [1.1, 2.3] the rate is the same at both ends as it is in the middle.

⚠ THE SPELLING IS THE MEASURED ONE, AND THE OBVIOUS ONE IS NOT. Over 63 interpolated values and 48 rates -- two tables, seven masses, seven mass rates -- (1 - lambda) * E + lambda * F reproduces the block BIT FOR BIT. E + lambda * (F - E), which is algebraically the same thing, moves 14 of the 63 by one unit in the last place, and replacing the division by a pre-computed reciprocal moves 4 more. Every backend therefore writes it this way round.

Elementwise over whatever [m,n] the two tables are, which is what lets one arrangement serve a [3,3] table here and a differently shaped one in its sibling. ALGEBRAIC and STATELESS, and the clamp makes it nonlinear, so no state space.

Sample results#

Estimate Inertia Tensor — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sampleEstimate Inertia Tensor — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample-202012345t (s)in ICoreDouble-Out-0in ICoreDouble-Out-0out ICoreDouble-Out-0 [3x3] entry 0out ICoreDouble-Out-1 [3x3] entry 0
tin ICoreDouble-Out-0in ICoreDouble-Out-0out ICoreDouble-Out-0 [3x3] entry 0out ICoreDouble-Out-1 [3x3] entry 0
0-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
0.40.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
0.8-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
1.20.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
1.6-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
20.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
2.4-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
2.80.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
3.2-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
3.60.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
4-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
4.40.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…
4.8-2-2[0.5, 0, 0, 0]…[-1, 0, 0, 0]…
5.20.50.5[0.5, 0, 0, 0]…[0.25, 0, 0, 0]…

Every 4th of 60 samples, from the table stimulus.

The same rig also ran:

StimulusWhat it isOutput range
impulseImpulse: one sample of 1 at k = 5, 0 elsewhere (Repeating Sequence Stair)0.5 … 0.5
rampRamp: slope 1 from t = 00.5 … 1
sineSine Wave: amplitude 1, 2 rad/s, no phase, no bias0.5 … 0.5
stepStep: 0 -> 1 at t = 1 s0.5 … 0.5

Plotted: table — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample

Category static · sample time 0.1 · 60 steps · commit d36e1255b059647c8b7bd9d16f0bc9f5849272eb · produced by docsSample --out <folder> --blocks Estimate_Center_Of_Gravity Estimate_Inertia_Tensor --steps 60 · data docs/generated/samples/Robotics__Mass_Properties__Estimate_Inertia_Tensor.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).