Skip to content

Conversation

lizlooney
Copy link
Collaborator

Add define_hardware method to RobotBase and call it from RobotBase.init.

Modified mrc_mechanism_component_holder pythonFromBlock to determine the module type by calling generator.getModuleType() instead of checking for the presence of the mechanisms input.

Modified ExtendedPythonGenerator.generateInitStatements to not generate the call so self.define_hardware() if the module type is robot.

Modified ExtendedPythonGenerator.finish to generate the init method before other methods.

…init__.

Modified mrc_mechanism_component_holder pythonFromBlock to determine the module type by calling generator.getModuleType() instead of checking for the presence of the mechanisms input.

Modified ExtendedPythonGenerator.generateInitStatements to not generate the call so self.define_hardware() if the module type is robot.
Modified ExtendedPythonGenerator.finish to generate the __init__ method before other methods.
@lizlooney lizlooney requested a review from alan412 July 29, 2025 03:58
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

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

LGTM. I ran it as well. I really like moving to the module type instead of the looking to see if mechanisms were included.

@alan412 alan412 merged commit 35f4fae into wpilibsuite:main Jul 30, 2025
1 check passed
@lizlooney lizlooney deleted the pr_robot_base_define_hardware branch July 30, 2025 00:37
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