Arduino and cmucam3 support for ROS

| No Comments | No TrackBacks

Andrew Harris just announced support for the Arduino and cmucam3 with ROS packages in his own ajh-ros-pkg repository. The announcement is below.*

Hello, I have released the source code to my ROS packages for communicating with the Arduino and the cmucam3.

pmad (Arduino)

You can get the code from:

There is a subdirectory in there called "arduino" that contains a sketch.txt file. This is the sketch you must load into the GUI and upload to the Arduino. Once you do that, you can start the PMAD service:

rosrun pmad

Note that you'll have to have a "tty" ROS parameter set up if the USB does not connect as /dev/ttyUSB0. You might have to set tty to "/dev/ttyUSB1" for example. Once you set up the service, you can toggle the digital pins with:

rosservice call pmad_switch_control 4 0

This for example will set digital pin 4 to LOW. Note the status packet below only returns the state of digital pins 4, ..., 7.

In addition to this, there is a service status that returns the current A/D outputs on analog pins 0, ..., 3, digital pins 4, ..., 7, and a count of the number of commands executed.

If you want to get the status to be a "topic", there is an application

rosrun pmad

That will publish the status data once per second. The status message is defined in msg/Status.msg.

BTW pmad stands for power management and distribution, I use solid state relays on the outputs of the digital pins.

cmucam_png (cmucam3)

In terms of the cmucam_png node, it acquires a png file from the cmucam about once every twenty seconds and publishes it as a compressed image. To be honest I haven't used it in a while as I've switched to a firewire USB camera. The image is a PNG file. It takes ~20 seconds per image because they come over a 115,200 bps serial line. They are 352x287 pixels in size.

Right now for some reason I get compiler errors compiling image_view so I can't try the image_view to make sure the image is getting pushed around. However I have recently tested that I can receive an image from the cmucam and save it to disk as a png by just adding a couple lines to save the received png to disk. I am just having trouble pushing the image around ROS, but it might just be my setup. (It worked in the past ;) )

For the cmucam application, there is also a binary that must be downloaded to the camera. The source, etc, for this is in the directory "png-robin". In order to get this working you should have a working installation of the cmucam3 development environment, and be able to compile the examples in the cc3/projects directory. Once you can do this, and download these examples to the camera, you can make a new directory in that examples directory called png-robin and copy the contents of this directory into that one. The makefile will then work and compile the application. I have also checked in a hex file that you can use if you don't want to compile the application yourself. But you'll still have to download the hex file with lpc21isp.

Hopefully I have made the packages correctly, but these are the first ones I've tried to make. If you have any questions on either of these nodes, of if they don't seem to work, let me know!

thanks, -andrew

No TrackBacks

TrackBack URL:

Leave a comment

Find this blog and more at

Monthly Archives

About this Entry

This page contains a single entry by kwc published on January 17, 2010 5:49 PM.

Friday 1.0 releases: diagnostics, joystick_drivers, imu_drivers was the previous entry in this blog.

Monday 1.0 releases: image_pipeline, pr2_mechanism is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.