-
Notifications
You must be signed in to change notification settings - Fork 190
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
Organizing sensor messages by stamped and unstamped #143
Comments
In the case that you have a device that outputs multiple different datatypes I would recommend against making a custom message of this sort. This breaks the abstraction of the individual messages and means that you will need to have custom logic for processing the data from that manufactures sensors. For the abstraction the timestamp and frame_id of each reading is inherent to the measurement and is critical to being able to process and utilize the data contained in the message. Grouping the messages based on their physical/device association doesn't make sense for downstream consumers. In your example I could have a simple widget that displays the temperature, that knows how to render a Temperature.msg. If you publish that combined message the simple widget will have to know how to subscribe to the VelocityAndTemperature msg as well and then select the right subfields. The most common way to do this would be to put another node in the middle that would republish the standard submessage from the conglomerate so the widget would not need to be recompiled. This would be a large step backwards for standard messages to break apart the encapsulation. If you have a aggregate message that has a semantic meaning it might make sense to create a custom message for your application with both contained. However if you do that I'd recommend using the standard message datatypes so that they can be used with libraries that leverage the standard message datatypes. (Maybe the temperature widget has a c++ API you can use directly not just the topic.) And lastly just because readings come from the same sensor does it mean that they have the same timestamp or frame_id. If the device is large, the position of the angular velocity sensor might be different than the temperature sensor. For this example it might not be meaningful, but consider a stereo camera with an IMU built in. This is very common for visual odometry, but their different origins are important. And also in that case the IMU usually has a much higher datarate than the cameras so the timestamp too is potentially different. |
Thanks for your thoughts. You make perfectly reasonable points:
I have a few questions regarding good choices of message structure based on usage pattern. I hope you can help me identify the best practices for messages:
|
As proposed in #101 there would not be an aggregate message which is following your point 3. I think that you're coming at this from the wrong point of view. Your limiting factor for using the parallel channels is that the message filter implementation is too large/complex for your use case on bare metal. But I would suggest in general that the design goals of the message_filters is inappropriate for running on resource constrained environments like bare metal. It's designed to stack everything up in memory and hold everything until arbitrary conditions are met. This is not what you need for using and processing IMU messages on a small microcontroller. So a much simpler logic could be used specifically to merge and synchronize the messages that you need. And in fact having smaller messages will be better in bare metal environments because you won't have to get any duplicate information if the data sources are coming in at different frequencies and they are smaller to allocate on the microcontroller.
I'm not sure how the header gets in the way of debugging, you can always ignore them.
message_filters are only on the receive side. If your publishers are not coordinated then you will likely need an approximate time policy as the probability of two publishers hitting the exact same timestamp are negligable. That's not really something that the message_filter can change in any way.
Requiring the combined message is not really a corollary to the message_filters implementation being too bing. There's nothing magic in the message_filters and instead of changing the datatypes that will effect the entire system, just implementing a simpler version of the synchronization logic on your target than the message_filters implementation that is too big, is a simpler solution. |
Currently, all sensor messages have the stamp built in. This is the expected behavior. However, when the sensors drivers provided by OEM return data that's covering multiple messages, (and when using message filter is either not feasible or overkill) I felt the need for using Unstamped form of the message.
Basically, for new messages being proposed such as those in #101, can we have the following:
This allows combination of messages to be done for sensors.
As a followup, if we added code during generation, we can allow for explicit conversion (implicit might be bad for obv reasons) between messages which have a
data
orvalue
field in them without having to specify the field such asThis might help in reducing the number of indirections required to refer to the data member in some places.
The text was updated successfully, but these errors were encountered: