Smooth turns in survey waypoint missions

Hello. I posted about this in the QGroundControl thread, but it was suggested that I bring it up in the firmware thread. If I’m not in the correct thread, please direct me to where I should go.

I’m trying to figure out how to make the turnarounds in a survey waypoint mission be smooth instead of the default 90° turns. In other words, the default turns look like " Π " and I’d like them to look like " U ".

I need this because I fly a LiDAR sensor on a large quadcopter (Freefly Alta X). Part of LiDAR data processing requires the rectification of the trajectory based on GNSS and IMU data. To get the best results, it is very important that the trajectory be smooth (i.e. no large accelerations from speeding up/slowing down or sharp turns). It has to be smooth even in areas where you don’t care about the data. So, I can’t simply have the turns occur somewhere beyond my area of interest (unless I got very far, but that’s not ideal either).

So, the default 90° turn behavior actually impacts our LiDAR point cloud quality noticeably. Is there any parameter(s) I can change to make the turns smoother? Ideally, it would be a continuous semi-circle, but anything that’s more smooth than the default behavior would help.

Hi @Arktix ,
You can try to increase the waypoint acceptance radius (https://dev.px4.io/master/en/advanced/parameter_reference.html#NAV_ACC_RAD).
To have a smoother turn you can reduce the maximum yaw rate (https://dev.px4.io/master/en/advanced/parameter_reference.html#MPC_YAWRAUTO_MAX )
and maybe try to use a different yaw mode (https://dev.px4.io/master/en/advanced/parameter_reference.html#MPC_YAW_MODE : along trajectory) or even lock the yaw during the whole flight (e.g.: always North).
For the rest, you can also tune other parameters of the trajectory generator itself: https://docs.px4.io/master/en/config_mc/mc_jerk_limited_type_trajectory.html

Have fun with your AltaX!

Hi Bresch,

Thanks for your reply. I’ll play around with some of these parameters and see if it get’s me what I’m looking for. I had thought of waypoint acceptance radius, I figured that would just make the aircraft stop at each waypoint with less X/Y precision (i.e. could stop far short/long/left/right of the waypoint). I haven’t actually tried it though, so I’ll give it a go.

I can’t change the yaw mode because the LiDAR sensor has to always be facing/moving forward. It can’t slide sideways or backwards. This will degrade the quality of the trajectory and, ultimately, the point cloud accuracy.

I’ll play around with the parameters you suggested and see where it gets me. Thanks!

I’m revisiting this topic now that I’ve tested the parameter changes suggested by @bresch. Changing these parameters did help make the turns less robotic and “jerky”–particularly at the corners of the " Π "-- but the aircraft still follows the " Π " shape overall. What’s even more problematic is that it still comes to a brief stop at the corners. I’m still trying to figure out how to make it perform a nice continuous U-turn. In other words, I’d like it to do the turnarounds as a banking curve, like an airplane would. Does anyone have any other suggestions for how to achieve this?

Hello Arktix, I would like to contact you to find out if you have found a solution to the problem of gentle turns in a waypoint mission, because I have the same problem and cannot find a solution.
Thank you :clin d’œil:

Hi lolosoniuc. I haven’t found an ideal solution yet. I have played around with various parameters to make the standard Π turn a little more smooth and not so jarring at the corners, but I have not been able to make a continuous banked turn, like an airplane. At this point, I’m still just flying out beyond my LiDAR collection extents to do the turns. I think a true continuous banked turn is going to require some kind of custom waypoint type and I haven’t had a chance to look into how to do that yet. Sorry I can’t be more helpful.

Hi, I am at the very start of my journey into finding the best/most economical way to build a multi-rotor that will need the same smooth waypoint flying as you do. I want to build to fly a small blackmagic camera and have come across references in Urdu pilot where it describes the spline curve it can plot through waypoints, this might be useful for you to follow up on. https://ardupilot.org/copter/docs/mission-command-list.html.

HI Artix, I see you moved the thread to here. Did you have success with changing the max yaw rate in particular? And have you managed to come across a custom waypoint mode? I am still struggling with the same issue you have. our LIDAR needs to have smooth transitions for precise data.

cheers

Hi Tom,

Sorry for my delayed response. I have played with a few parameters and gotten the aircraft to turn a little less harshly, but I still haven’t figured out a way to get it to do a true banking turn. I think I’m going to need to try coding a custom waypoint type and adding it to the PX4 stack. I’m planning on revisiting this in the winter. If I figure something out I’ll update this thread. Sorry I can’t offer more help now.

I made a PR to smooth out the turns in mission mode: https://github.com/PX4/PX4-Autopilot/pull/16376

1 Like

Hi @bresch, this is great! Looks like this would solve the problem @Tom_Lautenbach and I (and I’m sure others) have with the standard waypoint turns. Do we now need to wait for it to be integrated in the standard PX4 stack, or is there a way we could start using this now?

@Arktix It’s already available if you use the master branch and will be in the next release (v1.12).

About when will v1.12 become available?

Just wanted to update this thread since I know others are having the same issue with Alta X.

As @bresch mentioned above, he was awesome enough to add l1-style navigation logic to v1.12 of PX4, which is not yet in full release (thank you @bresch!). You can check out his pull request on GitHub here: https://github.com/PX4/PX4-Autopilot/pull/16376. If you use the master branch of PX4 it is already in there.

Unfortunately, in my case I need to wait for Freefly to update the Alta X’s firmware to include PX4 1.12 before I can utilize it on the Alta X I fly my lidar system on. My company does not want to take the risk of loading an “experimental” firmware on the aircraft before Freefly has tested it and put out an official release. A little overly cautious in my opinion, but not my decision in the end.

I have been in touch with Freely multiple times about this issue and they have assured me that they’re aware of the l1-style navigation logic being added to PX4 v1.12 and they are actively working on adding banked/smoother turns to waypoint missions in an upcoming version of the Alta X firmware. They have not told me when they expect that firmware to be released.

In the meantime, I’ll share some parameter changes that I’ve found useful in smoothing out the turns. It doesn’t result in a full banking turn, but it’s better than the default settings. Here is the most current set of parameters and their values I’ve been using:

MPC_Yaw_Mode: Along Trajectory
MPC_POS_Mode: Smooth Position Control
MPC_ Jerk_Auto: 4-6m/s (currently testing 5m/s)
MPC_Jerk_Max: 2.5-5m/s (currently using 3m/s)
Nav_Acc_Rad: 4-10m (currently using 6m)
YawRAuto_Max: 20-45 deg/s (currently testing 30deg/s)

If you would like Freefly to add banked turning behavior/l1-style navigation logic to the Alta X I would recommend emailing them to let them know it’s a feature you want if you haven’t already done so. The more people who let them know they need it the more likely/faster they will get it to us. For now, I hope the above parameter suggestions are helpful to some people.

I’m also experimenting with MIS_YAW_ERR values of 12-90deg. Not sure yet if this helps or hurts. I will update if I find a value/range of values that seem useful.