|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Initialization Error
Oh ok. So your problem is that your code creates multiple instances of the Team3373 class which extends SimpleRobot. This causes the SimpleRobot/RobotBase constructor to be called multiple times which causes some initialization code to run twice. Even if the SimpleRobot constructor didn't fail you would still have errors because you would be creating multiple Tallon objects on the same port (Team3373:32-33). I would suggest that instead you look to take the code in line 30-81 and break it out into a helper base class and declare the your motors and sensors static so that they don't get created multiple times. You probably also want to make all of the fields with sensor values methods because currently they will only get values once when the code loads and will not change after that.
|
|
#2
|
||||
|
||||
|
Re: Initialization Error
Thanks for the write-up! We took a second look at the code, and pretty much found the same thing, with Shooter extending the main file, and then having the main file referencing shooter methods, thereby breaking it. So we went (I believe it is on the GitHub at this point), and used the "this" pointer to make it so we can access the variables of the main class in the Shooter class. So, we fixed it! Thank you for your input!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|