locked
Design Question: Sensor/Actuator Array vs Individual Sensors/Actuators RRS feed

  • Question

  • I'm interested in hearing the pros and cons of the design choice around individual sensors vs. sensor arrays. For example, I noticed that Robotics Studio includes both a "Generic Analog Sensor" and a "Generic Analog Sensor Array."

     

    Is this merely a matter of scale? Does it matter if I have 2 vs 200 sensors? Is there an impact based on the number of service instances that get instantiated? It seems that writing code against the array model might be more convenient because I could use filtering to get notifications of only the sensors I'm interested in. Of course, I could design something like a sensor service that just gets notifications for every sensor of a givent type and then just write code that decides which ones to act upon.

     

    Hopefully these question makes sense.

     

    ChuckMoose

    Saturday, April 26, 2008 4:01 AM

Answers

  • It is a matter of convenience and also perserving runtime resources. Service instances are not big but they more expensive than just a single service with an array of doubles, one per sensor reading Smile

     

    As you said, using an array model, you can do easy querying, filering on notifications and you have less complexity setting up partnerships between services.

     

    The downside is that if you have sensors that are "special", like for example a LEFT IR sensor with different settings than a RIGHT IR sensor, then having two service instances, with different initial configuration, makes more sense. But even then you can have a single instance service with an array for configuring each sensor etc.

     

    One more issue to consider: If you want other services to partner with a sensor that again has some special meaning due to its locations, configuration, etc, having two service instances, with two different URIs (/sensor/left, sensor/right) allows you to re-use the DSS partner attributes and DSSME.EXE, where i you have just a single service with an array, you woul dhave to write custom code to filter, partner, etc and look at specific array indices

     

    g

     

    Monday, April 28, 2008 9:25 PM