From f8b97cced532e6d67d4306bc01f6a234a94dae84 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 23 Nov 2025 16:38:44 -0800 Subject: [PATCH 1/4] checkpoint_98: station 3 navigation routine --- .../PokemonSV_AutoStory_Segment_37.cpp | 249 +++++++++++++++++- .../PokemonSV_AutoStory_Segment_37.h | 4 +- 2 files changed, 248 insertions(+), 5 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp index 66a531c8a..f65b78179 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp @@ -75,8 +75,251 @@ void AutoStory_Checkpoint_99::run_checkpoint(SingleSwitchProgramEnvironment& env } void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ - checkpoint_reattempt_loop(env, context, notif_status_update, stats, - [&](size_t attempt_number){ + // checkpoint_reattempt_loop(env, context, notif_status_update, stats, + // [&](size_t attempt_number){ + + YOLOv5Detector yolo_detector(RESOURCE_PATH() + "PokemonSV/YOLO/A0-station-3.onnx"); + + #if 0 + #endif + + + pbf_move_left_joystick(context, 128, 255, 200, 100); + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_ONLY, 10, 255, 128); + clear_dialog(env.console, context, ClearDialogMode::STOP_PROMPT, 60, {CallbackEnum::PROMPT_DIALOG}); + pbf_press_dpad(context, DPAD_DOWN, 13, 20); + + pbf_mash_button(context, BUTTON_A, 50); + wait_for_overworld(env.program_info(), env.console, context, 30); + + + + // arrived at research station 1 + + pbf_move_left_joystick(context, 0, 255, 500, 100); + pbf_wait(context, 3 * TICKS_PER_SECOND); + // wait for overworld after leaving research station + wait_for_overworld(env.program_info(), env.console, context, 30); + + + // left research station 1 + + + // align to rock-3-0. + // center before: center-y: 0.618056 center-x: 0.260156 + // center after: center-y: 0.248611 center-x: 0.452344 + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "rock-3-0", 0.248611, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock-3-0", 0.260156); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "rock-3-0", 0.452344, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move forward until rock-3-0 not detected + move_forward_until_yolo_object_not_detected(env, context, yolo_detector, "rock-3-0", + 2, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock-3-0", 0.452344); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + + pbf_press_button(context, BUTTON_L, 240ms, 100ms); + + move_camera_until_yolo_object_detected(env, context, yolo_detector, "waterfall-3-1", 0, 100); + + + + // align to waterfall-3-1. + // center before: + // center after: center-y: 0.220833 center-x: 0.754687 + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "waterfall-3-1", 0.220833, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "waterfall-3-1", 0.754687); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "waterfall-3-1", 0.754687, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // walk off the cliff + + + // move forward until we see rock-3-1 + move_forward_until_yolo_object_detected(env, context, yolo_detector, "rock-3-1", + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + pbf_press_button(context, BUTTON_L, 240ms, 100ms); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "waterfall-3-1", 0.754687, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + }, + 30 + ); + + + + // align to rock-3-1. + // center before: center-y: 0.538889 center-x: 0.384375 + // center after: center-y: 0.295833 center-x: 0.577344 + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "rock-3-1", 0.295833, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock-3-1", 0.4); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "rock-3-1", 0.577344, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move forward until rock-3-1 not detected + move_forward_until_yolo_object_not_detected(env, context, yolo_detector, "rock-3-1", + 1, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock-3-1", 0.577344); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // align to tree-3-1. + // center before: center-y: 0.413889 center-x: 0.240625 + // center after: center-y: 0.318056 center-x: 0.522656 + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "tree-3-1", 0.318056, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "tree-3-1", 0.3); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "tree-3-1", 0.5, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move towards tree-3-1 until box: {0.428125, 0.000000, 0.118750, 0.305556} + move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "tree-3-1", + 0.118, 0.2, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "tree-3-1", 0.000); // realign to target X + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // align to tree-3-1. + // center before: center-y: 0.150000 center-x: 0.517969 + // center after: center-y: 0.151389 center-x: 0.358594 + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "tree-3-1", 0.151389, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "tree-3-1", 0.5); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "tree-3-1", 0.358594, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move forward until tree-3-1 not detected + move_forward_until_yolo_object_not_detected(env, context, yolo_detector, "tree-3-1", + 1, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "tree-3-1", 0.5); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + + + pbf_move_right_joystick(context, 128, 255, 200, 0); + move_camera_until_yolo_object_detected(env, context, yolo_detector, "beyond-cliff-3", 255, 30); + + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "beyond-cliff-3", 0.5, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_right_joystick(context, 128, 255, 200, 0); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move towards beyond-cliff-3 until box: + move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "beyond-cliff-3", + 0.5, 0.9, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_right_joystick(context, 128, 255, 200, 0); + + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // walked off cliff. now move backwards + + pbf_move_left_joystick(context, 128, 255, 800, 50); // move forward to align with camera + + pbf_press_button(context, BUTTON_L, 240ms, 100ms); + + move_camera_until_yolo_object_detected(env, context, yolo_detector, "station-3", 0, 100); + + + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "station-3", 0.5, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + + do_action_until_dialog(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + move_player_forward(env, context, 20, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "station-3", 0.5, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + } + ); + + + clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE}); + run_trainer_double_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG); + mash_button_till_overworld(env.console, context, BUTTON_A); #if 0 @@ -109,7 +352,7 @@ void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& co #endif - }); + // }); } void checkpoint_99(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h index 61998a670..96607422b 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h @@ -43,8 +43,8 @@ class AutoStory_Checkpoint_99 : public AutoStory_Checkpoint{ }; -// start: -// end: +// start: Inside Area Zero Station 2. Deactivated the locks. +// end: Outside Area Zero Station 3. Defeated Great Tusk/Iron Treads. void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); // start: From 2fe12b01c3f82c275db2d27da160352a20086a49 Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 24 Nov 2025 17:39:31 -0800 Subject: [PATCH 2/4] checkpoint_99: enter station 3 --- .../PokemonSV_AutoStory_Segment_37.cpp | 82 +++++++++---------- .../PokemonSV_AutoStory_Segment_37.h | 4 +- 2 files changed, 41 insertions(+), 45 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp index f65b78179..2ea60d65b 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp @@ -28,15 +28,15 @@ namespace PokemonSV{ std::string AutoStory_Segment_37::name() const{ - return ""; + return "37: Area Zero Station 3"; } std::string AutoStory_Segment_37::start_text() const{ - return "Start: "; + return "Start: Inside Area Zero Station 2. Deactivated the locks."; } std::string AutoStory_Segment_37::end_text() const{ - return "End: "; + return "End: Inside Area Zero Station 3. Deactivated the locks."; } void AutoStory_Segment_37::run_segment( @@ -61,29 +61,25 @@ void AutoStory_Segment_37::run_segment( } std::string AutoStory_Checkpoint_98::name() const{ return "098 - " + AutoStory_Segment_37().name(); } -std::string AutoStory_Checkpoint_98::start_text() const{ return "";} -std::string AutoStory_Checkpoint_98::end_text() const{ return "";} +std::string AutoStory_Checkpoint_98::start_text() const{ return "Inside Area Zero Station 2. Deactivated the locks.";} +std::string AutoStory_Checkpoint_98::end_text() const{ return "Outside Area Zero Station 3. Defeated Great Tusk/Iron Treads.";} void AutoStory_Checkpoint_98::run_checkpoint(SingleSwitchProgramEnvironment& env, ProControllerContext& context, AutoStoryOptions options, AutoStoryStats& stats) const{ checkpoint_98(env, context, options.notif_status_update, stats); } std::string AutoStory_Checkpoint_99::name() const{ return "099 - " + AutoStory_Segment_37().name(); } -std::string AutoStory_Checkpoint_99::start_text() const{ return "";} -std::string AutoStory_Checkpoint_99::end_text() const{ return "";} +std::string AutoStory_Checkpoint_99::start_text() const{ return AutoStory_Checkpoint_98().end_text();} +std::string AutoStory_Checkpoint_99::end_text() const{ return "Inside Area Zero Station 3. Deactivated the locks.";} void AutoStory_Checkpoint_99::run_checkpoint(SingleSwitchProgramEnvironment& env, ProControllerContext& context, AutoStoryOptions options, AutoStoryStats& stats) const{ checkpoint_99(env, context, options.notif_status_update, stats); } void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ - // checkpoint_reattempt_loop(env, context, notif_status_update, stats, - // [&](size_t attempt_number){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ YOLOv5Detector yolo_detector(RESOURCE_PATH() + "PokemonSV/YOLO/A0-station-3.onnx"); - #if 0 - #endif - - pbf_move_left_joystick(context, 128, 255, 200, 100); walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_ONLY, 10, 255, 128); clear_dialog(env.console, context, ClearDialogMode::STOP_PROMPT, 60, {CallbackEnum::PROMPT_DIALOG}); @@ -271,7 +267,7 @@ void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& co } ); - // move towards beyond-cliff-3 until box: + // move towards beyond-cliff-3 until it takes up most of screen move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "beyond-cliff-3", 0.5, 0.9, [&](){ @@ -321,41 +317,41 @@ void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& co run_trainer_double_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG); mash_button_till_overworld(env.console, context, BUTTON_A); - - #if 0 - // align to rock. - // center before: - // center after: - move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "rock", 0.000, - [&](){ - run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); - move_player_to_realign_via_yolo(env, context, yolo_detector, "rock", 0.000); // x-position of target object prior to camera move - pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera - } - ); - move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "rock", 0.000, - [&](){ - run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); - pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera - } - ); + }); +} - // move towards rock until box: - move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "rock", - 0.000, 0.000, - [&](){ - run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); - move_player_to_realign_via_yolo(env, context, yolo_detector, "rock", 0.000); // realign to target X - pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera +void checkpoint_99(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + YOLOv5Detector yolo_detector(RESOURCE_PATH() + "PokemonSV/YOLO/station-door-1.onnx"); // we can reuse the detector for station door 1. + + do_action_until_dialog(env.program_info(), env.console, context, + [&](const ProgramInfo& info, VideoStream& stream, ProControllerContext& context){ + pbf_press_button(context, BUTTON_R, 160ms, 0ms); + move_player_forward(env, context, 20, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "station-door-1", 0.5, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); } ); - #endif + mash_button_till_overworld(env.console, context, BUTTON_A); // black dialog - // }); -} + // disable Lock at Station 3 + walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_SPAM_A, 20); + mash_button_till_overworld(env.console, context, BUTTON_A); // black dialog, prompt -void checkpoint_99(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + + }); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h index 96607422b..15efb003f 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.h @@ -47,8 +47,8 @@ class AutoStory_Checkpoint_99 : public AutoStory_Checkpoint{ // end: Outside Area Zero Station 3. Defeated Great Tusk/Iron Treads. void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); -// start: -// end: +// start: Outside Area Zero Station 3. Defeated Great Tusk/Iron Treads. +// end: Inside Area Zero Station 3. Deactivated the locks. void checkpoint_99(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats); From ecc74ebd6efeecedfff3402458e9667cf5af30b1 Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 24 Nov 2025 17:40:09 -0800 Subject: [PATCH 3/4] cleanup --- .../AutoStory/PokemonSV_AutoStory.cpp | 2 +- .../PokemonSV_AutoStory_Segment_38.cpp | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp index 934aa5725..2b3a73761 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory.cpp @@ -129,7 +129,7 @@ std::vector> make_autoStory_segment_list(){ if (PreloadSettings::instance().DEVELOPER_MODE){ segment_list.emplace_back(std::make_unique()); segment_list.emplace_back(std::make_unique()); - // segment_list.emplace_back(std::make_unique()); + segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); // segment_list.emplace_back(std::make_unique()); diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_38.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_38.cpp index f6f65ac57..bfefa927f 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_38.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_38.cpp @@ -102,6 +102,43 @@ void AutoStory_Checkpoint_102::run_checkpoint(SingleSwitchProgramEnvironment& en // } void checkpoint_100(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ + checkpoint_reattempt_loop(env, context, notif_status_update, stats, + [&](size_t attempt_number){ + + YOLOv5Detector yolo_detector(RESOURCE_PATH() + "PokemonSV/YOLO/A0-station-4a.onnx"); + + #if 0 + // align to rock. + // center before: + // center after: + move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "rock", 0.000, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock", 0.000); // x-position of target object prior to camera move + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + move_camera_yolo(env, context, CameraAxis::X, yolo_detector, "rock", 0.000, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + // move towards rock until box: + move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "rock", + 0.000, 0.000, + [&](){ + run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); + move_player_to_realign_via_yolo(env, context, yolo_detector, "rock", 0.000); // realign to target X + pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera + } + ); + + #endif + + + }); } void checkpoint_101(SingleSwitchProgramEnvironment& env, ProControllerContext& context, EventNotificationOption& notif_status_update, AutoStoryStats& stats){ From cd8be63fb4974681ead50f684e67e85340f004be Mon Sep 17 00:00:00 2001 From: jw098 Date: Mon, 24 Nov 2025 17:49:29 -0800 Subject: [PATCH 4/4] minior changes to station 3 nav routine --- .../Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp index 2ea60d65b..b38573bcf 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_37.cpp @@ -136,12 +136,12 @@ void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& co // align to waterfall-3-1. - // center before: + // center before: y:0.22 x: 0.31 // center after: center-y: 0.220833 center-x: 0.754687 move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "waterfall-3-1", 0.220833, [&](){ run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD); - move_player_to_realign_via_yolo(env, context, yolo_detector, "waterfall-3-1", 0.754687); // x-position of target object prior to camera move + move_player_to_realign_via_yolo(env, context, yolo_detector, "waterfall-3-1", 0.31); // x-position of target object prior to camera move pbf_move_left_joystick(context, 128, 0, 10, 50); // move forward to align with camera } ); @@ -201,7 +201,7 @@ void checkpoint_98(SingleSwitchProgramEnvironment& env, ProControllerContext& co ); // align to tree-3-1. - // center before: center-y: 0.413889 center-x: 0.240625 + // center before: center-y: 0.189 center-x: 0.21 // center after: center-y: 0.318056 center-x: 0.522656 move_camera_yolo(env, context, CameraAxis::Y, yolo_detector, "tree-3-1", 0.318056, [&](){