We are running our code in 2020 sim and receiving fatal exception error. The sim dies when it runs a command group and says:
Windows fatal exception: access violation
We are speculating it could be due to a change in the 2020 command package. We used requires(Subsystem) and are wondering if this could be the cause of it failing.
Any suggestions would be greatly appreciated!
Could you share your code?
See also https://robotpy.readthedocs.io/en/latest/2020_notes.html - something will probably be relevant there.
The error in the console of the robot when trying to upload the code is
File ‘path to the file on the rio/commands/do_winch.py’, line 13 in init
Line 13 in do_winch reads
I have a feeling the way to use self.requires has changed since the super().init() is not used for 2020 wpilib commands but I don’t know how to use it correctly anymore
also we have checked the 2020 release notes and haven’t found anything, but maybe there’s something we missed
Yeah, you’re missing
__init__ calls to the superclass for all your Subsystems and Commands.
Right, but here’s an example from the 2020 update notes
from wpilib.command import Command
# no custom __init__, nothing extra required
Yes, that example does not define its own
__init__, so the superclass
__init__ does get called.
where does it get called in that example? Or should I just add this
If you override
__init__ (i.e. you define it in your subclass), then you need to call
Command.__init__(self) etc. in your
Okay I will try that thanks
We tried to put Command.init(self) in commands and tried to put super().init_() in subsystems which didn’t work in the sim. So, we removed superinit from subsystems but this still didn’t run in the sim.
We’re getting an error that says
init(): incompatible constructor arguments
The rule of thumb is that you call the base class constructor directly. So if you have:
Then calling it’s constructor in your custom
__init__ is going to be
So a subsystem would call
Also, I fixed some issues in your repo, and made a pull request. https://github.com/beavertronics/2020code5970/pull/1
Where can we find the arguments for the command group init? Also thanks for the pull
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.