Owns an ONNX session and samples eight metre-valued control points. More...
#include <dipla_planner.hpp>
Data Structures | |
| struct | State |
| Runtime-owned ONNX session and reusable input/output storage. More... | |
Public Member Functions | |
| Network (const std::string &model, const std::string &metadata, const NetworkOptions &options={}) | |
| Load and validate a deployment model. | |
| ~Network () | |
| Releases the owned ONNX session and inference buffers. | |
| Waypoints | sample (const Belief &belief, const std::array< double, 3 > &position, const Noise &noise) |
| Run the complete deterministic DDIM sampler for a supplied noise vector. | |
Private Attributes | |
| std::unique_ptr< State > | state_ |
Detailed Description
Owns an ONNX session and samples eight metre-valued control points.
Construction validates metadata and tensors; serialize sampling on one instance.
Definition at line 159 of file dipla_planner.hpp.
Constructor & Destructor Documentation
◆ Network()
| dipla::Network::Network | ( | const std::string & | model, |
| const std::string & | metadata, | ||
| const NetworkOptions & | options = {} ) |
Load and validate a deployment model.
Construction performs the expensive one-time graph, metadata, input-name, element-type, and shape checks before the object can sample.
- Parameters
-
model Path to the ONNX model. metadata Path to its bounded deployment JSON metadata. options Optional descriptor and bounded ONNX execution policy.
- Exceptions
-
std::exception If files, metadata, runtime, or tensor contracts are invalid.
Build the entire private state before exposing a usable Network. The pimpl keeps runtime and tensor implementation types out of the public API.
Definition at line 465 of file dipla_planner.cpp.
◆ ~Network()
|
default |
Releases the owned ONNX session and inference buffers.
Pimpl ownership ensures runtime objects are destroyed with the network.
Destroy State through its owner so the session closes before its buffers disappear.
Member Function Documentation
◆ sample()
| Waypoints dipla::Network::sample | ( | const Belief & | belief, |
| const std::array< double, 3 > & | position, | ||
| const Noise & | noise ) |
Run the complete deterministic DDIM sampler for a supplied noise vector.
Belief channels and position are normalized according to model metadata; the eight XYZ outputs are converted back to metres. The supplied noise is not mutated, so identical inputs produce identical waypoints.
- Parameters
-
belief Posterior mean and variance on the fixed world grid. position Current local east, north, and actual altitude in metres. noise Initial 24-value standard-normal sample, grouped as X/Y/Z.
- Returns
- Eight ordered XYZ waypoints in metres.
- Exceptions
-
std::runtime_error If inputs are nonfinite/out of bounds or inference fails.
- Precondition
- One caller at a time owns this network; reusable tensors are mutable.
- Note
- Returned Z is part of the trained tensor contract. The fixed-height demo publishes only XY and must not substitute predicted Z for actual AGL.
This is the complete sampler, not one neural-network pass. Conditioning inputs stay fixed while twenty noise predictions reconstruct one route. The caller supplies initial noise so numerical tests can compare identical inputs without depending on C++ and NumPy generating identical random streams.
- Precision matters
- Match the reference's float32 graph boundary and double-precision DDIM arithmetic. Moving casts or simplifying apparently equivalent expressions can change the trajectory over twenty steps; check reference parity first.
- Note
- The deadline is cooperative and covers the whole plan. It is not a hard real-time guarantee or a fresh allowance for each network call.
- See also
- apply_flight_margin Application-owned XY padding, intentionally absent here.
- Todo
- Share XY and Z normalization bounds with metadata validation and output denormalization. These are training scales, not flight-height settings.
- Todo
- Derive these inverse transforms from the same supported-world contract as input normalization. Changing just one direction rescales routes.
Definition at line 486 of file dipla_planner.cpp.
Field Documentation
◆ state_
|
private |
Exclusive ownership keeps the runtime session lifetime tied to this object.
Definition at line 198 of file dipla_planner.hpp.
The documentation for this class was generated from the following files:
- modules/dipla_cam/dipla_planner.hpp
- modules/dipla_cam/dipla_planner.cpp