Skip to content

Commit

Permalink
strand-cam: update MomentCentroid definition
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Aug 12, 2024
1 parent dfd3325 commit 3d6e934
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions strand-cam/src/frame_process_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use ads_apriltag as apriltag;

use crate::{
convert_stream, open_braid_destination_addr, post_trigger_buffer, video_streaming,
FinalMp4RecordingConfig, FmfWriteInfo, FpsCalc, MomentCentroid, Msg, TimestampSource, ToDevice,
LED_BOX_HEARTBEAT_INTERVAL_MSEC, MOMENT_CENTROID_SCHEMA_VERSION,
CentroidToDevice, FinalMp4RecordingConfig, FmfWriteInfo, FpsCalc, MomentCentroid, Msg,
TimestampSource, LED_BOX_HEARTBEAT_INTERVAL_MSEC, MOMENT_CENTROID_SCHEMA_VERSION,
};

/// Perform image analysis
Expand Down Expand Up @@ -838,9 +838,9 @@ pub(crate) async fn frame_process_task<'a>(

// If mu00 is 0.0, these will be NaN. CBOR explicitly can represent NaNs.

let mc = ToDevice::Centroid(MomentCentroid {
let mc = CentroidToDevice::Centroid(MomentCentroid {
schema_version: MOMENT_CENTROID_SCHEMA_VERSION,
framenumber: block_id.unwrap().get().try_into()?,
framenumber: block_id.unwrap().get(),
timestamp: save_mp4_fmf_stamp,
timestamp_source,
mu00,
Expand Down
4 changes: 2 additions & 2 deletions strand-cam/src/strand-cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ const MOMENT_CENTROID_SCHEMA_VERSION: u8 = 2;
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub struct MomentCentroid {
pub schema_version: u8,
pub framenumber: u32,
pub framenumber: u64,
pub timestamp_source: TimestampSource,
pub timestamp: chrono::DateTime<chrono::Utc>,
pub mu00: f32,
Expand All @@ -597,7 +597,7 @@ pub struct MomentCentroid {
}

#[derive(Debug, Serialize, Deserialize)]
enum ToDevice {
enum CentroidToDevice {
Centroid(MomentCentroid),
}

Expand Down

0 comments on commit 3d6e934

Please sign in to comment.