Skip to content

chore(imu): align package with the IDMind bible - #4

Open
cneves-idmind wants to merge 1 commit into
masterfrom
chore/bible-compliance
Open

cneves-idmind wants to merge 1 commit into
masterfrom
chore/bible-compliance

Conversation

@cneves-idmind

Copy link
Copy Markdown
Contributor

Audits idmind_imu master against ~/idmind-bible (ROS 2 + Python guides) and fixes the deviations that are safe on this legacy Python node. Branched from master after #3.

Fixed

Bible section Change
Documentation README.MD rewritten to match the source — v2 node, namespaced topics, full topic/service/parameter tables (type + default). The old file used the wrong topic prefix, called ~/euler degrees (it publishes radians), and omitted ~/gravity, ~/calibration, ~/timer, the auto_reconnect parameter and the ~/standby service.
Dependencies Added requirements.txt for the pip-only tinkerforge bindings (not in rosdep). Referenced from the README and CLAUDE.md.
Logging imu_brick_node_v2.main() logs shutdown through the ROS logger instead of print().
Code Style / PEP 8 / PEP 257 Fixed the ament_flake8 (E501, E221) and ament_pep257 (D401, D213) findings in imu_brick_node_v2.py and setup.py. Excluded the frozen legacy imu_brick_node.py from the style linters (kept for reference per CLAUDE.md, deliberately not restyled). Populated the empty .gitignore.

colcon build clean; colcon test now green (was failing flake8 + pep257 on master). Node behaviour verified unchanged with a stubbed-import harness (services register, standby suspends/resumes publishing).

Not addressed — needs the C++ refactor, not a patch here

These are real bible deviations but each is an architectural change to an untested hardware node, and the refactor-cpp branch already addresses all of them:

  • Nodes / single responsibility — hardware I/O is not separated from ROS.
  • ExecutorsMultiThreadedExecutor(num_threads=6); bible prefers SingleThreadedExecutor.
  • Message Interfaces~/euler, ~/timer, ~/calibration use std_msgs primitives (Float32 / UInt8MultiArray).
  • Testing — no functional/integration tests, only lint boilerplate.

~/standby uses std_srvs/SetBool, consistent with the existing ~/ready (std_srvs/Trigger); switch to an idmind_base_msgs equivalent if one is preferred.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CkJzZY8CRBa3MgTyEimHZj

Documentation (bible: Documentation)
- README.MD rewritten to match the source: v2 node, namespaced topics,
  full topic/service/parameter tables with types and defaults. The old
  README described the wrong node prefix, called `euler` degrees (it is
  radians) and omitted several publishers, the `auto_reconnect` param
  and the `standby` service.

Dependencies (bible: Dependencies)
- Add requirements.txt for the pip-only `tinkerforge` bindings, which
  rosdep cannot provide.

Logging (bible: Logging)
- imu_brick_node_v2 main() logs shutdown through the ROS logger instead
  of print().

Style / PEP 8 / PEP 257 (bible: Code Style)
- Fix the flake8 (E501, E221) and pep257 (D401, D213) findings in
  imu_brick_node_v2.py and setup.py so `colcon test` is green.
- Exclude the frozen legacy imu_brick_node.py from the style linters
  (it is kept for reference per CLAUDE.md and deliberately not restyled).
- Populate the empty .gitignore.

Not addressed here (tracked for the C++ refactor track): node logic is
not separated from ROS, MultiThreadedExecutor vs SingleThreadedExecutor,
`std_msgs` primitive topics (euler/timer/calibration), and the absent
functional test suite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CkJzZY8CRBa3MgTyEimHZj
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