Generated reference › Attitude Profile Nadir Pointing — Robotics/Spacecraft Dynamics
kind: generated#block#robotics-spacecraft-dynamics

Attitude Profile Nadir Pointing — Robotics/Spacecraft Dynamics

Robotics/Spacecraft_Dynamics/Attitude_Profile_Nadir_Pointing · 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.

Attitude Profile (Nadir Pointing)

Robotics / Spacecraft Dynamics

The attitude that points a spacecraft axis at nadir, and the rotation that gets there from where it is now. The body primary alignment vector a1 is pointed at the central body's centre, −X; then the spacecraft turns about that line until the body secondary alignment vector a2 comes as close as it can to a fixed secondary constraint direction t2. Everything is computed in the body axes of the current attitude q, as the Aerospace Blockset does: with q1 the shortest rotation taking a1 to the target and q2 a turn about a1 bringing a2's projection onto the constraint's, q_align = q1 ⊗ q2 and q_ideal = conj(q_align) ⊗ q/|q|.

Ports

  • X – the spacecraft's position from the central body's centre, [3,1], in any length unit and any frame, as long as q and the constraint use the same one.
  • q – the current attitude, [4,1] [w; x; y; z], scalar first, in the Aerospace Toolbox's convention (quat2dcm(q) maps frame vectors into body axes). It need not be unit length: the block normalizes it.
  • q_align – [4,1]: the rotation from the current attitude to the ideal one, expressed in body axes.
  • q_ideal – [4,1]: the ideal attitude itself, in the same convention as q.

Parameters

  • Primary Alignment – a1, the body vector pointed at nadir, three numbers, any nonzero length. Default [0 0 1].
  • Secondary Alignment – a2, the body vector the constraint steers, any nonzero length. Default [1 0 0].
  • Secondary Constraint – t2, the frame direction a2 should face, any nonzero length. Default [0 1 0].
  • 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 three vectors are folded into the emitted code (a1, the part of a2 normal to a1, and t2) rather than published as tunable parameters; a1 parallel to a2 is decided at export and drops the secondary step from the code.

The three hardware targets compute in real inside a function and are simulation-only; only the ports are Q16.16. Those ports hold nothing beyond about ±32767, and only X's direction matters, so give X in kilometres (or any unit that keeps it small), never metres, or the fixed-point conversion wraps.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibsatdyn/Attitude Profile (Nadir Pointing) (the library name has a line break before the parenthesis). Primary Alignment → primaryAlignment, Secondary Alignment → secondaryAlignment and Secondary Constraint → secondaryConstraint, all 1:1 and lossless. Always written, with no configuration behind them: pointingMode Point at nadir, portFrame and constraintFrame ICRF, outputError and outputFinalAttitude on, tunablePointing off and every vector source Dialog. primaryConstraint is not used in this mode (the target is nadir) and does not cross. A constraint in another frame (Fixed-frame, NED, LVLH or body) does not cross either: Simulink converts it for a date, which this block does not model. The Simulink block defines no SampleTime, so the rate stays on the ICore side.

Notes

  • Algebraic and stateless: the outputs depend only on this sample's inputs.
  • Not linear, so the block carries no state space and model reduction correctly reports it as unmergeable.
  • Nadir is geocentric: the block points at the centre, −X, not along the ellipsoid normal.
  • The degenerate cases follow Simulink's: "parallel" means the cosine is within 10−6 of ±1. When a1 is parallel to a2, or the target to the constraint, only the primary step is applied; when the target is opposite a1 the primary step is a half turn about a fixed axis orthogonal to a1. All of them were measured on the Simulink block.
  • The frame is part of the answer: computing the same alignment in the frame of X and converting it afterwards agrees on ordinary samples and disagrees, by up to a whole quaternion, whenever a parallel case fires. This block computes in body axes, as Simulink does.
  • Verified against R2026a: this block's arithmetic follows the Simulink block to 3×10−14 on 600 random states with non-unit attitudes and non-unit, non-perpendicular alignment vectors, including the parallel and antiparallel cases.

Code facts#

FactValue
registered typeRobotics/Spacecraft_Dynamics/Attitude_Profile_Nadir_Pointing
familyRobotics/Spacecraft_Dynamics
solver environment classICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Nadir_Pointing
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Spacecraft_Dynamics/Attitude_Profile_Nadir_Pointing/ICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Nadir_Pointing.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Spacecraft_Dynamics/Attitude_Profile_Nadir_Pointing/ICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Nadir_Pointing.h
default size on canvas170 × 80 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
1inICoreDoubleX
2inICoreDoubleq
3outICoreDoubleq_align
4outICoreDoubleq_ideal

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
Primary Alignment[0 0 1]primaryAlignment
Secondary Alignment[1 0 0]secondaryAlignment
Secondary Constraint[0 1 0]secondaryConstraint

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 pathaerolibsatdyn/Attitude Profile\n(Nadir Pointing)
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
always setpointingMode = Point at nadir, portFrame = ICRF, constraintFrame = ICRF, outputError = on, outputFinalAttitude = on, tunablePointing = off, primaryAlignmentSrc = Dialog, secondaryAlignmentSrc = Dialog, secondaryConstraintSrc = Dialog
ICore configSimulink parameterValue translation
Primary AlignmentprimaryAlignmentpasses through
Secondary AlignmentsecondaryAlignmentpasses through
Secondary ConstraintsecondaryConstraintpasses through

Caveat (shown to the user): X, q and the constraint share one frame: portFrame and constraintFrame are always ICRF, the configuration in which the Simulink block converts nothing and needs no date. primaryConstraint is unused in nadir mode and does not cross. Both outputs are written (outputError and outputFinalAttitude on). 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 every 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).

Attitude Profile (Nadir Pointing) -- the attitude that points a body axis at nadir X = the spacecraft's position from the central body's centre, q = its current attitude (scalar first, any length). The target is nadir, t1 = -X, and the constraint a fixed direction t2, both in the frame X and q are given in:

q_align = the rotation from the current attitude to the one that points the body primary alignment vector a1 along t1 and turns the secondary a2 as close to t2 as it can (ICoreAttitudeAlignment, computed in body axes) q_ideal = conj(q_align) (x) q/|q|

READ FROM AND MEASURED AGAINST R2026a's aerolibsatdyn/Attitude Profile (Nadir Pointing), 2026-09-11 -- see ICoreAttitudeAlignmentSupport.cpp for the subsystem it transcribes and the evidence. Nadir is GEOCENTRIC: the block points at the centre, not along the ellipsoid normal (-X matched the real block to 2.7e-14 over 300 random orbits).

⚠ ONE FRAME. The Simulink block can take X in ICRF and the constraint in another frame and convert between them for a date; this block, like the bridge, has X, q and the constraint in the same frame, which is exactly Simulink's ICRF/ICRF configuration and has no date in it.

ALGEBRAIC and STATELESS.

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at Attitude Profile (Nadir Pointing) block: ICore Blocks/Home/Attitude Profile Nadir Pointing. 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 93133d604 · produced by docsSample --out <folder> --blocks Gain_Scheduled_Lead_Lag Controller_1D Controller_Blend_1D Controller_2D Controller_3D Observer_Form_1D Self_Conditioned_1D Line_Of_Sight_Access Orbit_Propagator_Kepler Attitude_Dynamics Attitude_Profile_Nadir_Pointing Attitude_Profile_Geographic_Pointing Multitaper_PSD Cross_Power_Spectral_Density Transfer_Function_Estimate Envelope_Spectrum Compose_String Scan_String --steps 60

Sample data: docs/generated/samples/Robotics__Spacecraft_Dynamics__Attitude_Profile_Nadir_Pointing.json