https://github.com/choate-robotics/oval_car
Another Autonomous Challenge
https://github.com/choate-robotics/oval_car
Last synced: 2 months ago
JSON representation
Another Autonomous Challenge
- Host: GitHub
- URL: https://github.com/choate-robotics/oval_car
- Owner: Choate-Robotics
- License: mit
- Created: 2019-05-06T03:00:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-11T14:25:14.000Z (about 6 years ago)
- Last Synced: 2025-01-21T06:11:32.399Z (4 months ago)
- Language: Processing
- Size: 7.27 MB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oval Car
The goal of this challenge is to create a drive system that will allow the car to navigate a two lane system. We would like to see the car start in one lane. You can know that the car starts in the outside lane. The car must spend a few seconds in each lane and then change to the other lane.

### Hints about the DriveSystem
DriveSystem is again an abstract class that needs to be subclassed to create a strategy for how the car is to move.
You will want the robot to act differently at different times. This time I suggest that you use the `millis()`to do this. You may want to record the starting time of your loop in a class variable and measure time from that start.
You should be able to avoid the `noSense` business from before by using `millis()`.
## API for the Car object
Car has the following methods that may be useful:
`Car(int x, int y, float theta)`
This constructor method allows you to place a car on the canvas pointing in the direction of `angle`. The directions work with 0 as directly up and move in in a clockwise manner.
`void setLeftSpeed(int s)`
Set the speed of the left motor to an integer from 0 to 255.
`void setRightSpeed(int s)`
Set the speed of the left motor to an integer from 0 to 255.
`void LEDSense()`
Have the readings of the left and right sensors loaded into `sensorValueRight` and `sensorValueLeft`.
`void show()`
Draw the car on the canvas.
`void move()`
Compute the new position of the car based on the motor settings.
