Skip to content

Conversation

@GrayHoang
Copy link
Contributor

@GrayHoang GrayHoang commented Aug 29, 2025

Description

This is built off of PR #3481
I use Boost::SML logging capabilities to expose the guard calls and state transitions that our AI undergoes as it is moving through each state machine

image I have some commented out code and stuff still, this is not done and I just want some feedback on existing design choices.

Testing Done

Thunderscope runs with similar performance as before, messages seem to line up with robot id

Resolved Issues

I have no idea if this resolves any issues :/ but it will probably make debugging easier
#3532

Length Justification and Key Files to Review

Look at sml_fsm.h especially I think

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

* Creates a tactic given a tactic proto
*
* @param tactic_proto the tactic proto
* @param ai_config The AI config
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @param ai_config_ptr The AI config

/**
* Update the AiConfig proto
*
* @param ai_config The new AiConfig proto
Copy link
Contributor

Choose a reason for hiding this comment

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

delete param string

Comment on lines +32 to +41
FSMLogger() : robot_id(std::nullopt){};

/**
* Set the associated robot ID
*
* @param robot_id the id of the robot that the associated tactic is running on
*/
void setRobotId(std::optional<unsigned int> robot_id) {
this->robot_id = robot_id;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Move implementation to sml_fsm.cpp

* @param result true if the guard passed, false if the guard failed
*/
template <class SM, class TGuard, class TEvent>
void log_guard(const TGuard&, const TEvent&, bool result)
Copy link
Contributor

Choose a reason for hiding this comment

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

is TGuard and TEvent parameters from the SML library? What information do they contain?

*/
explicit FSMLogger(std::optional<unsigned int> robot_id) : robot_id(robot_id) {}

FSMLogger() : robot_id(std::nullopt){};
Copy link
Contributor

Choose a reason for hiding this comment

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

needs docs

tactic_transitions.append(playinfo.robot_tactic_assignment[robot_id].last_transition)
tactic_names.append(playinfo.robot_tactic_assignment[robot_id].tactic_name)

set_table_data(
Copy link
Contributor

@itsarune itsarune Oct 19, 2025

Choose a reason for hiding this comment

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

This works great! Is there a way to try to make the column lengths fixed? They are hard to track when using AI vs AI

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

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

Looks like a great debug tool!

It's a bit annoying that the column widths are constantly changing on Thunderscope, so it makes it a bit hard to figure out what's going on.

@GrayHoang
Copy link
Contributor Author

Yeah I've got some plans to make a better UI but I just have not found the time to think about it further

src/.bazelrc Outdated
Comment on lines 51 to 53
build --experimental_disk_cache_gc_max_size=32G
build --experimental_disk_cache_gc_max_age=28d

Copy link
Contributor

Choose a reason for hiding this comment

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

looks unintentional

Copy link
Contributor Author

@GrayHoang GrayHoang Nov 18, 2025

Choose a reason for hiding this comment

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

Very much so :(
I will remove later

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

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

Left a few comments

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