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

Move initialisation of SerialManager and GCS up to AP_Vehicle #13554

Merged
merged 9 commits into from
Feb 25, 2020

Conversation

peterbarker
Copy link
Contributor

Functional changes here:

  • AP_Stats is initialised after we initialise the serial manager and the GCS console. AP_Stats doesn't do anything that warrants being initialised before SerialManager, and if things to wrong in stats init it would be good to get diagnostic output (if any)
  • Sub sets the delay callback much earlier. A good thing as it is more consistent with the other vehicles and may give GCS feedback while calibrating.
  • we set the ins log bitmask bit rather later in Plane. Considering we initialise logging much than this code, it doesn't matter

Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it !
This need a small override fix on rover

@khancyr
Copy link
Contributor

khancyr commented Feb 12, 2020

AP_Stats could be moved too, can't it ?

@peterbarker
Copy link
Contributor Author

@khancyr AP_Stats is protected by #ifdefs. We only get to use the HAL_ optional compilation things in libraries. Whether AP_Vehicle counts as a library... nobody knows ;-)

@peterbarker
Copy link
Contributor Author

The Rover thing is more than just adding the override. That method is doing some seriously funky stuff to do with outputs, and will require a chunk of inspection before moving the call up in the initialisation order. It also should be removed from Rover's init_ardupilot method.

So one thing I notice is that set_control_channels in Rover calls functions on the motors library before the motors library is init()'d. Fun stuff.

@peterbarker
Copy link
Contributor Author

I've looked through the Rover change and think moving the set_control_channels should be OK. The calls made in there are configuring ranges and types on input and outputs, which should affect things only in a positive manner.

... still needs to be run on some vehicles.

@peterbarker
Copy link
Contributor Author

I've now put this on a Rover and it didn't cause any fires.

@tridge tridge merged commit c247c49 into ArduPilot:master Feb 25, 2020
@peterbarker peterbarker deleted the pr/serial-init-up branch February 25, 2020 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants