Ask Your Question

Generic Chemical Sensor Message

asked 2019-05-31 12:04:17 -0500

Droter gravatar image

updated 2019-05-31 12:34:29 -0500

gvdhoorn gravatar image

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
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-05-31 12:29:37 -0500

gvdhoorn gravatar image

updated 2019-05-31 12:33:10 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-05-31 12:04:17 -0500

Seen: 110 times

Last updated: May 31 '19