PalouseRobosub / robosub

Code for the computer on the sub
GNU General Public License v3.0
13 stars 0 forks source link

Add Error Checking to MaestroThrusterController class #61

Closed ryan-summers closed 8 years ago

ryan-summers commented 8 years ago

The Pololu Maestro motor controller outputs certain errors when serial communication breaks down or motors appear unresponsive. These errors are persistent in microcontroller memory until read, and they result in a red light being displayed on the microcontroller.

Implement a method that periodically reads and records thruster controller error codes.

class MaestroThrusterController
{
    //....
    uint16_t readErrorCode()
    {
        /*
         * Error code is read here.
         */
        return read_error;
    }
};
irwineffect commented 8 years ago

I took a look at the possible error codes: https://www.pololu.com/docs/0J40/4.b

Most of them are basically "did a serial error occur?", which if serial errors are occurring we likely won't be able to talk to the maestro to get the error code anyway. The maestro doesn't have an error for non-responsive motor. Was there some other error you had in mind? If not, I don't see a strong need for this.