Generate motion profile paths beforehand?

Right now, I’m generating my paths as I go through the autonomous, which obviously isn’t ideal. The robot also disconnects while generating the path, which makes the entire thing unviable. How would I go about generating the paths before hand? Would it work if I ran a separate task in initialize?

1 Like

Yes, it’s possible to generate paths in initialize and then call back to them during the autonomous period.

2 Likes

Wouldn’t the effect be the same since the robot would need to hang for a few seconds before running the actual autonomous?

1 Like

Initialize is a function in PROS when the program first boots. If the robot pauses in initialize fot a couple seconds, its not a huge deal since it will have to wait for the match to start regardless.

4 Likes

it will take a little less than a second per average path so be wary of that when you boot up to close to when the game starts

Anyone using the latest OkapiLib v4.0.0 RC can load/store paths from/to the SD card using these functions:
https://okapilib.github.io/OkapiLib/classokapi_1_1AsyncMotionProfileController.html#ad588aa51d62169159ff5e4b05ad3982c
https://okapilib.github.io/OkapiLib/classokapi_1_1AsyncMotionProfileController.html#a87c74350a819a3a322321be787c32d1f

You can use this feature to precompute paths before the match and save time having to compute them each time. The latest releases are always here: Releases · OkapiLib/OkapiLib · GitHub

2 Likes

Cool, I saw this issue was resolved but didn’t see where it was documented (especially since it says “needs doc”.