OK, sorry I took so long. Its been a couple of hectic days. Anywho, here are all of the default commands available in Kevin Watson’s code. I plan on playing around with the disabled ones (i.e. the way points and the like) and hopefully posting code to run it.
CMD_SHOW_STATE; no parameters
Prints back the on-board clock time, x and y coordinates in mm, and the heading in milliradians
CMD_VELOCITY; parm_1: velocity in mm/sec
Uses the PID algorithm and encoders on the wheels to keep the motors driving at the commanded velocity
CMD_WAIT; parm_1: time to wait in milliseconds
Waits for the specified time until executing the next command on the list. Very useful after setting the velocity. (i.e. set velocity 1000mm/sec, drive for 5000 milliseconds = 5 meters).
CMD_WAIT_UNTIL; parm_1: time to wait until in milliseconds
Waits until the specified milliseconds into the match until executing the next line. Useful to delay your code so your alliance can get out of the way first.
CMD_DRIVE; parm_1: distance to drive in mm
Uses the PID code and encoders to drive the robot forward the specified distance.
CMD_TURN; parm_1: distance to turn in milliradians, parm_2: tolerance to be within goal heading in milliradians
Uses the gyro along with the PID algorithm to turn the robot the specified distance. The tolerance is the buffer as to how close it needs to be before deciding it has succeeded.
CMD_WAIT_FOR_BUMP; no parameters
Waits for a switch to be hit before continuing on to the next command.
CMD_STOP; no parameters
Stops the robot.
CMD_GYRO_BIAS; no parameters
Tells the gyro code to use the next 8 loops or so to set its bias. Usually the first line of code to be called since you want to be stationary when setting the bias.
CMD_KEEP_HEADING; parm_1: time to hold heading in milliseconds. parm_2: tolerance in milliradians
Tells to robot to keep its heading (direction) using the Gyro and the PID code to within the specified tolerance for the specified time.
CMD_JUMP; parm_1: command to jump to
Jumps to the specified command in the command list. Usefull for creating loops.
That’s all that is complete in Kevin’s code. I will try to get CMD_SET_HEADING and CMD_SET_POS done soon as they should be useful. I hope this helps anyone that needs it.
-Tony K