Robot Crash

Hi all,

Working on alternate ideas while doing the whole reprogramming the robot in C++.

The robot works fine until I press the kick/fire button, upon which the cRIO “crashes”. Nothing happens, DS says “Watchdog Not Fed”. Using NetConsole, I could see that the cRIO clearly crashed, but now it’s not saying anything for some reason.

I reimaged the cRIO to see if that would fix it, but nope. Though it now says the evil errors:


data access
Exception current instruction address: 0x0215bf40
Machine Status Register:  0x0000b02
Data Access Register: 0x05000060
Condition Register: 0x42000242
Data storage interrupt Register: 0x40000000
Task: 0xe63170 "FRC_RobotTask"
0xe63170 (FRC_RobotTask): task 0xe96170 has had a failure and has been stopped.
0xe63170 (FRC_RobotTask): fatal kernel task-level exception!

If I comment out line #71 in Kicker.cpp and then push the fire/arm button, the robot stops doing what it does, the DS indicates “Watchdog Not Fed” and nothing else is printed from NetConsole (not even disabled printf’s).

I want to say it has something to do with the rollerEncoder because I’m not getting any data from it. Dad hasn’t hooked up the scope yet to tell for sure though.

If you want to look at all the code, look here:

Thoughts?

-Tanner

Can you put printfs every few lines to narrow down the location of the crash?

Oh and we have dead encoders on our bot and nothing went wrong when we tried to use them. Unless you’re encoders are somehow causing NULLs, you should be fine

Also, when looking at your code, I noticed that you call Kicker::Act in autonomous, which looks at joystick buttons. The DS will send whatever data was on the DS at the beginning of Autonomous, so if one of the control buttons are pressed when auton enables your kicker code will follow it

I can do that tomorrow afternoon and get results back to you then.

Ah, that’s good to know.

All though that should (hopefully) never happen, I should fix that. Thanks for noticing.

-Tanner

In my experience, the most common source of those symptoms (crash, “Watchdog Not Fed” message) is when your code tries to dereference a null pointer. I’d suggest doing a quick check to make sure you’re creating all the objects you are using.

Just quickly looking through your code I notice that you never initialize variable kickerSwitch

That would be a null pointer at at line 94 / 95 (The number spacing is off a lot, I can’t tell)

Hmf. I don’t do I. I removed it in the last commit for some reason (grr @ last commit).

I commited it back. Will see how it all works when I get off work.

-Tanner

The variable kickerSwitch was it. Not sure why I removed it, but that was it. At least it wasn’t something terribly wrong.

Thanks all!

-Tanner