New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Mavlink MOUNT_CONTROL handling #7384
Comments
@olliw42 I'm feeling a bit slow ATM. Are you suggesting that the call AFAICS, with the current strange interface where we pass in either angles or lat/lon precludes us from pre-dividing these numbers. |
first off, experimentally one of the commands yields 100 times too low gimbal control (that's how I stumbled across it). I believe it is the COMMAND_LONG. control() is called from COMMAND_LONG, which appears to be the new official to-be used mavlink, and the other is marked deprecated in the code, I thus would find it natural that control() provides the according interface, i.e. floats in degrees. The _GPS_POINT needs to be factored out, one would e.g. introduce a method to be called from COMMAND_LONG, which has floats too, which I would find natural too to do. yes, the "->" point to what I think it should become hope that helps a bit Note, the issue wasn't there in AC3.5.x. It - so it appears - was introduces without properly considering the side-effects and without proper testing, and without following the "bread crumps". Maybe a general lesson to be learned here. |
On Mon, 29 Oct 2018, olliw42 wrote:
first off, experimentally one of the commands yields 100 times too low
Ah ha! That's the key. I shall stare at the code paths - and, more
usefully, write tests for each of them. Thanks!
[many useful details snipped]
|
once pointed at it I considered it obvious from the code |
@peterbarker what is the status on this? |
Looks like this was fixed by #9288, @peterbarker ? |
@IamPete1 AFAIK this problem is as yet unsolved and we can't get to there from here. IIRC its basically a degrees vs centidegrees issue |
Maybe we can close this now? Again, sorry it took so long. |
closing it since resolved :) |
even though it is crystal clear that ArduPilot does not have any bug, these lines are wrong:
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Mount/AP_Mount_Backend.cpp#L42
-> control(0.01f*(float)packet.input_a, 0.01f*(float)packet.input_b, 0.01f*(float)packet.input_c, _state._mode);
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Mount/AP_Mount_Backend.cpp#L45
-> void AP_Mount_Backend::control(float pitch_or_lat, float roll_or_lon, float yaw_or_alt, MAV_MOUNT_MODE mount_mode)
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Mount/AP_Mount_Backend.cpp#L58
-> set_angle_targets(roll_or_lon, pitch_or_lat, yaw_or_alt);
these changes imply some follow-up changes higher-up, which are easily found, and thus not listed
The text was updated successfully, but these errors were encountered: