Fix robot control mode not being initialized properly on startup#3461
Conversation
| for tab in tscope_config.tabs: | ||
| if hasattr(tab, "widgets"): | ||
| robot_view_widget = tab.find_widget("Robot View") | ||
| if robot_view_widget is not None: | ||
| robot_view_widget.individual_robot_control_mode_signal.connect( | ||
| lambda robot_id, | ||
| robot_mode: robot_communication.toggle_individual_robot_control_mode( | ||
| robot_id, robot_mode | ||
| ) | ||
| ) | ||
|
|
||
| # Set mode for robot in RobotCommunication to initial value of combo box | ||
| for ( | ||
| robot_view_component | ||
| ) in robot_view_widget.robot_view_widgets: | ||
| robot_info = robot_view_component.robot_info | ||
| robot_communication.toggle_individual_robot_control_mode( | ||
| robot_info.robot_id, | ||
| IndividualRobotMode( | ||
| robot_info.control_mode_menu.currentIndex() | ||
| ), |
There was a problem hiding this comment.
pyramid of doom ah. Can we sep this apart to diff functions to make it more readable? Also, was getting rid of if args.run_diagnostics so that this should be available in ai vs ai (i.e. testing)?
| parser = argparse.ArgumentParser() | ||
| parser.add_argument( | ||
| "--test_filter", | ||
| action="store", | ||
| default="", | ||
| ) | ||
| args, _ = parser.parse_known_args() |
There was a problem hiding this comment.
Removed this and added an optional allow_unrecognized param to load_command_line_args instead.
This was just a hack to get field tests to run without erroring. Command-line args passed to field tests don't match the ones used for simulated tests, but they both use the same pytest_main func which uses the simulated test's version of load_command_line_args. Hence, args specific to field tests wouldn't be recognized and cause an exception.
| self.referee_port, | ||
| referee_interface, | ||
| lambda data: self.__forward_to_proto_unix_io(SSL_Referee, data), | ||
| lambda data: self.__forward_to_proto_unix_io(Referee, data), |
There was a problem hiding this comment.
SSL_Referee does not exist, looks like this is a typo
itsarune
left a comment
There was a problem hiding this comment.
wait, so the widget was only connected if --run_diagnostics was passed? how come we didn't see this earlier?
| to the refresh function | ||
| """ | ||
| self.name = name | ||
| self.widgets = widgets |
There was a problem hiding this comment.
self.widgets is unused
Yep, no idea why we never noticed this before. Probably went unnoticed since we don't really field test with AI Did some refactoring to return out the |
…into william/robot_control_mode_fix
Description
Fixes issue where no packets were being sent to robot while running AI
Testing Done
Tested in mezz
Resolved Issues
Length Justification and Key Files to Review
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO(or similar) statements should either be completed or associated with a github issue