You are browsing as a guest. Sign up (or log in) to start making projects!

1h 47m 25s logged

finished VelocityProfile.java

what is it?
a velocity profile is just a simple mapping of the optimal velocity given the robot is along the path. it takes in distance, and it outputs velocity.

how does it do that?
first of all, because it maps distance in a cubic bezier-curve path, my numerical solution to arc-length parametrization using a Gauss-Legendre integrator proves actually useful. Based on that distance, you pass the optimal velocity through 3 different checks: centripetal, forward, and backward.

centripetal pass:
you get the curvature based on the distance you are along the path, and from that curvature you use the formula a_c=v^2*k (rearrange it to v^2=a_c/k and finally v=sqrt(a_c/k)) to find the curve velocity limit. This is also tuned by the maximum centripetal acceleration limit that is based on the robot’s physical capability.

forward pass:
with a standard velocity profile with just velocity mappings, the robot may physically not be able to accelerate from point A to B. a forward pass provides the maximum velocity for accelerating smoothly without error along two distances. It uses the kinematic formula with the max acceleration as the robot’s acceleration limit.

backward pass:
backward pass is basically the same idea as forward pass except, you guessed it, backwards! it uses the robot’s physical limit of braking (or deacceleration) to find the optimal breaking speed.

for finding the velocity you can lerp the closest low and high vals.

tests: 14 out of 14 passed yay (i had one slip up where i forgot to lerp v^2 and lerped v)

now im working on:
the simulated follower bc i need the actual robot for t he real follower

0
24

Comments 0

No comments yet. Be the first!