Quote:
Originally Posted by mikets
SetPID is a void function. How do I check the "error"? GetFault()? If so, I did print out the value returned by GetFault in the loop. As far as I can tell, it's returning 0.
|
No... it's not GetFaults() that you want... it's GetError(). You can call StatusIsFatal() to get a boolean for if there is an error or not. GetError() returns an "Error" object (Error.h) that you can call a number of methods on if it is an error. It is generally good practice to always check for an error after every call to a CANJaguar object so you know if you can trust the data that is returned or if the command you sent was acknowledged by the Jaguar. If you get an error that is not "Time-out", the CANJaguar object will stop trying to talk to the device, since the calling code is clearly broken. This is likely what is happening in your case. If you get an error and you want to continue talking to the device, you can call ClearError() to try again. You should also call ClearError() if you get a time-out so that you can tell if there is a timeout from a future call.
I clearly need to write some examples for using CANJaguar in C++. Feel free to contribute some if you like.
-Joe