View Single Post
  #6   Spotlight this post!  
Unread 03-29-2016, 11:22 PM
Jaci's Avatar
Jaci Jaci is offline
Registered User
AKA: Jaci R Brunning
FRC #5333 (Can't C# | OpenRIO)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Perth, Western Australia
Posts: 251
Jaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond repute
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive

Quote:
Originally Posted by lopsided98 View Post
I just saw your post, and I am probably running into the same problem. I'm a little confused as to how the coordinate system for Pathfinder works.

This is how I assumed it works, but I am probably misunderstanding it:
If the robot starts facing towards the direction I define as forward (ie. towards the opponent's castle):
Its initial heading is pi/2
A waypoint with x = 0, y > 0 and heading = pi/2 will cause the robot to drive straight forward.
A waypoint with x < 0, y = 0 and heading = pi will cause the robot to turn to the left and drive to the left, ending up facing left.
A waypoint with x < 0, y = 0 and heading = 0 will cause the generator to crash.
A waypoint with x = 0, y > 0 and heading = pi/4 will cause the robot to end in a position directly in front of where it started, but pointing to the right.

EDIT: I reread your post, and updated my examples.
The way it currently works is like so:
X+ is forward from where your robot starts.
X- is backward from where your robot starts.
Y+ is to the right of your robot where it starts.
Y- is to the left of your robot where it starts.

Positive headings are going from X+ towards Y+, Negative Headings from X+ to Y-. As for the actual following of the heading, that depends on where your gyroscope is zero'd to.

As with anything, these coordinates are useless unless you have the follower code to interpret them. X and Y coordinate directions can be flipped by just sending them to different motor outputs, for example
__________________
Jacinta R

Curtin FRC (5333+5663) : Mentor
5333 : Former [Captain | Programmer | Driver], Now Mentor
OpenRIO : Owner

Website | Twitter | Github
jaci.brunning@gmail.com
Reply With Quote