One of the final objectives of this project is a piece of code that works
for practically all differentially steered robots using stepper motors.
To make your program easier to debug without robots, it must product
suitable output to standard output (stdout) so that you can
use another program to analyze the output.
The following describes the output of your program:
- Any text on a line after a pound (
#) symbol is ignored,
use this for commenting (and debugging).
- An event is recorded on one line. A motor performing a step is
an event. Two events at the same exact time takes two lines.
- Time is measured in ticks. Use an unsigned long integer (32-bit)
to count ticks.
- Each line begins with a tick count, expressed as a decimal unsigned
number. Use a space character to separate fields.
- Use the letter ``L'' (uppercase) to indicate a step of the left
motor.
- Use the letter ``R'' (uppercase) to indicate a step of the right
motor.
- Although your program doesn't need to know the physical
characteristics of the robot, it may be helpful to know this
if you want to visualize the path of the robot.
Assume the following physical characteristics:
- the base frequency is 5kHz (5000 times per second)
- one stepper motor step moves 1mm linearly for the attached
wheel
- each wheel is 20mm from the center of the robot
- For example,
14334 L
means that the left motor performs a step in time slice
14334.
The following describes the input of your program:
- Each line of input is one setting, there can be multiple
settings per time slice.
- Everything after the pound symbol (
#) on a line should be
ignored.
- Fields are separated by spaces.
- The following names are used for specifying parameters:
lin is a prefix for linear parameters
ang is a prefix for angular parameters
vel sets the desired top velocity (in number of steps
per second), this is a magnitude, so it should be an unsigned
integer.
acc sets the maximum acceleration (in number os steps
per second squared), this is a magnitude, so it should be an
unsigned integer.
D sets the remaining number of steps. This can be
positive or negative.
- A parameter is set by the parameter name, followed immediately
by a possibly signed decimal integer for the value
- For example,
5621 lin.D 234
means that at time slice 5621, reset linear displacement to
234.
Copyright © 2006-02-15 by Tak Auyeung