Skip to content

Improve IMU data structure for timestamp logging#44

Open
WT-MM wants to merge 12 commits intomasterfrom
freq
Open

Improve IMU data structure for timestamp logging#44
WT-MM wants to merge 12 commits intomasterfrom
freq

Conversation

@WT-MM
Copy link
Contributor

@WT-MM WT-MM commented Apr 30, 2025

Problem

Hiwonder has a timestamp field we want to access. Also, we want to know the effective frequency of the imu reader (i.e. how often we are receiving new data)

Solution

  • Expanded ImuData to include timestamp and effective frequency
  • Add new_data counting logic to hiwonder
  • Add match case for timestamp frames from hiwonder

Validation

  • Manual test steps documented (screenshots, steps, etc.) below:
image

^^ running cargo run --bin read_hiwonder

Checklist

  • I've completed all the documentation steps above (problem, solution, validation).
  • I confirm there's no AI slop in this PR.
  • I've updated the documentation to reflect my changes.

@WT-MM WT-MM marked this pull request as ready for review April 30, 2025 08:57
@jingxiangmo jingxiangmo requested a review from Copilot April 30, 2025 20:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR expands the IMU data structure to include a timestamp and effective frequency field, while adding logic to parse new timestamp frames from the Hiwonder device and updating dependency versions.

  • Expanded ImuData in imu-traits to support timestamps and effective frequency.
  • Updated Hiwonder reader to parse and assign timestamp information from device-provided time fields.
  • Bumped dependency versions across multiple Cargo.toml files.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
imu/imu-traits/src/lib.rs Expanded ImuData with timestamp and effective_frequency fields.
imu/drivers/hiwonder/src/lib.rs Added parsing logic for timestamp frames and effective frequency update.
imu/drivers/*/Cargo.toml Updated version numbers and dependencies accordingly.
imu/bindings/src/lib.rs Added Python binding for Timestamp.
imu/init.py Updated module exports with Timestamp.
Cargo.toml Bumped workspace version.
Comments suppressed due to low confidence (1)

imu/drivers/hiwonder/src/lib.rs:398

  • The addition of 1 to the year value may be incorrect because years are not 1-indexed. Verify whether this offset is intentional or if it unintentionally shifts the timestamp year.
year as i32 + 1,

@jingxiangmo jingxiangmo changed the title more hiwonder data Improve IMU data structure for timestamp logging Apr 30, 2025
@jingxiangmo
Copy link
Contributor

Found and discussed error with warmup time. Please refer to Scott's implementation: https://github.com/kscalelabs/kos-zbot/blob/master/kos_zbot/imu.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants