SouthEugeneRoboticsTeam / sertain

Framework for programming FRC robots, inspired by Sertain Legacy and Meanlib
6 stars 0 forks source link

Trajectories #12

Open gnawinganimal opened 4 years ago

gnawinganimal commented 4 years ago

Sertain definately needs a pathfinding solution. One possibility is to use TrajectoryLib by the chezypoofs, but we could also write our own (idk i'll give it a shot)

Should have

Also this is a pretty beefy feature so it should be in its own subproject.

andrewda commented 4 years ago

Meanlib's is super well designed. Porting it to Kotlin or writing a new one with it in mind seems like a good start. I particularly like the animations in meanlib that can be used for a wide variety of use cases with a generic API.

Also keep in mind that any deviation from Meanlib should ideally maintain backwards compatibility in how paths are loaded (same JSON format) so that PathVisualizer can still be used. Between modules and BunnyBots, I'm guessing it'll be tough to find time to create a Sertain PathVisualizer replacement (especially one tested as well as PathVisualizer).

gnawinganimal commented 4 years ago

Yeah I agree meanlib's is really nice. Right now i'm more or less rewriting TrajectoryLib as a kotlin library. It's definately going to have animations, because that's the easy part. The harder part is the 2d trajectories, which I'm struggling to grasp an understanding of. (I am making progress though 😁 )

As for the path visulizer, that will happen as long as I can run the app (I was having trouble on several PCs). If I can't though, I guess we will just have to use desmos 🤷‍♀

gnawinganimal commented 4 years ago

Will support a format

path("somePath") {
    p(0.0, 0.0) ang 0.0
    // or
    wp(0.0, 0.0, 0.0)
    // also
    loadWaypoints("path/to/file")
}

or for loading the entire path loadPath("path/to/file")

the files will be json, of course

gnawinganimal commented 4 years ago

Still working on this. Lots of calculus that I don't understand 😬

andrewda commented 4 years ago

Let me know if you need any help 👍

gnawinganimal commented 4 years ago

Lol, it actually isn't super hard. It'll be fine as long as I don't change any of the math 😆

gnawinganimal commented 4 years ago

Update on this issue: 🎉 Splines are working! The library now creates curves given a list of waypoints. 2019-10-16 (1) It may just look like a crappy microsoft paint drawing, but it's actually a work of art ☝️

gnawinganimal commented 4 years ago

Now we need to convert these (x, y) coordinates to the motor velocity...

gnawinganimal commented 4 years ago

Honestly we are probably just going to wrap wpilib at this point

gnawinganimal commented 4 years ago

Wpilib 2020 has been release, which means we can start working on paths

gnawinganimal commented 4 years ago

Won't be to difficult, will just be wrapping a bunch of stuff