-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add fuel tank status support #23137
base: main
Are you sure you want to change the base?
Add fuel tank status support #23137
Conversation
1694f4d
to
d3788e0
Compare
@dagar the build is going to fail for all the boards that are not setting |
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: |
OK I have figured it out: 55eba3e |
dd24248
to
55eba3e
Compare
Looks good, I would just add the UAVCAN portion to kconfig so that we don't have to include this everywhere by default. |
55eba3e
to
39b677c
Compare
Addressed. Thanks for the review! |
0d197ac
to
e2fc35f
Compare
Just FYI we're still seeking comment on the new message, in particular around gas fuels. |
* Adds support to DroneCAN FuelTankStatus messages * Adds fuel_tank_status uORB message * Adds FUEL_STATUS MAVLink stream * Adds parameter to define max fuel tank capacity
e2fc35f
to
240f6b0
Compare
@hamishwillee can you clarify what that means for this PR? Because we don't have any source of gas fuel info in PX4 at this point, as |
@TSC21 Very little. Really just a note that the message isn't live yet and is subject to change. |
…d default values and handling of NaN and unknown cases
4249c5c
to
9cad8b8
Compare
@dagar any suggestions on how to reduce the stack usage overall? Doesn't have to be in this PR, but we should follow-up on that. One thing that I saw that improves it is to use GCC 10 or above - apparently we are still using containers based from Ubuntu 20.04. |
Oh, this is related to this PR: #18129. Long time ago I tried to introduce FUEL_TANK message in MAVLink as well: mavlink/mavlink#1659, but it was not successful, so it was decided to use battery_status as a proxy. Well, at least I can share my experience with dronecan fuel tank + PX4 v1.13.0 and my branch. I hope it will be useful. For our fuel sensor we use only remaining percent (this is the only thing that bettery_status allows). Other fields are just for logging. Good things of using battery_status:
But there are a few problems:
So, I really like an idea to have a dedicated message. Additional fields like consumption rate look great as well. It would be nice to see in real-time a rate based on a flight mode. Is there any discussion about how it will be implemented in QGC? |
Not yet but there will eventually be a follow-up. Though, work in QGC should be independent from the one in PX4, as the interface is MAVLink - so anything happening in QGC will mostly depend on getting the MAVLink message merged and stable. |
THanks @PonomarevDA - I'd forgotten your message, but doubtless it seeded my thinking for the new one. There are many problems with BATTERY_STATUS, which is why we are hoping to replace it with BATTERY_STATUS_V2. The main problem in this context is that it was designed around a power monitor, where the only value you know to be true is the consumed current. Everything else is guesswork based on the assumption that the battery was full when you started. For the new fuel message we're making no assumptions other than the values you send are measured or must be guaranteed to be accurate. So if you measure only fuel consumption then you'd send tank capacity (known to be true) and fuel consumption, and the recipient GCS knows that the remaining fuel and percentage are guesses based on the assumption tank was originally full. It can then prompt for you to fill tank before flying. If the message supplies the remaining fuel, then you know it is actually measuring that, and you can calculate the percentage if you want from the total capacity - in this case you can warn the user to fill up, but you only need to do so when they are low on fuel, not in order to know how much fuel they have. |
Solved Problem
Implemented support for fuel tank status reporting via MAVLink using the new
FUEL_STATUS
message.Solution
FuelTankStatus
messagesfuel_tank_status
uORB messageFUEL_STATUS
MAVLink streamUAVCAN_ECU_MAXF
parameter to define max fuel tank capacityNote that mavlink/mavlink#2112 needs to be merged as well. This validated the implementation in mavlink/mavlink#2107.
Changelog Entry
For release notes:
Alternatives
Data currently is fetched from DroneCAN, but can also be generated through an ECU driver in PX4.
Test coverage
None.
Context
FUEL_STATUS
: FUEL_STATUS message proposal mavlink/mavlink#2107