Robotics StackExchange | Archived questions

Abstraction layer for embedded hardware?

Does ROS have any package for abstracting the management of the state for embedded controllers like an Arduino or other microcontroller?

I'm trying to write a high-level behavior in rospy for a two-wheeled platform, which relies on reading sensors from several microcontrollers, and I'm finding myself writing a lot of boilerplate to push actions to the controller to enable/disable certain sensors, and then collect those values in ROS. I'm using rosserial, which takes care of the low-level message passing, but doesn't do anything beyond that. I have to explicitly subscribe to dozens of different topics, define expected refresh rates, and staleness thresholds if certain messages aren't received. I then have to manage the "estimated" state of the controller using Python callbacks and a register storing the last received message for each sensor topic. It's far more tedious than I expected, especially since I thought the whole point of ROS was to take care of low-level stuff like this.

I'm sure I'm not the first person to encounter this problem, but searching the packages, I can't seem to find anything to address these problems. I guess what I'm looking for is a more generic form of the diagnostic aggregator, which tracks all diagnostic messages and maintains a global diagnostic state. Does something like that exist? What's the "ROS" way of doing this?

Asked by Cerin on 2018-05-16 20:06:50 UTC

Comments

since I thought the whole point of ROS was to take care of low-level stuff like this.

I'm not sure that is true. 'ROS' provides you with the infrastructure to communicate, as it's a middleware. With that comes location transparency and some other things. The rest is up to you -- or other pkgs.

Asked by gvdhoorn on 2018-05-17 02:10:52 UTC

I guess what I'm looking for is a more generic form of the diagnostic aggregator

It's not exactly that, but perhaps py_trees_ros can help here nonetheless.

Asked by gvdhoorn on 2018-05-17 02:13:48 UTC

@gvdhoorn Yeah, that's not really what I'm looking for, but that's an interesting project regardless. Thanks.

Asked by Cerin on 2018-05-17 10:04:23 UTC

Answers