ardupilot
ardupilot copied to clipboard
emit board name in separate statustext from serial number
Before:

After:

I tested SkyViper's remote here and it all seemed to work.
And on NavIO2:
AP: ArduCopter V4.3.0-dev (695438be)
AP: NavIO2
AP: 5e3a8d5cbaff427898fd4b9ec446e38e
AP: IMU0: fast sampling enabled 8.0kHz/1.0kHz
I don't see anything wrong with this approach so long as we are willing to spend yet another few bytes of flash on the additional method and calls.
Maybe prefix the board ID string with "ID: "?
This PR would break MissionPlanner functionality.
MissionPlanner parses out the board name by assuming it is followed by these three hex strings. What could possibly go wrong there?
https://github.com/ardupilot/MissionPlanner/blob/master/ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs#L1725
else if (logdata.ToLower().Contains("px4v2") ||
Regex.IsMatch(logdata, @"\s[0-9A-F]+\s[0-9A-F]+\s[0-9A-F]+"))
{
MAVlist[sysid, compid].SerialString = logdata;
}
SerialString is actually used a fair bit - special code for scanning for CubeBlack and CubeBlack+.
So basically we're going to be stuck with emitting this crap.
I don't see anything wrong with this approach so long as we are willing to spend yet another few bytes of flash on the additional method and calls.
Size is an absolute wash ATM:
Binary Name Text [B] Data [B] BSS (B) Total Flash Change [B] (%) Flash Free After PR (B)
--------------- ----------- ----------- ----------- ---------------------------- -------------------------
blimp 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 303520
ardusub 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 161720
ardurover 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 125788
antennatracker 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 322988
arduplane 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 5948
arducopter-heli 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 31156
arducopter 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 0 (0.0000%) 40468
Maybe prefix the board ID string with
"ID: "?
I was considering Board: - but given MissionPlanner parsing the statustexts we can't do this ATM....
I don't see anything wrong with this approach so long as we are willing to spend yet another few bytes of flash on the additional method and calls. Maybe prefix the board ID string with
"ID: "?I was considering
Board:- but given MissionPlanner parsing the statustexts we can't do this ATM....
How about leave the old format + add the two new lines. Then it won't break MP If the new lines are prefixed with "Board:" and "Serial:" (for example) then MP can be changed to read the new Serial: line. Old versions of MP will still be able to read the old line. Then eventually the old line can be dropped.
I don't see anything wrong with this approach so long as we are willing to spend yet another few bytes of flash on the additional method and calls. Maybe prefix the board ID string with
"ID: "?I was considering
Board:- but given MissionPlanner parsing the statustexts we can't do this ATM....How about leave the old format + add the two new lines. Then it won't break MP If the new lines are prefixed with "Board:" and "Serial:" (for example) then MP can be changed to read the new Serial: line. Old versions of MP will still be able to read the old line. Then eventually the old line can be dropped.
There are a few problems. The main one is that we only have a limited amount of buffer space for storing and sening these statustexts, and we are right on that limit for Copter ATM.
The other problem is that would only really encourage people to continue to parse these statustext messages. The same information is availble elsewhere in a machine-readable format.
Additionally, my intent is to reduce the crap we send via statustext, not increase it or provide it in a different form...
I don't see anything wrong with this approach so long as we are willing to spend yet another few bytes of flash on the additional method and calls. Maybe prefix the board ID string with
"ID: "?I was considering
Board:- but given MissionPlanner parsing the statustexts we can't do this ATM....How about leave the old format + add the two new lines. Then it won't break MP If the new lines are prefixed with "Board:" and "Serial:" (for example) then MP can be changed to read the new Serial: line. Old versions of MP will still be able to read the old line. Then eventually the old line can be dropped.
There are a few problems. The main one is that we only have a limited amount of buffer space for storing and sening these statustexts, and we are right on that limit for Copter ATM.
The other problem is that would only really encourage people to continue to parse these statustext messages. The same information is availble elsewhere in a machine-readable format.
Additionally, my intent is to reduce the crap we send via statustext, not increase it or provide it in a different form...
So are we back to just increasing the board name to 23 characters then? This problem still needs to be solved.
So are we back to just increasing the board name to 23 characters then? This problem still needs to be solved.
Yes - we've merged that other PR. Without patches against MP this PR here is a no-go.
Closing this as I don't feel like fighting with MissionPlanner :-)