"S Curves" in Auton

In my autonomous research, I heard several people mention “S Curves.” Essentially, the robot follows the pictured path in one fluid motion. Invictus (365X) used these in their 1st place skills run. From what I can tell, “S Curves” allow teams to quickly move to different positions in auton. How do you program an “S Curve?” And what makes an “S Curve” more accurate than linear motion?
S_Curve

5 Likes

So these S-Curves are Bezier Curves/Spines from 2-D motion profiling. Bezier curves are based on Bernstein polynomial extrapolations. Splines are more accurate since 2D motion profiling takes into account the motor’s 3rd derivative of position, and the polynomials account for the variance in inconsistencies present.

4 Likes

http://www2.informatik.uni-freiburg.de/~lau/students/Sprunk2008.pdf

3 Likes

You could accomplish this through the okapi library in pros. They have s-curve math planned out for you and all you need to do is a generate a path (and configure your robot).

4 Likes

Thanks! That helps a lot. My team is currently coding in VEXcode due to the limitations of our school computers. Can the pros math be transferred into VEXcode?

I don’t know how to do that but if your coder has a computer, I recommend just using that to code

1 Like

I mean you could always create your own s-curve functions but I can’t guarantee that will be remotely easy. Lucky for you there is a lot of resources online for this kind of stuff.

1 Like

It is definitely possible to implement S-curves in any programming system. (We implemented something similar on the old system in RobotC). What’s different about using PROS is that it includes a library called OkapiLib, which provides implementations of S-curves and various other forms of autonomous movement for you.

Your options are effectively:

  • Switch to PROS and use functionality from OkapiLib
  • Implement whatever autonomous motion you want/need in VEXCode
  • Try to port OkapiLib (or something similar) to VEXCode

First one is definitely the easiest way to get from 0 to S-curves, but that doesn’t necessarily mean it’s the one you should do.

9 Likes

Thanks so much for the extremely helpful suggestions!

My team will attempt to port the PROS OkapiLib to VEXcode. I will try to grab the lab off of my personal computer’s insall of PROS. (PROS does not work well on our school computers.) If it works in VEXcode, I’ll let you know!

1 Like

At risk of hijacking the thread, any chance you could elaborate on this?

1 Like

My school computer has the same problem. The district basically allows certain applications to be downloaded. Everything they haven’t given the okay (even if the application is educational) can’t be downloaded for the most part. That includes the PROS library and the Atom IDE.

Eh, I’m not sure that “doesn’t run well” is strictly the same as “unable to install due to policy,” which is why I asked the OP for clarification.

1 Like

I see now. Sorry for any confusion

You caught the vague spot in my answer! My team opted not to use PROS this year for several reasons:

  1. Our school (for whatever reason) has macs. Through some compicated steps we have been able to override the network and force a local admin. This sitll doesn’t change the fact that we switch classrooms very frequently. Due to the extra steps it takes to install PROS on a mac and our changing environment, we decided that it would not be worth the lost time.
  2. Additionally, this is my team’s first year coding C++ for robotics. I am starting everyone on VEXcode, because it is similar to what I am familiar with.

Thanks to the wonderful responses in this thread, I have reached a conclusion: I will use PROS on my personal laptop to snag the Okapi libraries and import them into VEXcode. When we get our robot running. I will experiment with using the libraries in auton. Until then, we will learn more about VEX coding on VEXcode.

1 Like

Is the mentioned 365X skills run from Tower Takeover? If so, does anyone know where I can find a video of their run?

You can watch it here

1 Like

if you are having trouble using that link use this

1 Like

Ill throw my 2 cents in too.


This document is one of my favorites. A great summary of the work done by 5225A

Additionally, s curves could be simplified into 3 motions if you aren’t at a level where you can comprehend the math behind that level of odometry: Wide turn left > Straight > Wide turn right.

A wide radius turn refers driving forward and turning simultaneously, so that drive train velocities L, R > 0 and R > L. This will result in an arc, and assuming you compensate for holonomic wheels drifting and variances in wheel speed. Just set the motor velocities so that one side is like twice the other, and then decide if you want to rotate until R.position is reached, or R.position-L.position is reached.

Then go straight and then repeat the previous procedure until the wheel positions are equal again.

>> Remember: The real odometry is way better than this. This method will not be nearly as consistent, and will not actually track the instantaneous position of the robot during the turns, and therefore will not necessarily end up where you want it.

3 Likes

Where would you find the math on OkapiLib for the S-Curve? I could not find it on the V5 PROS Documentation website.

Okapilib uses Pathfinder, which is open source on github.

2 Likes