Add waybionic_sensors IMU package with correct raw sensor semantics and diagnostics - #11
Open
khuzaymahbinharis-jpg wants to merge 1 commit into
Open
Add waybionic_sensors IMU package with correct raw sensor semantics and diagnostics#11khuzaymahbinharis-jpg wants to merge 1 commit into
khuzaymahbinharis-jpg wants to merge 1 commit into
Conversation
Adds an IMU publisher built from current main, carrying over only the waybionic_sensors directory from the earlier IMU branch. That branch predated the merged foundation, so replaying it would have reverted CI and other files that landed since. The publisher no longer presents generated data as measurement. An accelerometer and a gyroscope cannot observe absolute heading, so the raw topic sets orientation_covariance[0] = -1 and the synthetic orientation moved to its own data_demo topic, off by default. The rotating TF became opt-in for the same reason. Covariances are populated from parameterised standard deviations rather than left at zero, which a consumer would read as perfect certainty. Sensor health now reaches the merged diagnostics panel: imu.heartbeat publishes at 2 Hz and reports STALE past a configurable sample age, including when live mode runs with no hardware attached. The node is split into a hardware-independent reading type, a mock source, a driver interface, a message builder, and a diagnostics builder, so adding a real sensor means implementing one interface rather than editing the publisher. No serial protocol is invented; docs/HARDWARE_INTERFACE.md records the open questions for electrical. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
waybionic_sensors: an IMU publisher with honest raw-sensor semantics,/diagnosticshealth reporting, and a documented boundary for the hardware driver that does not exist yet.Branched from current
main, carrying over only thewaybionic_sensorsdirectory fromfeature/imu-rviz-integration. That branch predated the merged foundation, so replaying it would have reverted CI,CONTRIBUTING.md, and other files that landed since. Nothing outsidewaybionic_sensorsis touched, so this does not depend on and does not conflict with #10.What changed relative to the old IMU branch
data_raworientation_covariance[0] = -1; synthetic orientation moved to/waybionic/imu/data_demo, off by defaultpublish_demo_tf, default false; enabled only byimu_demo.launch.py/diagnosticsoutputimu.heartbeatplus rate and telemetry at 2 Hzserial_portwith no readerRaw versus fused orientation
An accelerometer and a gyroscope cannot observe absolute heading. Publishing a generated quaternion on the raw topic would let a future fusion or localisation node consume invented data as though it were measured.
/waybionic/imu/data_rawalways setsorientation_covariance[0] = -1, the standardsensor_msgs/msg/Imumarker for absent orientation, and leaves the quaternion at identity as a placeholder. The synthetic orientation lives on/waybionic/imu/data_demo, is off by default, and is named so it cannot be mistaken for a measurement.imu.roll,imu.pitch, andimu.yawfrom the backend integration doc are deliberately not published for the same reason. They belong to a real fusion source.Module boundaries
imu_reading.pymock_source.pyhardware_reader.pyimu_messages.pysensor_msgs/Imuand TF construction, covariance rulesimu_diagnostics.pyDiagnosticArrayconstruction, freshness logicimu_publisher_node.pyTwo structural tests keep this from collapsing back: the node must not construct
Imu()orDiagnosticStatusitself.Diagnostics
Names,
value/unitkeys, and level mapping followwaybionic_rviz_plugins/docs/DIAGNOSTICS_BACKEND_INTEGRATION.md, so the merged panel renders these with no IMU-specific code.imu.heartbeatsimu.rateHzimu.angular_velocityrad/simu.linear_accelerationm/s^2Addresses the
imu.heartbeathalf of #4.Hardware handoff
No serial protocol is implemented, because the sensor model, transport, and packet format are unconfirmed.
docs/HARDWARE_INTERFACE.mdcarries 18 numbered questions for electrical across sensor, transport, data format, and integration, plus the known unknowns and the recipe for adding the driver.A structural test asserts nothing was invented (
import serial,baudrate,struct.unpack).Live mode is still useful today: with
use_mock:=falsethe node publishes no samples andimu.heartbeatreports STALE, which is what an absent sensor should look like.Runtime evidence (Ubuntu 24.04 / ROS 2 Jazzy / WSL2)
ros2 topic hz /waybionic/imu/data_raw:ros2 topic echo /waybionic/imu/data_raw --once:ros2 topic hz /diagnosticsreportsaverage rate: 2.000, above the 1 Hz requirement.Heartbeat while streaming:
Heartbeat after
mock_stall_after_sec:=3.0:Heartbeat with
use_mock:=false:/waybionic/imu/data_demodoes not appear inros2 topic liston a default launch, confirming the demo output stays off unless requested.Tests
Full workspace (
waybionic_description,waybionic_bringup,waybionic_rviz_plugins,waybionic_sensors) builds and tests with zero failures.test_imu_messages.pytest_imu_diagnostics.pytest_imu_publisher_node.pytest_mock_source.pytest_hardware_reader.pytest_package_metadata.pytest_flake8.py,test_pep257.pyHow to review
To see it in the panel, run the publisher alongside
ros2 launch waybionic_rviz_plugins engineer_view.launch.py use_mock_diagnostics:=false.Known limitations
docs/HARDWARE_INTERFACE.md.base_linktoimu_linkoffset in the demo TF is a placeholder 0.1 m, not a mounting claim.