Skip to content

Fix critical bugs and improve hardware interface robustness#25

Draft
Copilot wants to merge 2 commits intopilla-hw-nodefrom
copilot/analyze-repository-for-improvements
Draft

Fix critical bugs and improve hardware interface robustness#25
Copilot wants to merge 2 commits intopilla-hw-nodefrom
copilot/analyze-repository-for-improvements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 21, 2026

Several bugs were rendering the Arduino IMU node non-functional and a CAN motor control method would crash at runtime. Additionally, the codebase lacked runtime dependency declarations, had a permanently disabled IMU launch, and had no CI.

Critical Bug Fixes

  • arduino_interface.py: finally block inside the read loop closed the serial port after every single line — the node could only ever read one IMU message. Replaced the blocking while loop in __init__ with a create_timer(0.02, ...) callback; cleanup moved to destroy_node()
  • can_joint.py: test_movement() referenced bare axisID (NameError at runtime) instead of self.axisID

Arduino Interface Improvements

  • Serial port and baud rate are now ROS 2 parameters (serial_port, baud_rate) instead of hardcoded values
  • json.JSONDecodeError caught per-frame so bad serial data logs a warning and continues rather than crashing
  • Uses non-deprecated get_logger().warning() instead of warn()

Package Metadata

  • pilla_hw/package.xml: Added missing exec_depend entries — rclpy, sensor_msgs, trajectory_msgs, std_msgs, std_srvs, diagnostic_msgs, python3-serial
  • pilla_teleop/package.xml: Upgraded to package format 3; replaced deprecated run_depend with exec_depend; added missing champ_msgs dependency

Launch Files

  • odrive_nodes_launch.py: Replaced 12 copy-pasted Node(...) blocks with a list comprehension
  • champ_pilla_launch.py: Uncommented the Arduino IMU launch (had been disabled since initial commit); added use_imu launch arg with IfCondition; use_joy is now a launch arg instead of hardcoded 'true'

Arduino Firmware

  • Corrected misleading comment: // 20ms for 50Hz// 10ms for 100Hz to match interval = 10

CI

  • Added .github/workflows/ci.yml with two jobs: flake8 --select=F (undefined names/variables) on Python sources, and a CAN library import validation job

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Analyze quadruped robot repository for missing features Fix critical bugs and improve hardware interface robustness Mar 21, 2026
Copilot AI requested a review from Macbull March 21, 2026 18:11
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.

2 participants