TC: fix working width discovery#618
Conversation
Also adds extra measurement commands logging and clarifies some documentation
According to: https://www.isobus.net/isobus/attachments/345/ISO11783-11-DDI-290-SetpointWorkState-v1.pdf Each Section Device Element shall at least provide one type of Working Width. If more than one type of Working Width is provided, then the Section Controller shall be capable to use the different Working Width types with the following priority: 1. Actual Working Width (DDI 67) 2. Maximum Working Width (DDI 70) 3. Default Working Width (DDI 68)
…IsoStack-plus-plus into tc-fix-working-width
width_mm is kept for backward compatibility.
|
@GwnDaan I made the changes but not sure why the Build started to fail. It doesn't make sense. previous build only had clang-format error... |
… into tc-fix-working-width
…ssDDOP stated dopLocalizationLabel is a std::array<std::uint8_t, 7>, so .empty() always returns false. This prevented process_labels_from_ddop() from ever being called for user-provided binary DDOPs, causing the state machine to proceed with uninitialized label data. Replaced with a comparison against a zero-initialized array to correctly detect the sentinel "not yet populated" state.
|
@ad3154 @martonmiklos something isn't right with our tests .. for me they seem to fail randomly... |
Yeah, it's the timing related stuff... the tests do actual thread delays and read actual system time everywhere, which is prone to unpredictability. Ideally we just need to add an abstraction to our timing interface to allow overriding it from a test environment. Adding this abstraction would also greatly speed up the tests.... |
I have opened a PR that should finally completely fix the random test failures. It was not fun, but it needed to happen, haha. |
Add width priority logic (Actual > Maximum > Default) to SubBoom class to match Section class implementation. Previously, SubBoom only parsed ActualWorkingWidth and ignored MaximumWorkingWidth and DefaultWorkingWidth. Changes: - Add actualWorkingWidth_mm, maximumWorkingWidth_mm, and defaultWorkingWidth_mm fields to SubBoom class - Implement SubBoom::get_width_with_priority() method - Update parse_sub_boom() to parse all three width DDIs - Add comprehensive unit tests for width priority with DeviceProperty and DeviceProcessData objects - Apply clang-format to all modified files This ensures consistent width discovery behavior across all element levels (Section, SubBoom, Boom) as per ISO 11783-10 specification.
…IsoStack-plus-plus into tc-fix-working-width
|
Added a few more tests and implemented the same for the booms. |
I noticed that the Müller Elektronik sprayer working widths weren't correct.
Now it has fallbacks according to: https://www.isobus.net/isobus/attachments/345/ISO11783-11-DDI-290-SetpointWorkState-v1.pdf
Each Section Device Element shall at least provide one type of Working Width. If
more than one type of Working Width is provided, then the Section Controller shall be
capable to use the different Working Width types with the following priority: