Okapi pathfinder

With our pathfinding code provided by the okapi library, the robot moves too fast. Is there a way to limit the speed of the motors?

Edit: turns out trusting someone else’s solution was not good idea. While this will slow the robot down, it will lose the trajectory completely. Keep reading for proper answer.

Ya @rpm answered you last time you asked yesterday. They just did it in a pretty confusing way.

Here is what they wanted you to see

1 Like

I tried that, and it did 1 thing. It gave me an error saying the -> was wrong. I did more research, and that just didn’t work. Also, does that even change the speed for the profilecontroller?

1 Like

When you create the profileController what arguments are you passing to it? Those are the limits.

I just used


 .withLimits({1.0, 2.0, 10.0})
 void initialize() {


What do the limits mean?

1.0, // Maximum linear velocity of the Chassis in m/s
2.0, // Maximum linear acceleration of the Chassis in m/s/s
10.0, // Maximum linear jerk of the Chassis in m/s/s/s


Ok, thank you. The documentation for that is not helpful whatsoever.

1 Like


The current version of the okapilib docs have been updated with the comments explaining the limits. So hopefully people don’t get confused in the future.

Beauty of Open Source software. Anyone can choose to improve the code or the documentation for OkapiLib. Like I did here


@tabor473 thanks for show me how to get a link to a specific line.

That weirdness was done b/c I was playing with cartridges and velocity is in rpms (ha) so here is the new comment for it:

@M3Rocks in case you didn’t look at the profile controllers…
I noticed that the 3 profile controllers had a cut-n-paste error and were all the same. But they also documented what the Limits mean:

I hope this helps.

1 Like