ardupilot
ardupilot copied to clipboard
Copter: Restore the start-up radius and rate
I set circle_control_enable to 1 in circle mode and did the radius manipulation. I found out that this specification changed the values of circle radius and circle rate. I learned that I used this circle radius in the MAV_CMD_NAV_LOITER_TURNS command. I do not use the modified circle radius and circle rate in circle mode with the MAV_CMD_NAV_LOITER_TURNS command. I want the MAV_CMD_NAV_LOITER_TURNS command to use the default values. I want the circle radius and circle rate changed in circle mode to return to the values they were at mode startup.
This looks like an improvement but I think the same problem happens with the LOITER_TURNS mission commands and it might be a good idea to fix both problems at once. For example, I think if a loiter-turns command sets the rate and radius then the next time the user enters Circle mode it will use the values specified in the loiter-turns command.
A more complete solution might be to enhance AC_Circle so that get/set_radius and get/set_rate affect a copy of the parameter values instead of directly affecting the parameter values.
Then AC_Circle::init could always restore these temporary values to the parameter values.
@rmackay9 san. Thanks for the comments and ideas. I will change it to include comments and ideas.
@rmackay9 san. I've changed the following Do not change the circle radius and circle rate of the config parameter. Set the values of the configuration parameters for the circle radius and circle rate for change during initialization.
I was able to confirm that circle mode and the MAV_CMD_NAV_LOITER_TURNS command had no effect on the radius and rate.
Needs a rebase ontop of https://github.com/ArduPilot/ardupilot/pull/17331 and https://github.com/ArduPilot/ardupilot/pull/16757
A lot has changed in here, and my guess is the conflicts will be horrible.
@muramura did you want to pursue this?