Helper functions.
a simple debugging function used for easily printing integer values
- val (int) - the value to be printed, any valid integer
a simple debugging function used for easily printing float values
- val (int) - the value to be printed, any valid float
clears the motor position for both the left and right wheels of the robot as determined by the left and right wheel defines
- cmpc (port)
used the set the accel and deccel of locomotion functions
- distance (float) - the distance of the acceleration and deceleration in cm
basic function used to average the analog sensors for a certain amount of loops there is a 5 millisecond delay in between that data collection
this function returns a Struct of type position holding the change in x, y, and theta based on the given input. The math does not account for the perfect curve of the driven distance, and instead uses much simpler triangular math becuase it is supposed to be sampled fast inside of a loop. But because it can sample so much faster with easier equations, under light experimentation the simpler math has shown better results than the more complicated and correct math
- right_movement (double) - the distance the right wheel has travelled since last sample
- left_movement (double) - the distance the left wheel has travelled since last sample
- theta (double) - the overall angle of the robot since the start of the loop, this is unlike the previous two parameters that only ask for change in movement that loop
returns a float value from 0 to 1 that can be multiplied to a speed. Used internally in locomotion functions to smake the accel and decel curve
a simple calculation function that returns 1 if a value is in range of a desired number and 0 if it is not