Here we make a 76 degree right turn in GIRC, and this information has to be sent over the USB/Serial cable to the microcontroller aboard the robot. This communication is done with a control code pair. As shown, the first control code specifies that the turn is to the right and less than 90 degrees. The second control code gives the amount of turn in degrees plus 33.
Why add 33? So that the ASCII value represents a printable character. I don’t want to have any hassles sending data through the serial port or reading a path data file in Notepad.
If the turn is greater than ninety degrees, the first control code changes and the second control code is the value of the turn less 90 plus 33, or less 57.
Here are the turn codes for the quadrants and axes:
Note that since left turns are negative values, the absolute value is taken and different control codes are used to distinguish from right turns.
Okay, so as seen in the first image, the numbers in the parentheses are what the robot sees for turn data. Now onto distance!