ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.81k stars 17.27k forks source link

Copter: Number of rotations of MAV_CMD_NAV_LOITER_TURNS does not rotate. #14339

Open muramura opened 4 years ago

muramura commented 4 years ago

Bug report

Because the value of the get_angle_total method is larger than the actual YAW value, the rotation stops in the middle and the process does not finish. The rotation speed is 90 degrees per second. https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/mode_auto.cpp#L1839

Issue details

Please describe the problem

Version What version was the issue encountered with

Platform [ ] All [ ] AntennaTracker [X] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type What type of airframe (flying wing, glider, hex, Y6, octa etc)

Hardware type What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)

Logs Please provide a link to any relevant logs that show the issue

rmackay9 commented 4 years ago

Ok, so the issue here is that the vehicle is trailing the target point that is moving around the circle. This means that the vehicle stops before it actually completes the circle. I think that if it's given a bit more time (perhaps using a delay) it will reach the final target... so one possible solution may be to check that the vehicle is within the WPNAV_RADIUS of the target somehow.

muramura commented 4 years ago

@rmackay9 san. I want to rotate the copter N times, with WP in place. The radius of the circle is set to 0.

muramura commented 4 years ago

In the following, the number of preceding rotations and the number of specified rotations are judged. Therefore, I adjusted the ratio of the overturn by adding a value of 0.0 or more to the specified number of rotations so that it becomes the actual number of rotations. At SITL, it got good. I think it would be even better if they let you get the actual number of rotations.

https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/mode_auto.cpp#L1839