Skip to content

Ai patch test#256

Open
SahajGupta05 wants to merge 2 commits into
TrossenRobotics:mainfrom
SahajGupta05:ai-patch-test
Open

Ai patch test#256
SahajGupta05 wants to merge 2 commits into
TrossenRobotics:mainfrom
SahajGupta05:ai-patch-test

Conversation

@SahajGupta05

Copy link
Copy Markdown

Summary

Brief description of the changes and their purpose.

Changes

  • Change 1
  • Change 2

Test Plan

  • Builds cleanly (make build)
  • Tests pass (make test)
  • Lint passes (pre-commit run --all-files)
  • Tested on hardware (if applicable)

Breaking Changes

List any breaking changes to the public API or configuration format, or write "None".

Related Issues

Closes #

Copilot AI review requested due to automatic review settings June 15, 2026 20:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() to TrossenArmComponent and parse initial_position / initial_position_time_s from JSON config.
  • Extend ArmConfig to include the new initial-position fields in JSON serialization/deserialization.
  • Update the trossen_mobile_ai example 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 thread ai_update.patch
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants