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

Revision history [back]

There are conceptually two things: hardware and software. Software interacts with hardware by means of software drivers. So in your case robot, with all its motors, sensors, buttons etc. is a hardware. The low level interaction with such devices is usually achieved on OS level by drivers, these drivers in turn provide higher level software interfaces (APIs) to user programs, for instance to ROS nodes.

Thus, first you have to be able to control LED-usb-device from OS level, i.e. write/use the driver for "digital output" you mentioned. It is actually can be as simple as writing data to serial port. When it is done you will need to write a wrapper node that do the blinking. In this node add a subscriber to, for example, odometry messages and in a callback function call the LED-usb-blinking-code.

Unfortunately, I am not familiar with Care-O-Bot infrastructure and don't know the exact topic names for odometry etc, but you can try to find it out with $ rostopic list.

Of course you may want to use services to start and stop LED-blinking-code later, but the above should be sufficient for the beginning.

P.S. Since you did the main tutorials I presume you know how to write publishers/subscribers already.

Hope it helps.

There are conceptually two things: hardware and software. Software interacts with hardware by means of software drivers. So in your case robot, with all its motors, sensors, buttons etc. is a hardware. The low level interaction with such devices is usually achieved on OS level by drivers, these drivers in turn provide higher level software interfaces (APIs) to user programs, for instance to ROS nodes.

Thus, first you have to be able to control LED-usb-device from OS level, i.e. write/use the driver for "digital output" you mentioned. It is actually can be as simple as writing data to serial port. When it is done you will need to write a wrapper node that do the blinking. In this node add a subscriber to, for example, odometry messages and in a callback function call the LED-usb-blinking-code.

Unfortunately, I am not familiar with Care-O-Bot infrastructure and don't know the exact topic names for odometry etc, but you can try to find it out with $ rostopic list.. It might be easier to do on the robot itself, but simulation should be enough as well.

Of course you may want to use services to start and stop LED-blinking-code later, but the above should be sufficient for the beginning.

P.S. Since you did the main tutorials I presume you know how to write publishers/subscribers already.

Hope it helps.