Ai patch test#256
Open
SahajGupta05 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for moving follower arms to a configured joint-space “initial position” before each episode begins, and updates example config/output to reflect the new behavior.
Changes:
- Add
pre_episode()toTrossenArmComponentand parseinitial_position/initial_position_time_sfrom JSON config. - Extend
ArmConfigto include the new initial-position fields in JSON serialization/deserialization. - Update the
trossen_mobile_aiexample config and console output for clearer episode lifecycle UX.
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/hw/arm/trossen_arm_component.cpp | Parses new config fields and implements blocking pre_episode() move for follower arms. |
| include/trossen_sdk/hw/arm/trossen_arm_component.hpp | Documents new config keys and adds pre_episode() + member fields. |
| include/trossen_sdk/configuration/types/hardware/arm_config.hpp | Adds initial-position fields to typed config + JSON (de)serialization. |
| examples/trossen_mobile_ai/trossen_mobile_ai.cpp | Enhances console output around pre-episode/record/reset and re-record behavior. |
| examples/trossen_mobile_ai/config.json | Sets initial-position fields for follower arms in the example config. |
| ai_update.patch | Adds a patchfile that duplicates changes already present in the PR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
59
to
70
| nlohmann::json to_json() const { | ||
| return nlohmann::json{ | ||
| nlohmann::json j{ | ||
| {"ip_address", ip_address}, | ||
| {"model", model}, | ||
| {"end_effector", end_effector} | ||
| {"end_effector", end_effector}, | ||
| {"initial_position_time_s", initial_position_time_s} | ||
| }; | ||
| if (!initial_position.empty()) { | ||
| j["initial_position"] = initial_position; | ||
| } | ||
| return j; | ||
| } |
Comment on lines
+50
to
+55
| if (j.contains("initial_position")) { | ||
| j.at("initial_position").get_to(c.initial_position); | ||
| } | ||
| if (j.contains("initial_position_time_s")) { | ||
| j.at("initial_position_time_s").get_to(c.initial_position_time_s); | ||
| } |
Comment on lines
+391
to
+400
| // --- INSERTED CODE (Replaces std::cout << "Recording...\n";) --- | ||
| std::cout << "\n==================================================\n"; | ||
| std::cout << "▶ RECORDING ACTIVE\n"; | ||
| std::cout << " Waiting for timeout or operator input...\n\n"; | ||
| std::cout << "CONTROLS:\n"; | ||
| std::cout << " [Left Arrow] Interrupt & Discard current episode\n"; | ||
| std::cout << " [Right Arrow] Finish episode early\n"; | ||
| std::cout << " [Ctrl+C] End session safely\n"; | ||
| std::cout << "==================================================\n" << std::flush; | ||
| // --- END INSERTED CODE --- |
Comment on lines
+1
to
+4
| diff --git a/examples/trossen_mobile_ai/config.json b/examples/trossen_mobile_ai/config.json | ||
| index 5058e28..4df60a2 100644 | ||
| --- a/examples/trossen_mobile_ai/config.json | ||
| +++ b/examples/trossen_mobile_ai/config.json |
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.
Summary
Brief description of the changes and their purpose.
Changes
Test Plan
make build)make test)pre-commit run --all-files)Breaking Changes
List any breaking changes to the public API or configuration format, or write "None".
Related Issues
Closes #