Documentation
¶
Index ¶
- func RunTransformers(transformers []Transformer, head map[string]*pb.Entity, bus Bus, ...) (upserted, removed []string)
- type AOUTransformer
- type Bus
- type CameraTransformer
- type ChatTransformer
- type ClassificationTransformer
- type MediaTransformer
- type PolarNormalizeTransformer
- type PoseTransformer
- type ShapeTransformer
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTransformers ¶
func RunTransformers(transformers []Transformer, head map[string]*pb.Entity, bus Bus, changedID string) (upserted, removed []string)
RunTransformers runs all transformers for a changed entity, applying upserts and removes to head and notifying the bus. Returns the IDs of upserted and removed entities so callers can sync secondary stores.
Types ¶
type AOUTransformer ¶ added in v0.0.20
type AOUTransformer struct {
// contains filtered or unexported fields
}
AOUTransformer computes an Area of Uncertainty (AOU) shape for entities that have a DetectionComponent and sufficient sensor accuracy data (MIL-STD-2525C §5.3.4.11.1).
Two cases:
- Ellipse AOU: entity has detection + geo + geo.covariance → rotated ellipse polygon written to entity.Shape (GeoShapeComponent).
- Line-of-bearing AOU: entity has detection + bearing + no geo + pose.parent → wedge/line LocalShapeComponent relative to the sensor parent. ShapeTransformer converts it to WGS84.
func NewAOUTransformer ¶ added in v0.0.20
func NewAOUTransformer() *AOUTransformer
type Bus ¶
type Bus interface {
Dirty(id string, entity *pb.Entity, changeType pb.EntityChange)
}
Bus is an interface for the subset of engine.Bus that transformers need.
type CameraTransformer ¶
type CameraTransformer struct {
// contains filtered or unexported fields
}
CameraTransformer generates a LocalShapeComponent coverage wedge for an entity's CameraComponent when fov and range are set. Generated shape entities have IDs of the form "{entityID}~coverage~0". All generated IDs are written into SensorComponent.coverage on the source entity.
func NewCameraTransformer ¶
func NewCameraTransformer() *CameraTransformer
type ChatTransformer ¶ added in v0.0.20
type ChatTransformer struct {
// contains filtered or unexported fields
}
func NewChatTransformer ¶ added in v0.0.20
func NewChatTransformer() *ChatTransformer
func (*ChatTransformer) SetNodeEntityID ¶ added in v0.0.20
func (ct *ChatTransformer) SetNodeEntityID(id string)
SetNodeEntityID sets the local node entity ID used to stamp outgoing chat messages.
type ClassificationTransformer ¶
type ClassificationTransformer struct{}
ClassificationTransformer derives a ClassificationComponent from the MIL-STD-2525C symbol code in SymbolComponent when no explicit ClassificationComponent is present.
MIL-STD-2525C SIDC positions:
- Position 2 (index 1): Identity/Affiliation
- Position 3 (index 2): Battle Dimension
func NewClassificationTransformer ¶
func NewClassificationTransformer() *ClassificationTransformer
type MediaTransformer ¶ added in v0.0.20
type MediaTransformer struct {
// contains filtered or unexported fields
}
MediaTransformer rewrites CameraComponent stream URLs to point through the engine's media proxy endpoints. Raw source URLs pushed by builtins are stored internally and replaced with proxy URLs in the entity.
This ensures consumers (frontend, federation) only see proxy URLs, while the proxy handlers can look up the original source URL.
func NewMediaTransformer ¶ added in v0.0.20
func NewMediaTransformer() *MediaTransformer
func (*MediaTransformer) GetSourceURL ¶ added in v0.0.20
func (mt *MediaTransformer) GetSourceURL(entityID string, streamIndex int) string
GetSourceURL returns the original source URL for an entity's stream. This is used by proxy handlers to connect to the actual camera.
type PolarNormalizeTransformer ¶ added in v0.0.20
type PolarNormalizeTransformer struct{}
PolarNormalizeTransformer ensures that PolarOffset entities have both the convenience error fields (azimuth_error_deg, elevation_error_deg, range_error_m) and the CovarianceMatrix populated. If only one form is set, it fills in the other. This must run before PoseTransformer so that downstream consumers see both forms.
func NewPolarNormalizeTransformer ¶ added in v0.0.20
func NewPolarNormalizeTransformer() *PolarNormalizeTransformer
type PoseTransformer ¶
type PoseTransformer struct {
// contains filtered or unexported fields
}
PoseTransformer resolves PoseComponent into absolute GeoSpatialComponent and OrientationComponent by walking the parent chain. When a parent entity changes, all children referencing it are re-resolved.
For CartesianOffset: the ENU offset is applied to the parent's geo position. For PolarOffset with range: azimuth/elevation/range are converted to ENU, then applied. For PolarOffset without range (bearing-only): no geo is produced, but BearingComponent is set.
func NewPoseTransformer ¶
func NewPoseTransformer() *PoseTransformer
type ShapeTransformer ¶
type ShapeTransformer struct {
// contains filtered or unexported fields
}
ShapeTransformer resolves LocalShapeComponent (ENU local shapes) with a non-empty RelativeTo into GeoShapeComponent (WGS84 geo shapes) on the same entity. It looks up the parent entity's GeoSpatialComponent and OrientationComponent to perform the transform.
func NewShapeTransformer ¶
func NewShapeTransformer() *ShapeTransformer
type Transformer ¶
type Transformer interface {
// Validate is called BEFORE merge. Return error to reject the push.
Validate(head map[string]*pb.Entity, incoming *pb.Entity) error
// Resolve is called AFTER an entity is merged into head.
// Returns entities to upsert and entity IDs to delete.
Resolve(head map[string]*pb.Entity, changedID string) (upsert []*pb.Entity, remove []string)
}
Transformer is a callback-based interface for managing derived entities. Transformers watch pushes and GC events to maintain generated entities that are derived from source entities (e.g. sensor coverage from sensor range).