Skip to content

Motion Module Application#389

Open
matt001k wants to merge 3 commits into
developfrom
feature/motion_module_app
Open

Motion Module Application#389
matt001k wants to merge 3 commits into
developfrom
feature/motion_module_app

Conversation

@matt001k

Copy link
Copy Markdown
Contributor

What changed?

How does it make Bristlemouth better?

Where should reviewers focus?

Checklist

  • Add or update unit tests for changed code
  • Ensure all submodules up to date. If this PR relies on changes in submodules, merge those PRs first, then point this PR at/after the merge commit
  • Ensure code is formatted correctly with clang-format. If there are large formatting changes, they should happen in a separate whitespace-only commit on this PR after all approvals.

@matt001k matt001k force-pushed the feature/motion_module_app branch from 8ea2618 to 412bf83 Compare May 29, 2026 22:31
@matt001k matt001k changed the title Feature/motion module app Motion Module Application Jun 1, 2026
Adds framework necessary to sample the IMU (LSM6DSV or BNO085)
Adds motion sensing module application logic
Adds DMA to mote SPI BSP along with correct interrupt handling on BM_INT
pin.
@matt001k matt001k force-pushed the feature/motion_module_app branch from 412bf83 to cb9b192 Compare June 1, 2026 21:27
@matt001k matt001k requested a review from mbella-sofar June 10, 2026 21:40
@matt001k matt001k force-pushed the feature/motion_module_app branch from eb9ba9c to a54582c Compare June 11, 2026 01:22
Comment on lines +224 to +226
filt_settling_mask.drdy = PROPERTY_DISABLE;
filt_settling_mask.irq_xl = PROPERTY_DISABLE;
filt_settling_mask.irq_g = PROPERTY_DISABLE;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Disables any filtering the chipset might due, the IMU should be a raw pipeline and any filtering done externally (i.e. by the Stanford team for the CEC project)

Comment thread src/lib/drivers/lsm6dsv.h
lsm6dsv_gy_mode_t mode;
lsm6dsv_data_rate_t rate;
} gyro;
lsm6dsv_data_rate_t sample_rate;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The gyro and accelerometer should be sampled at the same speed as the current streaming operation will only report data at the lowest configured frequency of the two.

Comment on lines +294 to +309
static constexpr uint32_t data_ready_poll_ms = 50;
BmErr err = motionSensorDataReady(data_ready_poll_ms);

if (err == BmENODEV) {
bm_delay(data_ready_poll_ms);
continue;
} else if (err != BmOK) {
continue;
}

MotionSensorReading reading = {};
while (motionSensorGet(&reading) == BmOK) {
bm_debug("imu: %" PRIu64 ",%f,%f,%f,%f,%f,%f\n", reading.ns, reading.acc.x, reading.acc.y,
reading.acc.z, reading.gyro.x, reading.gyro.y, reading.gyro.z);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only logic worth reviewing here. Everything else is boilerplate.

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.

1 participant