Fix#4
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideQualifies VT13 error codes with the LibXR namespace, corrects VT13 gimbal yaw sign handling, and updates the CI build example to use C++20 and a new LibXR::STDIO::Printf signature. Class diagram for VT13 ParseRC and related typesclassDiagram
class VT13 {
+LibXR_ErrorCode ParseRC(const uint8_t* raw_data, CMD_Data& output_data)
}
class CMD_Data {
}
class LibXR_ErrorCode {
<<enum>>
OK
PTR_NULL
CHECK_ERR
}
VT13 ..> CMD_Data : outputs
VT13 ..> LibXR_ErrorCode : returns
Flow diagram for VT13 RC frame parsing and yaw mappingflowchart TD
A["UART loop receives RX_BUFFER"] --> B{"LibXR::ErrorCode::OK from uart_->Read?"}
B -- "No" --> A
B -- "Yes" --> C["Iterate rx_buffer and detect frame"]
C --> D{"Complete frame detected?"}
D -- "No" --> A
D -- "Yes" --> E["Call ParseRC(frame_buffer, rc_data)"]
E --> F{"ParseRC returns LibXR::ErrorCode::OK?"}
F -- "No" --> A
F -- "Yes" --> G["Update last_time_ with Timebase::GetMilliseconds"]
G --> H["Map rc_data to CMD::Data output_data"]
H --> I{"Mouse control mode?"}
I -- "No" --> J["Use other mapping branch"]
I -- "Yes" --> K["Set output_data.gimbal.pit = curr_rc.y * MOUSE_SCALER"]
K --> L["Set output_data.gimbal.yaw = curr_rc.x * MOUSE_SCALER (positive sign)"]
L --> M["Set remaining fields and save last_data_"]
M --> A
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The change from
LibXR::STDIO::Printf("...")toLibXR::STDIO::Printf<"..."]()in the CI test program is almost certainly invalid C++ and/or not the intended API usage; please verify the correct way to callPrintfand adjust accordingly. - The sign change on
gimbal.yawwill invert the yaw control direction relative to previous behavior; if this is intentional, consider adding a brief comment explaining the convention so future changes don’t accidentally flip it back.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The change from `LibXR::STDIO::Printf("...")` to `LibXR::STDIO::Printf<"..."]()` in the CI test program is almost certainly invalid C++ and/or not the intended API usage; please verify the correct way to call `Printf` and adjust accordingly.
- The sign change on `gimbal.yaw` will invert the yaw control direction relative to previous behavior; if this is intentional, consider adding a brief comment explaining the convention so future changes don’t accidentally flip it back.
## Individual Comments
### Comment 1
<location path=".github/workflows/build.yml" line_range="34" />
<code_context>
int main() {
LibXR::PlatformInit();
- LibXR::STDIO::Printf("This is XRobot Module Template Test\n");
+ LibXR::STDIO::Printf<"This is XRobot Module Template Test\n">();
LibXR::HardwareContainer hw;
XRobotMain(hw);
</code_context>
<issue_to_address>
**issue (bug_risk):** The new Printf usage with template syntax is likely invalid C++ and should remain a normal function call.
Using `Printf<"...">()` makes the string a non-type template parameter, which is not valid in standard C++ and will not compile unless `Printf` is a very unusual custom template. This should remain a regular call, e.g. `LibXR::STDIO::Printf("This is XRobot Module Template Test\n");` or whatever the correct API overload is.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| int main() { | ||
| LibXR::PlatformInit(); | ||
| LibXR::STDIO::Printf("This is XRobot Module Template Test\n"); | ||
| LibXR::STDIO::Printf<"This is XRobot Module Template Test\n">(); |
There was a problem hiding this comment.
issue (bug_risk): The new Printf usage with template syntax is likely invalid C++ and should remain a normal function call.
Using Printf<"...">() makes the string a non-type template parameter, which is not valid in standard C++ and will not compile unless Printf is a very unusual custom template. This should remain a regular call, e.g. LibXR::STDIO::Printf("This is XRobot Module Template Test\n"); or whatever the correct API overload is.
Summary by Sourcery
Update VT13 RC parsing to use fully-qualified LibXR error codes and adjust CI build configuration and sample code for the XRobot module template.
Bug Fixes:
Build:
CI: