GithubHelp home page GithubHelp logo

Add a RangeArray message? about common_msgs HOT 6 CLOSED

ros avatar ros commented on July 17, 2024
Add a RangeArray message?

from common_msgs.

Comments (6)

tfoote avatar tfoote commented on July 17, 2024

Looking at the bitcraze one, it does not seem to be self describing. It can't be rendered in a visualizer as it doesn't have enough metadata to capture the relative information between the arrays etc. An example of a range of ranges is the LaserScan which is nicely encapsulated.

For your message you're publishing a collection of readings in a batch, where each already has a full header and stands on its own. Why does it make sense to publish them in a batch with another header rather than let them stand on their own?

from common_msgs.

msadowski avatar msadowski commented on July 17, 2024

We found this approach to be easier to handle in various circumstances. Usually with our sensors we receive 8 readings in one frame, all those readings would have the same timestamps and sensor characteristics.

I see LaserScan is pretty to close to what we need. In fact before we used to have a node producing a LaserScan. If I remember correctly it didn't support 'distributed sensors' approach as all of them needed to converge to a single point (at least if you wanted to work with it in RVIZ).

Having multiple sensors working at once we noticed that depending on application we need to have them appear as single ranges (one per topic), array of ranges, laser scans or point clouds. Through trial and error we arrived to a conclusion that having a RangeArray as a starting point was the most robust way to package the sensor data. To convert to different message types we created a converter package.

from common_msgs.

tfoote avatar tfoote commented on July 17, 2024

Through trial and error we arrived to a conclusion that having a RangeArray as a starting point was the most robust way to package the sensor data.

So can you explain what you tried and why this is "most robust"? Coupling separate readings and adding redundant information makes reusing the data generally much harder. For example although it has a header, it cannot be transformed as all the data is not necessarily in the same coordinate frame or at the same time.

Naively without more information your use case seems more like an application specific usage with specific semantic meaning, and as such should have a message define to reflect that semantic meaning, not a generic Array message with a header.

from common_msgs.

msadowski avatar msadowski commented on July 17, 2024

You might be right and it's quite possible that our applications so far were quite specific.

Let's take an oversimplified example and say we have a strip of sensors like these and for some reason we wanted to create a node that calculates an average value of all the sensor readings. If we were publishing each reading on a separate topic we would quite likely need to subscribe to all of them and then average all the readings when 8 messages are received.

I think we run into similar cases twice before it made sense for us to start using a RangeArray. I think the reason it worked for us is that in most cases we had a node that was handling all of the readings.

If you have some other thoughts on how to handle such cases, ideally with standard message types we would really appreciate some feedback.

from common_msgs.

tfoote avatar tfoote commented on July 17, 2024

Let's take an oversimplified example and say we have a strip of sensors like these and for some reason we wanted to create a node that calculates an average value of all the sensor readings.

This use case captures exactly how use case specific your setup is. Computing the average distance only is valuable if the sensors are in a specific known configuration, however this configuration is not encapsulated in the proposed message and is likely specific to your setup. If you want to support that sort of operation in the message the message should contain the offset information etc that allows you to know that an averaging operation is valid to run on the data. As an example the LaserScan includes the offsets between the lasers, an assumption of them having a single origin etc. The value in having the standard message is that you expect others to have the exact same setup.

If we were publishing each reading on a separate topic we would quite likely need to subscribe to all of them and then average all the readings when 8 messages are received.

Yes, that's not unreasonable to do, if you really need them all. A standardized enumeration of topics within a namespace for the array would make this a trivial for loop. You can also publish them all on the same topic and differentiate them by the frame ids. There are several different approaches for synchronizing parallel topics/messages. You already have the policy for doing that in your single node that's publishing them in aggregate, it can trivially be moved to after the messages are published. Moving the aggregation and averaging policy later will allow potentially multiple implementations to be used simultaneously. (For example if you have an array of sensors across the front of the robot, with left array, right array, and center array. You may want to aggregate across left and center for one metrics and right and center for another metric, with overlapping fields of view (used sensors) If you were to force the messages to be published together you'd end up needing to republish overlapping arrays. And at the same time if another algorithm wanted just the left most sensor for wall following it would not be accessible on it's own, despite being a fully self contained and valid message.

Now if you were to start distributing a robot with the sensors fixed and mounted in a standard pattern that might make sense for a robot specific message as that could be reused in the context of that robot. But it still would not make sense to be a generic message as it would only be semantically meaningful for sensors in the exact same configuration as that robot, thus it's semantically tied to the robot. robot_name_msgs/SensorArray might make more sense. However even then I'd recommend avoiding that as it would lock in the exact sensor array configuration to the data processing pipeline. And you'd have to reimplement it if either a similar robot with a similar array of sensors (but different with say a slightly different mounting angles) or the next generation of the same robot with an improved sensor suite was added you'd have to implement a parallel data processing pipeline to support the alternative arrangement.

In general the messages should have strong semantic meaning and be able to encapsulate their full meaning so that data pipelines using them don't need to change even if the configurations change.

from common_msgs.

tfoote avatar tfoote commented on July 17, 2024

Without a specific proposal for this I'm going to close this.

from common_msgs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.