Inspiration

We want to keep track of the robot's position as it navigates the arena in order to prevent collisions with other robots or the possibility of crossing the halfway point.

What it does

It periodically returns the x-position, y-position, and angle with a predefined axis as the robot moves around the arena.

How I built it

I harnessed the robot's gyro to return changes in the robot's angle over a time interval. I read the encoder's outputs (the number of ticks on the wheel that have passed through a sensor), and converted it into distance traveled by the left and right wheel respectively using the area to circumference equation of a circle. I averaged these distances and applied trigonometric identities to determine the change in x-position and y-position.

Challenges I ran into

I had to disable the xbox controls in the OI class since we operated the robot solely using joysticks.

Accomplishments that I'm proud of

We achieved our goal of periodically returning the position and angle of the robot. We managed to apply the encoder's output to give us tangible information about the robot's whereabouts.

What I learned

Robot code builds on itself. The encoder must be built into the code before could achieve the task at hand. In addition, I learned that math can be applied to solve our problem in an elegant way.

What's next for Robot_Encoder

We hope to return other useful statistics including the robot's speed and acceleration.

Built With

Share this project:

Updates