How can you go about adding a debug statement to the ArduPilot code. I made some changes and wanted to log or print to screen during SITL testing.
Will the Serial.print work anywhere I put it without breaking something?
Or is there something already built into the code I can call or use?
Serial.printf() will work almost everywhere (the exception is places like interrupt handlers).
If you only want the message in SITL, then you can instead use SITL_debug(), like this:
I have used Serial.print ('' ") for debugging quite a bit. Just pit it in a slow loop so you can read it and the digits don't flicker, and comment out other prints as needed. Like here at the end of the fast loop.
static void medium_loop()
Add you stuff to the medium or slow loop.
Thanks, for all the replies definately helped a ton.
I tired to go the route of writing my own flash log outputs in the Log.pde, just glad to know there is an easier way.