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

AsyncMotionProfileControllerBuilder()

 .withOutput(chassisMotion)
 .withLimits({1.0, 2.0, 10.0})
 .buildMotionProfileController();
 void initialize() {
   right_mtr.set_reversed(true);
   right_back_mtr.set_reversed(true);


 }

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

4 Likes

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

1 Like

https://okapilib.github.io/OkapiLib/md_docs_tutorials_concepts_twodmotionprofiling.html

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

3 Likes

@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