FIRSTTech IconVert RGB icon

On the Robot Controller there are three dots in the upper right corner. Clicking them you get a menu which includes "View Logs" as a menu item. Clicking on this is a log of the Robot Controller App. This log can be useful for debugging your robot since you can include more information than the Telemetry data and it is recorded so you can look at after the run.

The log has five levels:

  1. Error - Log.e(String tag,String msg)
  2. Warning - Log.w(String tag,String msg)
  3. Information - Log.i(String tag,String msg)
  4. Debug - Log.d(String tag,String msg)
  5. Verbose - Log.v(String tag,String msg)

To write to the log:

Log.i(this.getClass().getName(),"Data to be written to the log");

Different levels lets you apply filters via Android Studio if running via the wireless connection. The Robot Controller App does not have the ability to filter the messages.

Lets you have a failure during the TeleOp portion, you can look at the log to possibly see what happened. For instance you might see:

10-18 17:30:51.38 W/RobotCore(3671): Caught exception during looper init: com.qualcomm.robotore.exception.RobotCoreException: unable to find USB device with serial number AL00VLUX.

The above would show that you had a USB connection issue.

The log is time stamped so if your watch is fairly close to the time of the phone, if you notice what time the robot stop, you can in the log for a time close to the time that you noted.

What can help the FTA/CSA at the event and your team is to "Frame" the start and stop of your opmode. That way it is a a lot easier to look at your last run to possibly determine what problem is happening.

To do this, it is recommended that you do the following:

  • Add a boolean to your opmode class: private boolean loopStarted = false;
  • Add the following to your init(): Log.i(this.getClass().getName(),"************ My OpMode is Initializing ************");
  • Add the following to your loop():

if (loopStared == false) {

   Log.i(this.getClass().getName(),"************ My OpMode is Running ************");

   loopStarted = false;

}

  • Add the following to your stop(): Log.i(this.getClass().getName(),"************ My OpMode has Stopped ************");

 

This makes it easier to find when your OpMode started/stopped and estimate when the problem occurred.

If you don't add the above you can still find it - The following are the standard messages generated by the Robot Controller App:

OpMode Initialization:

10-18 17:14:23.384  22067-22135/com.qualcomm.ftcrobotcontroller V/RobotCore﹕ Sending command: CMD_INIT_OP_MODE_RESP, attempt 0

10-18 17:14:28.464  22067-22136/com.qualcomm.ftcrobotcontroller I/FIRST﹕ Processing Command: CMD_INIT_OP_MODE NullOp

10-18 17:14:28.464  22067-22137/com.qualcomm.ftcrobotcontroller I/RobotCore﹕ Attempting to switch to op mode NullOp

10-18 17:14:28.504  22067-22135/com.qualcomm.ftcrobotcontroller V/RobotCore﹕ Sending command: CMD_INIT_OP_MODE_RESP, attempt 0

OpMode Running:

10-18 17:14:45.504  22067-22136/com.qualcomm.ftcrobotcontroller I/FIRST﹕ Processing Command: CMD_RUN_OP_MODE NullOp

10-18 17:14:45.564  22067-22135/com.qualcomm.ftcrobotcontroller V/RobotCore﹕ Sending command: CMD_RUN_OP_MODE_RESP, attempt 0

OpMode Stopped:

10-18 17:15:04.894  22067-22136/com.qualcomm.ftcrobotcontroller I/FIRST﹕ Processing Command: CMD_INIT_OP_MODE Stop Robot

10-18 17:15:04.904  22067-22137/com.qualcomm.ftcrobotcontroller I/RobotCore﹕ Attempting to switch to op mode Stop Robot

10-18 17:15:04.924  22067-22135/com.qualcomm.ftcrobotcontroller V/RobotCore﹕ Sending command: CMD_INIT_OP_MODE_RESP, attempt 0

10-18 17:15:04.934  22067-22136/com.qualcomm.ftcrobotcontroller I/FIRST﹕ Processing Command: CMD_RUN_OP_MODE Stop Robot

10-18 17:15:05.024  22067-22135/com.qualcomm.ftcrobotcontroller V/RobotCore﹕ Sending command: CMD_RUN_OP_MODE_RESP, attempt 0

 

JSN Epic template designed by JoomlaShine.com