Robotics StackExchange | Archived questions

Generic Chemical Sensor Message

We are interested in extending the ROS sensor_msgs with a chemical sensor message. It would be the same for Nitrogen, Phosphorous, Potassium, etc.

Is there a standard ROS way to make these a generic message if they all have the same data output (value, variance)? Or is the best way to define each chemical sensor separately?

sensor_msgs/CO2 Message
File: sensor_msgs/CO2.msg

Raw Message Definition

 # Single CO2 reading.

 Header header           # timestamp is the time the CO2 was measured
                         # frame_id is the location of the CO2 reading

 float64 CO2             # Measurement of the CO2 in PPM

 float64 variance        # 0 is interpreted as variance unknown
                         # The average of the squared differences from the Mean

Compact Message Definition

std_msgs/Header header
float64 CO2
float64 variance

Asked by Droter on 2019-05-31 12:04:17 UTC

Comments

Answers

Or is the best way to define each chemical sensor separately?

Well, what are you actually measuring with these sensors? I believe that should be what determines the naming of the message. The fact that a specific message on a specific topic then encodes "ppm CO2 in a certain location" could come from the (standardised) topic name and information in the header (similar to sensor_msgs/Image: if you subscribe to image_raw it's an unprocessed frame, if it's on a left topic (in a stereo setup) it's from the left camera, we don't give those different msg types).

If this would be similar to the Range message however, you'd use an enum for each measured quantity.

From your description it sounds like this message would encode a concentration. Perhaps that would be a good name? Or more specific: what type of concentration?

Edit: gas concentration? For liquids it would be molarity apparently.

Asked by gvdhoorn on 2019-05-31 12:29:37 UTC

Comments