PathWeaver Time Step value gone?

I haven’t been able to find anything explaining the absence of the time step option in PathWeaver 2020. Has this value been moved or is now generated automatically? The Max Jerk option is also gone, I don’t know what happened to that either. Does anyone know what happened to these values?

Hello, contributor to PathWeaver here. These values were removed when we switched from Pathfinder to WPILib splines. The timestep value has been removed as it is not exposed in WPILib splines, and the new splines do not use the jerk parameter as it had minimal impact. Feel free to ask any more questions, I’m here to answer them :stuck_out_tongue:

If so, then how is the time between the points exported calculated?

Ah, I see, trajectory points are generated dynamically when needed. Found some documentation here. Thanks for the help!

Is there any easy way to create a trajectory in a robot program from the exported JSON? Do you need external libraries to parse the JSON?

We don’t have a tutorial up for loading the JSON yet in the WPILib documentation, but it’s being worked on. Jackson is available in Java, if you’re using C++ there is wpi::json.

1 Like

Unfortunately I’m using Java, I’ll look into JSON parsing for Java though, I was just wondering if there was an easier solution that I wasn’t thinking of.

Take a look at this class: https://github.com/wpilibsuite/allwpilib/blob/master/wpilibj/src/main/java/edu/wpi/first/wpilibj/trajectory/TrajectoryUtil.java

I am working on documentation for using this class and reading a PathWeaver JSON tonight. Hopefully it will be merged either tomorrow or the day after.

The TrajectoryUtil class has a method Trajectory fromPathweaverJson(Path path)
It shouldn’t be too hard to substitute that into the trajectory following tutorial: http://docs.wpilib.org/en/latest/docs/software/examples-tutorials/trajectory-tutorial/creating-following-trajectory.html

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.