Skip to content

2026sp Teensy and Jetson Integration#137

Open
nizhnerk wants to merge 65 commits into
mainfrom
teensy_2026sp
Open

2026sp Teensy and Jetson Integration#137
nizhnerk wants to merge 65 commits into
mainfrom
teensy_2026sp

Conversation

@nizhnerk
Copy link
Copy Markdown
Member

@nizhnerk nizhnerk commented May 7, 2026

Handling sailing with a jib this season required some new logic, both for physical servo actuation on the Teensy and for higher-level sailing decisions and ROS plumbing on the Jetson. We also took this as an opportunity to debug and better modularize existing code on both sides, and generally bring the codebase up to date (documentation, terminology conventions, style, etc). Here is a summary of the most important additions:

Teensy side

  • Implement logic to manage and actuate the two jib servos without having them servos mechanically restrict each other.
  • Performance improvement: changed our preexisting linear mapping of sail angles to PWM values to use the law of cosines.
  • General tuning of constants and physical parameters to match this year's boat (this is still in progress and is marked with TODO flags where appropriate).

Jetson/ROS side

  • Redo the trim_sail.py ROS node logic in order to consistently map the jib similarly to the mainsail.
  • Add subscribers and publishers for the new jib parameters (angle and flag to indicate which side it is set on).
  • Add a global constants.py file in the same way that we have a constants.hpp file on the Teensy side.

We naturally had to update the Serial protocols globally so that both sides were prepared to receive and send the same information back and forth.

nizhnerk and others added 30 commits April 12, 2026 17:51
…eason. BIGGEST CHANGES: 1) different PWM values for rudder and sail, 2) using law of cosines for sail instead of linear mapping. Added some constants to constants.hpp accordingly.
…eady to flesh out with jib servo information.
…dge while still leaving placeholders in for jib control behavior still.

- Teensy code is updated to include jib port/starboard bytes, expand the serial buffers, add jib servo attach/init plus mapping helpers, and pass jib telemetry through teensy.py/teensy_node.py so jib values are visible in ROS.
- We still need to finalize jib hardware constants and calibration (constants.hpp), implement actual jib actuation/linked-side logic in ServoControlTask::execute(), and define the final jib protocol conventions (bounds/sign/offset + command topic wiring) before enabling full closed-loop jib control.
Drop stale partial packets between loop iterations and while processing incoming bytes so malformed or delayed frames recover cleanly.

Made-with: Cursor
- Reorganized SerialMonitor.cpp for clarity and removed immediate writing into sfr fields (this is handled in ServoControlTask). Added a helper method.
- Removed redundant send_telemetry flag from sfr and added a buffer_length field.
nizhnerk and others added 14 commits May 3, 2026 20:02
Mux subscribes to per-source jib_angle and jib_side_flag, forwards both
topics only when values are present for the active mode. Teensy node
subscribes to jib_angle and jib_side_flag, merges them with sail and
rudder in _send_command_to_teensy for a single serial packet. Remove
unused SailTail import; clarify rx_period comment.
…ion logic, added functionality for jib, standardize convention wrt "mainsail".
…e do bounds check on the serial values; rudder angle updated to 2025-2026 season; documentation updates.
…" when talking specifically about the mainsail instead of just "sail".
…ions to use "mainsail" when talking specifically about the mainsail instead of just "sail".
…onding files. Reviewed ROS side algo codebase; now ready for PR.
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.

4 participants