Skip to content

Conversation

@jw098
Copy link
Collaborator

@jw098 jw098 commented Jun 6, 2025

Using inference for better reliability.

Right now, I created a second version of home_to_date_time, which includes VideoStream. If you think it looks good, we can delete the old home_to_date_time and update all the references.'

ImageFloatBox system_settings(0.685, 0.69, 0.05, 0.03);
ImageFloatBox other_setting1(0.615, 0.69, 0.05, 0.03);
ImageFloatBox other_setting2(0.545, 0.69, 0.05, 0.03);
if (!is_setting_selected(stream, context, system_settings, other_setting1, other_setting2)){
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds like it might slow it down quite a bit? An alternative that I'm thinking about is to keep the A press to enter the settings, then run run_until() with the down-scroll mash until you detect that we're at the bottom of the settings menu.

ssf_press_button(context, BUTTON_A, 3);

context.wait_for_all_requests();
context.wait_for(Milliseconds(250));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, wait_for_all_requests() alone doesn't actually wait for all the buttons to finish pressing. This is why I have the extra 250ms wait here. Any ideas on why this might be the case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's not supposed to happen. Needing a delay before inference is rather common since the video + Switch's UI delay is longer than the time to process return trip for a finished command.

Is the following wait_until() triggering early without this wait?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The program still works as intended without the wait.
But I can see that the wait_until inference is starting a bit earlier than I want. I want the button presses to be completely done before we start inference, to reduce the probability of early false positives. However, this is a theoretical concern, since I haven't seen any issues in my testing, even without the 250ms wait.

@Mysticial Mysticial merged commit 15a7937 into PokemonAutomation:main Jun 7, 2025
3 checks passed
@jw098 jw098 deleted the home-to-date branch June 7, 2025 17:18
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