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

Messages hard to read for messages with an index #3130

Open
dewagter opened this issue Oct 5, 2023 · 5 comments
Open

Messages hard to read for messages with an index #3130

dewagter opened this issue Oct 5, 2023 · 5 comments

Comments

@dewagter
Copy link
Member

dewagter commented Oct 5, 2023

We have a growing amount of messages that have an index. ESC``, AIRSPEED```, ...

I was thinking: if in the message definitions we add an index field: e.g. <message name="AIRSPEED_RAW" id="138" index="sensor_id">

Then the messages program could store and show the last message for each index.

@gautierhattenberger would that be hard in OCAML?

@Fabien-B
Copy link
Contributor

Fabien-B commented Oct 5, 2023

I plan to rewrite the Messages tool in python with Qt in the future.
A systematic solution to distinguish between a normal field and an index field would be nice indeed. Maybe it could just be a simple rule like:
The index field shall be the first field of the message and shall be named "id".

@gautierhattenberger
Copy link
Member

The pprzlink message header has a field for class/component id. For now, only the class part (4 bits) is used. The idea of components was to remove stuff like sensor_id, and display messages correctly in tools like messages. However the max ID is 16, so it means that the IDs should be allocated at compile time to avoid limitation ?
The other solution is indeed to use a field of message with a standardized name. We already have comp_id for some sensors. I think only the name and type of the field should matter, not the position in message.

@dewagter
Copy link
Member Author

dewagter commented Oct 5, 2023

  • Either defined in the header of the message: <message name="AIRSPEED_RAW" id="138" index="sensor_id">
  • or any message with a uint8_t comp_id if you prefer

Could e.g. fill an array like:

image

@fvantienen
Copy link
Member

This would be indeed be nice, also for the real-time plotter

@dewagter
Copy link
Member Author

dewagter commented Oct 5, 2023

The ABI_ID is a logical way to find out who sent which ID, but in case of actuators (e.g. ESC message) the 4 bit comp would be a little insufficient.

By defining in the messages.xml which field is an index, we do not need to change anything anywhere to the transmission nor reception nor logging. It would just be a visualization thing. If the message has an index, a visualizer like messages or real-time-plot could either filter by index (e.g. plotter shows temp of 1 motor) or show both (messages show both airspeed_raw's). But nothing needs to change in the drone, server, or anything else.

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

No branches or pull requests

4 participants