Abstraction layer for embedded hardware?

asked 2018-05-16 20:06:50 -0500

Cerin gravatar image

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?

edit retag flag offensive close merge delete

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-17 02:10:52 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-17 02:13:48 -0500 )edit

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

Cerin gravatar image Cerin  ( 2018-05-17 10:04:23 -0500 )edit