Makes reading from line sensor more robust, and updates the calibration procedure - #145
Open
hello-ola wants to merge 15 commits into
Open
Makes reading from line sensor more robust, and updates the calibration procedure #145hello-ola wants to merge 15 commits into
hello-ola wants to merge 15 commits into
Conversation
…and add a plot to visualzie raw data
…y_server, update calibration to add an inspect option
Contributor
|
Works as expected! |
hello-robot-shehab
left a comment
Contributor
There was a problem hiding this comment.
$ stretch_line_sensor_hz_check
body server is not serving line_sensor_loop -- opening /dev/hello-pixart-j3 directly
[08/14/2026 19:40:42] [line_sensor_loop] [INFO]: Starting LineSensorLoop...
[08/14/2026 19:40:42] [line_sensor_loop] [INFO]: -------- Starting Line_sensor_loop with PID 17133 --------
[08/14/2026 19:40:43] [line_sensor_loop] [INFO]: Line sensor calibration: 6/6 sensors loaded
reading /dev/hello-pixart-j3 directly (no body server on the sensors)
settling ...
settled after 1.5s
measuring 6 sensors for 30s ...
[08/14/2026 19:41:14] [line_sensor_loop] [INFO]: Line_sensor_loop EXIT!
[08/14/2026 19:41:14] [line_sensor_loop] [INFO]: Exiting Line_sensor_loop Loop
sensor fresh Hz board Hz new frames skips max gap backwards
sensor_0 30.10 30.10 903 0 1 0
sensor_1 30.13 30.13 904 0 1 0
sensor_2 30.10 30.10 903 0 1 0
sensor_3 30.10 30.10 903 0 1 0
sensor_4 30.10 30.10 903 0 1 0
sensor_5 30.13 30.13 904 0 1 0
server-reported rate_hz: 27.2 decode_errors: 0
PASS: every sensor is streaming new (never repeated, never backwards) frames at >= 29Hz
hello-robot-shehab
approved these changes
Aug 15, 2026
hello-robot-shehab
left a comment
Contributor
There was a problem hiding this comment.
Tested on 4024, calibration works and line sensors seem to work well from driving around.
| rs["timestamp"] = time.time() | ||
|
|
||
| # Filter out raw line sensor arrays | ||
| if 'line_sensor_loop' in rs and isinstance(rs['line_sensor_loop'], dict): |
Contributor
There was a problem hiding this comment.
Could this be just del rs['line_sensor_loop'] instead of this forloop?
hello-robot-shehab
requested changes
Aug 17, 2026
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.
This PR has the following updates
All line sensor tools go through line_sensor/connect.py: use the server if up, else open /dev/hello-pixart-j3 directly.
add a REx_line_sensor_migrate_tares if people want to migrate the older version.
stretch_system_check
Line sensor section now always reports the hz and passes if hz > 25.
Cleanup
To test:
0. test that the migration works. after installing the new version. make sure you dont have a tare folder in calibration_line_sensors. after restarting the server if you have linesensor loop enabled or after running stertch_line_sensor* script it should create a tare file from your old data.
stretch_line_sensor_ranges
stretch_line_sensor_z_band
stretch_line_sensor_hz_check
stretch_line_sensor_viz_3d
And system check reports correctly if line sensors are up or not.
stretch_system_checkif stretch_body_server doesnt enable line sensor, make sure line sensor dont fail they measure the hz directly and say that the loop is not enabled