scenarioMovingCamera
Overview
Demonstrate two independently moving instrument cameras on a spacecraft in a
circular Earth orbit with a prescribed, fixed attitude. This implements the
moving-platform approach suggested in
issue 1309.
Rotation and translation commands enter native motion profilers through
messages. No per-step assignment to camera.sigma_CB or cameraPos_B
is needed, and no new camera input port is introduced.
Each camera is fixed to a C++ Module: prescribedMotionStateEffector platform P.
The platform’s configuration output supplies its inertial pose to Vizard.
Its visualization name becomes the camera’s parentName. Consequently,
cameraPos_B and sigma_CB in the camera configuration are interpreted
relative to P, even though the payload retains its B-frame field names.
Set r_PcP_P to zero so the platform’s logged center of mass and camera
parent-frame origin coincide.
The platforms are massless kinematic frames, not a model of actuator torques
or hardware inertia. The spacecraft attitude is prescribed using an
AttRefMsg. The first platform rotates about its local y axis and translates
along x; the second rotates about x with a differently oriented mount. At
15 seconds, new commands change both rotations and the first translation.
This illustrates independent pose commands, not closed-loop target tracking.
The spacecraft starts at 500 km altitude with both cameras facing Earth.
Earth supplies point-mass gravity, while the host attitude stays fixed in the
inertial frame throughout the orbit.
Run from the repository root:
python examples/scenarioMovingCamera.py
The native dynamics and numerical results also run without vizInterface.
With that feature available, the scenario registers the platform poses and
two camera configurations for Vizard, with camera frustums displayed. The
host uses the default spacecraft model, while the platforms are gray boxes.
The saveFile setting exports a replay. Rendering images requires Vizard; the
offline tests check native pose messages and camera-parent wiring, not rendered
pixels.
- scenarioMovingCamera.run(show_plots=False, enable_viz=True)[source]
Execute two message-driven camera-platform maneuvers.
- Parameters:
show_plots – Display platform position and attitude histories.
enable_viz – Register instrument cameras when visualization is built.
- Returns:
Dictionary of recorded hub/platform states, profiler references, command values, camera-parent names, and visualization message buffers.