> I wouldn't want to change the size of the header if it can be avoided.
It's quite a drastic change, but what if the alternative is pushing
protocol stuff inside the envelope? yuck.
> It appears to me that:
> - Many messages already imply their component. We have distinct message
> types for GPS location (final, IMU-integrated) and raw GPS straight from
> receiver. Couldn't there be a packet type for location+vector, and
> distinguish its origin and nature by component? I guess location could be a
> common message, as a camera might theoretically indicate its own location
> and bearing.
I agree that for many types of components/message, Component ID and
message type will be strongly correlated. So there's often not a lot
of information in Component ID. But it's there and if people are using
it then taking it away would hurt.
> - Most mobile/airborne systems don't have multiple processors/codebases
> generating separate MAVLink packets which are then routed through the
> system; please correct me if I'm wrong. If there were, MAVLink could
> certainly be used on an internal data bus.
I don't know about most but our system does. The sensor payload and
autopilot communicate with each other and the ground station using
MAVlink like a bus. Also, ground station and payload software is
implemented as MavProxy modules that are effectively agents on the
same bus too. I'm not sure how important component ID is for us right
now though, but we are talking about maybe adding another payload...
> If we have custom GPS and IMU modules, perhaps they could be made
> to support MAVLink natively? Would a motor controller or actuator ever
> talk MAVLink natively?
What if a single autopilot had multiple IMUs, e.g. (e.g.
aeroelastic/vibration analysis, ornithopter, etc)? Or a very large
airframe had multiple GPS's (for attitude)? The individual components
wouldn't need to support MAVLink natively, but the autopilot could
relay information from them (with the appropriate Component ID).
> - Even components which exist in multiples are limited in number. Is there
> any reason that a component class couldn't be encoded as part of the
> component number, specifically the high nibble?
I think this is the key to the semantic mismatch between Paparazzi and
MavLink. The "class" is not bound to components at all (a-priori at
least, there will of course be correlations). Class is a logical
grouping of message types, it is used to set coarse grained policies
on message handling. For example, messages of class "airborne" are not
communicated over telemetry. Messages of class "alert" jump the queue
for the speech agent on the ground segment, etc. Just about any
component could meaningfully issue an Alert, but a ground segment
component would never issue or expect a message of the airborne class.
It's just a convenience feature (and a way to enlarge the message
space).
I don't know if logical groupings of components would be useful,
maybe. That's something else.
Scavenging a message-class nibble off the Component ID header might be
a good solution though. Does anyone really need more than 128
component ids (for the same system id)? 128 message classes might be
plenty. The current messages.xml in Paparazzi master branch only uses
6 classes.
> Some common messages would be applicable to all classes (e.g. heartbeat,
> read and write variables), but others would be class-specific. This approach
> could begin without breaking compatibility; there would be no clashes until
> new messages are introduced.
I don't think there needs to be any clash at all. Different platforms
could start with a small set of proprietary message classes, and then
gradually refactor onto common ones where it makes sense to do so.
Ultimately there might be a small number of core message classes that
are used consistently by everyone, plus "extension" messages classes
that are platform, application, component or tribe specific. Plug-in
pattern.
The point is it's a semantic packaging mechanism, it should help
manage complexity. Maybe there could be a "future" class for
pre-releasing proposed new standard messages, and a few 'reserved
private' classes that are never used by 3rd party packages. etc. etc.
> Systems using the new messages would
> implement the capability to distinguish by component class. Class 0 could
> be defined as "classless" or "legacy", so compid's 0x00 through 0x0F work
> as they are.
Or old-school, pre-class messages could all get Class ID 128
("depricated"), and slowly removed as the housework makes progress.
Other messages could shift to "depricated" as they are updated, to
mitigate pain from backwards-incompatible changes.
Chris Gough