Skip to content
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

ArduCopter-Heli: Initially reports HEARTBEAT.type=2 (MAV_TYPE_QUADROTOR) #11591

Closed
DonLakeFlyer opened this issue Jun 14, 2019 · 21 comments
Closed

Comments

@DonLakeFlyer
Copy link
Contributor

This is happening for me on ArduHeli 3.6.9 ChibiOS build. I assume it will happen on other builds as well.

The first heartbeat you get after boot has HEARTBEAT.type=2 (MAV_TYPE_QUADROTOR). Subsequent heartbeats you get will come through as HEARTBEAT.type=4 (MAV_TYPE_HELICOPTER).

Since the first one if wrong this causes QGC to show the incorrect ui since it thinks it's a multi-rotor.

@rmackay9
Copy link
Contributor

@bnsgeyer, FYI if you haven't heard of this before. I would guess that we are sending heart beats before we've set the mav type so perhaps we need a flag stop us from sending heartbeats before that's done.

@bnsgeyer
Copy link
Contributor

@rmackay9 I am not sure where to start on this. I’m guessing this would be somewhere in system.cpp. Need some help.

@magicrub
Copy link
Contributor

Possible fix: #11596

@bnsgeyer
Copy link
Contributor

@rmackay9 is the solution that @magicrub proposed a viable solution? I really don’t have the expertise on this part of the code.

@rmackay9
Copy link
Contributor

@bnsgeyer, I think this could work.. Peter's brought up a potential issue but this might be OK.

@peterbarker
Copy link
Contributor

peterbarker commented Jun 18, 2019 via email

@rmackay9
Copy link
Contributor

@peterbarker, QGC is upset because it uses the first heartbeat to decide what type of vehicle it is apparently.

@DonLakeFlyer
Copy link
Contributor Author

QGC is upset because it uses the first heartbeat to decide what type of vehicle it is apparently.

Correct. QGC shows different parts of it's ui based on vehicle type. The vehicle type is set from the first heartbeat and is not expected to change after that.

@peterbarker
Copy link
Contributor

@DonLakeFlyer If we were to send "generic" until we know what type the vehicle actually is, would that be enough to not break your interfaces? The problem in AP is that we may need to send heartbeats out before we know what the vehicle type actually is.

@rmackay9
Copy link
Contributor

rmackay9 commented Jul 2, 2019

@peterbarker, I wonder why we need to send heartbeats.. something about GCSs detecting mavlin1 vs mavlink2?

@DonLakeFlyer
Copy link
Contributor Author

If we were to send "generic" until we know what type the vehicle actually is, would that be enough to not break your interfaces?

Yes it would. It would treat it as a mavlink generic vehicle. Which does not support vehicle setup.

@magicrub
Copy link
Contributor

magicrub commented Jul 2, 2019

@DonLakeFlyer would you rather not get any heartbeats until we're ready to send the correct one? I think a wrong heartbeat is the wrong way to go. It only takes us less than another half second to know what kind of vehicle we are.

@peterbarker
Copy link
Contributor

peterbarker commented Jul 2, 2019 via email

@rmackay9
Copy link
Contributor

rmackay9 commented Jul 2, 2019

@peterbarker, I should have been more clear. What I mean is why do we have to send heartbeats before the vehicle is initialized. Why not just wait the additional 3 seconds (or whatever) until we have loaded all params and know what type of vehicle we are?

@DonLakeFlyer
Copy link
Contributor Author

would you rather not get any heartbeats until we're ready to send the correct one?

Yup

@bnsgeyer bnsgeyer closed this as completed Jul 2, 2019
@bnsgeyer bnsgeyer reopened this Jul 2, 2019
@bnsgeyer
Copy link
Contributor

bnsgeyer commented Jul 2, 2019

Sorry. Fat fingers.

@rmackay9
Copy link
Contributor

rmackay9 commented Jul 2, 2019

Ok great. I suspect TomP's fix above will work then. @magicrub do you want to PR that?

@magicrub
Copy link
Contributor

magicrub commented Jul 3, 2019

Same fix for all vehicles?

@rmackay9
Copy link
Contributor

rmackay9 commented Jul 3, 2019

@magicrub, for Rover at least I think we should have a similar change. I'm unsure what Tridge and Peter know that we don't know so let's see the fix for Copter go in first..

@peterbarker
Copy link
Contributor

peterbarker commented Jul 3, 2019 via email

@IamPete1
Copy link
Member

closed by #11707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants