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!