ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Generic Chemical Sensor Message

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

Droter gravatar image

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

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
0

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

gvdhoorn gravatar image

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

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

Question Tools

1 follower

Stats

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

Seen: 234 times

Last updated: May 31 '19