JaciBrunning / Pathfinder

Cross-Platform, Multi-Use Motion Profiling and Trajectory Generation
MIT License
255 stars 78 forks source link

Max velocity/accel/jerk violated by tank transform #14

Open willtoth opened 7 years ago

willtoth commented 7 years ago

The tank transform seems to not take into account the reduction of speed during a turn and the max constraints are violated. Example path:

x[0] = 0
x[1] = 120
y[0] = 246
y[1] = 210
degrees[0] = 0
degrees[1] = -60

wheelbase = 28
max  velocity = 60
max accel = 70
max jerk = 1000
dt = 0.005
samples = 10000

In this case, velocity ends up > 60 units for one side of the robot.

JaciBrunning commented 7 years ago

This is fairly typical. The maximum velocity is only taken into account during path generation. For the actual following of the path, this will be higher than the 'maximum'. This is on the list of things to change for Pathfinder version 2, which will be released ~sometime~.

You shouldn't see any difference in your robots following of the path. The encoder following will account for one side dragging behind the other, and correct for it. You may see your robot move a little faster on the coming out of a curve, though.