View Single Post
  #1   Spotlight this post!  
Unread 20-06-2013, 13:44
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Finding the position of the robot

I'm trying to find out the angle a robot (holonomic) is traveling relative to the side walls of the field. I'm pretty sure that, when using field centric steering, the angle the robot should be traveling is represented by
Code:
theta = atan2(X,Y) * (180/pi);
//unit circle stuff
where X and Y are the axes on a joystick, but I need to know the angle the robot is actually traveling, so I think I need to use a gyro and accelerometer. Normally, I would need two coordinates to come up with the slope of a line which I could then find the angle from, but I'm not sure how to do this with a gyro and accelerometer. Has anyone done this before? Thanks!