pub struct SceneMap {
pub objects: Vec<MapObject>,
pub updated_at: f64,
}Expand description
The engine’s current output: the full state of the 2D map at a point in time.
Fields§
§objects: Vec<MapObject>§updated_at: f64Implementations§
Source§impl SceneMap
impl SceneMap
pub fn to_geojson(&self) -> FeatureCollection
Sourcepub fn to_geojson_json(&self) -> Result<String>
pub fn to_geojson_json(&self) -> Result<String>
Examples found in repository?
examples/basic_usage.rs (line 34)
21fn main() {
22 let mut engine = Engine::new();
23
24 // Two sightings of the same chair, 0.5s apart, fuse into one
25 // MapObject instead of piling up as two separate detections.
26 engine.ingest_frame(chair_frame(0.0));
27 let scene_map = engine.ingest_frame(chair_frame(0.5));
28
29 let chair = &scene_map.objects[0];
30 println!(
31 "fused '{}' at ({:.2}, {:.2}), confidence {:.2} from {} observation(s)",
32 chair.label, chair.x, chair.y, chair.confidence, chair.observation_count
33 );
34 println!("\nfull SceneMap as GeoJSON:\n{}", scene_map.to_geojson_json().unwrap());
35}Trait Implementations§
Source§impl<'de> Deserialize<'de> for SceneMap
impl<'de> Deserialize<'de> for SceneMap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for SceneMap
impl Message for SceneMap
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for SceneMap
Auto Trait Implementations§
impl Freeze for SceneMap
impl RefUnwindSafe for SceneMap
impl Send for SceneMap
impl Sync for SceneMap
impl Unpin for SceneMap
impl UnsafeUnpin for SceneMap
impl UnwindSafe for SceneMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more