Rover S-Curves alpha testing

Thank you, Randy. I will do a little more experimentation with those parameters.

A brief test after a bootloader update shows that we may have solved the elusive waypoint issue. Time will tell there.

1 Like

I had a chance to test the S-curves with a Traxxis X-maxx rover today.

Using default parameters, it tracked really well. A little extra P got it turning quite tightly. At higher speeds I did need to up the I and Imax terms to keep the rover on the track.

Using standard Ardupilot with L1:

Using S-curves:

2 Likes

@stephendade,

Thanks very much for testing!

The S-Curve path looks quite a lot better to me. I see you got it cutting the corners nicely as well. So I guess overall you found it was an improvement right?

Big improvement! And much easier to tune - the L1_ (and associated WP_) params were always a bit tricky to tune.

1 Like

How did you go with getting it to maintain speed? Every sim run I did, if the waypoint speed was more than 2 or 3 m/s it would keep trying to slow down.

Well done. Would be interesting to see a dump of your tuning parameters (and a brief overview of how you arrived at them if it’s not too much trouble).

On a different note:
We need more folks involved with this effort. The lack of testers, it seems, will likely stall development until 4.3 unless we can generate some interest. I fear the community at large isn’t quite aware of just how significant this change is, nor how much it can potentially alleviate a lot of nav tuning woes.

2 Likes

I’ll have my Rover available for test very soon when I return home from remote work. Looking forward to doing some driving!

2 Likes

I have one of my rovers ready to test, but the weather is more or less constantly crap. Testing on a parking lot in pouring rain or snow is not my kind of fun…:confused:.

1 Like

Looking at my logs, it did slow down to 2m/s during turns. Will need to investigate this.

I won’t be much help testing faster speeds. All my Rovers max out around 2m/s.

Great to see the activity on this thread! I posted on facebook a few days ago so maybe that’s part of it.

@mroberts,

Re slowing down, the vehicle could/should slow down in the corners in order to keep the acceleration below the limits. The SCurve path calculator only accepts a single acceleration so we use the lowest of WP_ACCEL, ATC_ACCEL_MAX , ATC_DECEL_MAX and TURN_MAX_G (*9.81 to convert to m/s/s). As a side note, looking at these names I wonder if we should rename WP_ACCEL to WP_ACCEL_MAX to match the ATC_ params.

It may also slow down though unnecessarily if waypoints are placed too close together. This is something we could fix with some more effort, it actually affects multicopters as well.

Anyway, if you give me a specific mission or log file where you’re seeing a slowdown I’m happy to have a peek.

Txs again for testing!

1 Like

A did a few SITL runs to investigate the slow-down-during-turn.

Using standard SITL, I cranked up ATC_ACCEL_MAX to 10 and put WP_RADIUS to 6. The vehicle regularly got to within 1.4m of the waypoints before turning. Huh.

Yep, managed to greatly reduce the slowing-in-turns greatly via the raised ATC_ACCEL_MAX

@stephendade,

In general higher accelerations will cause the vehicle to get closer to the waypoints (e.g. turn later). Lower accelerations will cause the vehicle to pass farther from the waypoints (e.g. turn earlier) but it will never turn so early that the vehicle ends up farther than WP_RADIUS from the waypoint.

So with SCurves the path won’t change much depending upon the WP_RADIUS but the accelerations coudl make a large difference.

Of course if you set very high accelerations the vehicle may not physically be able to achieve them and then we will end up with position and velocity errors and the vehicle will end up off the path. The SITL vehicle’s maximum acceleration is surprisingly low actually. Less than 1m/s/s I think.

Yes, that makes sense.

I wonder if we need an option for selecting “maintaining speed vs a small radius turn”? It seems that, depending on the vehicle and mission requirements, some people may prefer a larger radius turn (ie keep the centripetal accel down) if it means the vehicle doesn’t slow down too much.

What I’ve observed though is that it slows down such that it never actually hits any of the accelerations - I can set the lowest of the accelerations to 5m/s and it will still only pull 0.1 through the corner.

1 Like

@mroberts,

Thanks for that testing, I’ll see if I can reproduce what you’re seeing.

During the tests the vehicle was travelling at a high speed? Especially with ackermann vehicles there is a physical limitation on how high the lateral accelerations can get based on the vehicle’s maximum steering angle and its speed.

I’m not saying you haven’t found a problem though. I’ve also noticed that, even in master, the vehicle never attains the desired lateral acceleration. To clarify the method used, in master in Auto, Steering, etc the L1 controller calculates a desired lateral acceleration back towards the path. We then use a simple calculation (using the current speed) to convert this to a desired turn rate which is then passed into the turn rate controller.

With S-Curves things are a little different in that the S-Curves calculate a path. The position controller is then responsible for getting the vehicle back on the path so it calculates a desired forward/back speed and a lateral acceleration. This desired lateral acceleration is still converted to a turn rate and then passed into the turn rate controller.

It’s strange that even though the vehicle is achieving the desired speed and turn rate (or I think it is anyway) that it doesn’t achieve the desired lateral acceleration (in the simulator at least)

I’ll do some more testing in sim once we’re through our current physical test campaign (still running L1 in the real world). In Sim I just could not find a combo that would have the sim rover holding even 4m/s through the corners - it would always decelerate.

I tried to decipher the code, but S curve is way more complicated (to me) than L1, and L1 had a nice pictorial page that explained it.

On another note - did you get my message with the link to the dataflash log to try to understand the “Unhealthy AHRS” message?

Looks great, I want to help testing. Could you provide binaries for MatekH743 please?

1 Like

@kisdia,

I pulled Randy’s latest changes and built a MatekH743 binary from the rover-scurve5 branch, linked below.

ardurover-20220221-Rover-SCurve5.zip (MatekH743)

2 Likes

Hello all,
I am willing to try this feature with my two rovers: two rc cars in 1/16 and 1/5 scale, but I would need the binaries for a black cube.
I fact, I am very interested in trying s-curves, as I having a stupid problem: I want my rovers NOT to stop at every WP, now, it stops even for waypoints in a straight line with no need to do reduce speed. I have tried to set WP_SPEED_MIN to 1 m/s but, still, I can see in the logs that the desired speed goes to zero at every WP. is there something obvious i am missing? or it is not possible to maintain speed in “easy” waypoints with the current algorithm?
I understand that with s-curves there will be no speed reduction if not needed, am I right?
thankyou and regards!
Adolfo.