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

Revision history [back]

click to hide/show revision 1
initial version

I answer myself just as reference for others searching for the same. I found it hard to find reference to a real robot, most people seems to use simulations only or just keep firmware things secret

I came to the conclusion not to use rosserial for Arduino as even on Arduino Mega, it consumes too much of the limited RAM. Instead, I use my own proprietary message format which has mostly no overhead. The Arduino is connected to a Raspberry PI running a ROS node (i call it driver), which reads all incoming messages and translate them to custom ROS messages. This driver also writes data back to Arduino (like motor commands) with my own data format.

This seems to work somewhat reliable. Also, at Arduino side, I send often needed data (like Odometry, IMU) as a continuous stream (every 100ms). Other, rarely needed data (overall system status like battery voltage) will only be send, if ROS node (driver) asks for (every 10 seconds).

Any event (bumper hit, drop sensor, overload of motors) will only gets send by Arduino, if they occur.

The ROS node (driver) itself will publish my custom messages. This way I have raw data of Arduino availabe as topics for further processing. Another ROs node, I call it base_controller, subscribes to my custom messages and translate (publish) them to ROS standard messages (/odom, /tf and so on). Also it has a subscriber to cmd_vel and set desired speed to driver via a ROS service provided by driver.