![]() |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
|
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
If we define theta to be the angle between any heading in the spline and the x-axis for that spline, |theta| < PI/2, or else lose the polynomial solution we came up with. This is a weakness in using our geometry, but it works in most of the cases you would see and comes up with a clean solution. If you wanted to make a curve that violates those properties, you could put an intermediate waypoint on the desired curve. This isn't a perfect solution, but it fixes the coordinate system to the point where it can generate splines. |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
This image describes Pathfinder's coordinate system, similar to what you'd find if you overlaid a cartesian plane on the game field, where the origin is where your robot starts.
On the graph above are plotted the waypoints: [0, 0 @ 25 deg], [4.5, 2 @ 0 deg], [7.5, 3 @ 0 deg], [9, 1 @ 0 deg] The heading is dependent on where your Gyroscope is zero'd to, which is usually where you set your robot up. If you want to think of it another way, you could say that the X and Y axis are both parallel to the plane of the field carpet. |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
I'm currently testing Pathfinder, and it seems to not be following the constraints specified in the config. It accelerates extremely fast, reaching a max speed of 25 m/s by the second point. This happens no matter what the max speed, acceleration and jerk are.
|
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Im a little confused, what exactly do the coordinates mean, like how far is one unit. Can someone overlay this over a map of the field and show me?
|
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
I was in a hurry when I wrote my last post (time restricted unbag periods are mixed blessing), so I'll try to explain the problem I am running into better now.
I was generating this waypoint sequence: Code:
public static final Waypoint[] LOW_BAR_AUTONOMOUS_WAYPOINTS =Code:
public static final Trajectory.Config AUTONOMOUS_TRAJECTORY_CONFIG = new Config(Trajectory.FitMethod.HERMITE_CUBIC,I just realized that I was not using the real wheelbase width, only a dummy value (0.5 m), but this is still reasonable and should not have caused this problem. |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
I just generated a source trajectory with the values, and it seems absolutely fine, so I'd instead suggest that the issue is with the follower instead. The only thing I can think of is that the encoder values or kV or kA terms are incorrect in your follower, causing the issues. |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
If your robot starts perpendicular to the midline (i.e. facing the outer works), X+ will be facing towards the tower, and Y+ will be facing the secret passage. You can flip these coordinates by reversing which motors each value goes to in your follower. |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
I'm pretty sure the problem is not in the follower, because I found these velocity values by looking at the generated trajectory with the debugger. I will try to write a test application today to see if I can figure out what's wrong.
Maybe it has something to do with generating multiple trajectories at the same time. The robot has a thread pool generating 6 trajectories at once when it starts. Does the generation use any global variables that would cause race conditions? |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
|
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
I was able to reproduce the bug on my computer. The source trajectory that is generated is fine, but when the TankModifier is applied, the really huge velocities appear. My testing has shown that it happens whether or not multithreading is used.
|
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
https://github.com/JacisNonsense/Pathfinder/releases |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
1 Attachment(s)
I finally got the time to get Pathfinder working (hopefully we will be able to use it at BattleCry@WPI), and here is a demo video of our robot following a simple trajectory that is similar to what we will use to get over a defense and line up for our auto shot.
https://youtu.be/m4pbv1_FC5I Also, I attached a picture of a web interface I wrote (using pynetworktables2js) that allows me to see how well the robot is following the trajectory and easily tune the parameters. (Also, disregard the weird looking data, I was working on a problem when I took the screenshot) |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
Once our robot lands back in Aus I'll see if I can do a demo with it, after my exams of course :P |
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive
Quote:
|
| All times are GMT -5. The time now is 04:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi