-
Notifications
You must be signed in to change notification settings - Fork 180
Dynamixel Easy SDK Manual Update #1839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- **Tutorials**: Standardize `createReader`/`createWriter` API usage, simplify Python code structure, and unify error handling across Steps 4-7. - **API Reference**: Add missing Connector methods and new Smart Group Control documentation. - **Getting Started**: Correct supported environments and refine installation/build instructions.
- **Step 3 (C++)**: Improve console output using '\r' and 'std::flush' for smoother real-time monitoring instead of newlines. - **Step 5 (Python)**: Add missing 'if __name__ == \"__main__\":' block to ensure the script executes properly.
Summary of ChangesHello @ROBOTIS-zerom, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers a substantial overhaul of the Dynamixel Easy SDK documentation. It introduces the powerful 'Smart Group Control' feature, streamlining multi-motor operations and simplifying error management across C++ and Python examples. The changes aim to make the SDK more intuitive and robust for developers by providing clearer code, comprehensive API references, and improved structural navigation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and valuable update to the Dynamixel Easy SDK documentation and tutorials. The refactoring of group motor control examples to use the new SmartGroup API (createReader/createWriter) greatly improves code clarity and conciseness for both C++ and Python. The unified error handling and updated build instructions are also welcome improvements. My review focuses on ensuring consistency across the new documentation and examples. I've identified a few minor areas for improvement, such as standardizing function signatures and aligning tutorial code examples with the new API reference documentation for better clarity. Overall, this is an excellent enhancement that will significantly improve the developer experience.
| ## [Create Connector](#create-connector) | ||
| - Create a `Connector` object with port name, baud rate, and protocol version. | ||
| ```cpp | ||
| int main(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int motor1_position = result[1]["position"]; | ||
| int motor2_position = result[2]["position"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new api_reference_smart_group.md file documents the get<T>(id, key) method for SmartGroupReader, which returns a std::optional. For consistency and to better demonstrate the new API, I suggest using this method here. This also provides an opportunity to show how to safely unwrap the optional value.
Using result[id][key] might be a convenient shorthand, but get<T>() is more explicit and type-safe. If the [] operator is intended to be a primary way of access, it should also be documented in the API reference.
| int motor1_position = result[1]["position"]; | |
| int motor2_position = result[2]["position"]; | |
| int motor1_position = result.get<int32_t>(1, "position").value(); | |
| int motor2_position = result.get<int32_t>(2, "position").value(); |
| ## [Create Connector](#create-connector) | ||
| - Create a `Connector` object with port name, baud rate, and protocol version. | ||
| ```cpp | ||
| int main(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| follower_writer->write({ | ||
| result[1]["position"], | ||
| result[2]["position"], | ||
| result[3]["position"], | ||
| result[4]["position"], | ||
| result[5]["position"], | ||
| result[6]["position"] | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the feedback on step6_cpp.md, for consistency with the new API reference, it would be clearer to use the get<T>() method. Since read_or_throw() is used, it's reasonable to assume the values will be present, so using .value() to unwrap the std::optional is acceptable here. This makes the code more explicit about the types and the access mechanism.
| follower_writer->write({ | |
| result[1]["position"], | |
| result[2]["position"], | |
| result[3]["position"], | |
| result[4]["position"], | |
| result[5]["position"], | |
| result[6]["position"] | |
| }); | |
| follower_writer->write({ | |
| result.get<int32_t>(1, "position").value(), | |
| result.get<int32_t>(2, "position").value(), | |
| result.get<int32_t>(3, "position").value(), | |
| result.get<int32_t>(4, "position").value(), | |
| result.get<int32_t>(5, "position").value(), | |
| result.get<int32_t>(6, "position").value() | |
| }); |
| - You can compile and run the code using the following commands | ||
| ```bash | ||
| $ g++ dxl_tutorial_step4.cpp -o dxl_tutorial_step4 -l dxl_x64_cpp | ||
| $ g++ dxl_tutorial_step4.cpp -o dxl_tutorial_step4 -ldxl_cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the other tutorials (e.g., tutorial_step1.cpp, tutorial_step2.cpp), the filename in the compile command should probably be tutorial_step4.cpp instead of dxl_tutorial_step4.cpp.
| $ g++ dxl_tutorial_step4.cpp -o dxl_tutorial_step4 -ldxl_cpp | |
| $ g++ tutorial_step4.cpp -o tutorial_step4 -ldxl_cpp |
This PR focuses on making the Dynamixel Easy SDK documentation more consistent, readable, and developer-friendly.
ROBOTIS-GIT/DynamixelSDK#676