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

Attitude Profile Geographic Pointing — Robotics/Spacecraft Dynamics

Robotics/Spacecraft_Dynamics/Attitude_Profile_Geographic_Pointing · 4 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 (Geographic Pointing)

Robotics / Spacecraft Dynamics

The attitude that points a spacecraft axis at a place on the ground, and the rotation that gets there from where it is now. The place is a WGS84 latitude, longitude and altitude, turned into its Earth-fixed position P; the body primary alignment vector a1 is pointed along P − X, and 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|. With a = 6378137 m and e² = f(2 − f), f = 1/298.257223563, N = a/√(1 − e²sin²lat) and P = [(N + alt)cos lat cos lon, (N + alt)cos lat sin lon, (N(1 − e²) + alt)sin lat].

Ports

  • X – the spacecraft's position, [3,1], Earth-fixed (ECEF), in metres.
  • q – the current attitude, [4,1] [w; x; y; z], scalar first, relative to the Earth-fixed frame, in the Aerospace Toolbox's convention (quat2dcm(q) maps Earth-fixed vectors into body axes). It need not be unit length: the block normalizes it.
  • latlon – [2,1] [latitude; longitude] of the place to point at, geodetic, in degrees.
  • alt – [1,1]: its height above the WGS84 ellipsoid, in metres.
  • 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 the place, 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 Earth-fixed 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), with the WGS84 constants, 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 X is in metres, so in hardware X must stay within about 32 km of the Earth's centre (the ground point itself is computed inside, in real arithmetic, and is not limited); an orbital X wraps in the fixed-point conversion.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibsatdyn/Attitude Profile (Geographic 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 LatLonAlt, portFrame and constraintFrame Fixed-frame, outputError and outputFinalAttitude on, tunablePointing off and every vector source Dialog. primaryConstraint is not used in this mode (the target is the place) and does not cross. The block's default ICRF port frame does not cross: it converts the ground point into inertial axes for a date and adds a t_utc port, 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.
  • 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. A spacecraft exactly at the place has no direction to point in and gives NaN, as Simulink does.
  • Verified against R2026a: this block's arithmetic follows the Simulink block to 2.1×10−14 on 300 random states with non-unit attitudes, non-unit, non-perpendicular alignment vectors, latitudes to ±85°, longitudes over two full turns and altitudes of ±5 km.

Code facts#

FactValue
registered typeRobotics/Spacecraft_Dynamics/Attitude_Profile_Geographic_Pointing
familyRobotics/Spacecraft_Dynamics
solver environment classICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Geographic_Pointing
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Spacecraft_Dynamics/Attitude_Profile_Geographic_Pointing/ICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Geographic_Pointing.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Spacecraft_Dynamics/Attitude_Profile_Geographic_Pointing/ICoreBlock_0_Robotics_1_Spacecraft_Dynamics_2_Attitude_Profile_Geographic_Pointing.h
default size on canvas170 × 80 px
ports at insert4 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleX
2inICoreDoubleq
3inICoreDoublelatlon
4inICoreDoublealt
5outICoreDoubleq_align
6outICoreDoubleq_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(Geographic Pointing)
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
always setpointingMode = Point at LatLonAlt, portFrame = Fixed-frame, constraintFrame = Fixed-frame, 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 are Earth-fixed: portFrame and constraintFrame are always Fixed-frame, the configuration in which the Simulink block needs no date and has no t_utc port. primaryConstraint is unused in LatLonAlt 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 (Geographic Pointing) -- the attitude that points a body axis at a place X = the spacecraft's position, Earth-fixed, in metres; q = its current attitude (scalar first, any length); lat, lon (degrees) and alt (metres) = the place to point at, on the WGS84 ellipsoid (a = 6378137 m, f = 1/298.257223563, e2 = f(2 - f)):

N = a / sqrt(1 - e2 sin^2(lat)) P = [(N + alt) cos(lat) cos(lon), (N + alt) cos(lat) sin(lon), (N(1 - e2) + alt) sin(lat)] t1 = P - X, t2 = the configured constraint, both Earth-fixed q_align, q_ideal = ICoreAttitudeAlignment (computed in body axes)

READ FROM AND MEASURED AGAINST R2026a's aerolibsatdyn/Attitude Profile (Geographic Pointing), 2026-09-11 -- see ICoreAttitudeAlignmentSupport.cpp for the subsystem it transcribes and the evidence. With this P, the arithmetic follows the real block to 2.1e-14 over 300 random orbits, attitudes and ground points (latitudes to +-85 deg, longitudes over two turns, altitudes of +-5 km); P itself agrees with lla2ecef to the last digit that matters.

⚠ FIXED-FRAME ONLY. The Simulink block's default ICRF port frame converts the ground point into inertial axes for a date (a t_utc input port appears); this block, like the bridge, is its Fixed-frame/Fixed-frame configuration, which has no date and four inputs.

ALGEBRAIC and STATELESS.

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at Attitude Profile (Geographic Pointing) block: ICore Blocks/Home/Attitude Profile Geographic 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_Geographic_Pointing.json