Re: ros node protocol

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: ros node protocol

Andrew Harris
On Sun, Jan 10, 2010 at 4:57 PM, Andrew Harris <[hidden email]> wrote:
>   I have been communicating with an Arduino as well as a cmucam for a
> while now using ROS

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:

https://ajh-ros-pkg.svn.sourceforge.net/svnroot/ajh-ros-pkg/pmad/trunk

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 pmad_service.py

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 pmad_status_publisher.py

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.

https://ajh-ros-pkg.svn.sourceforge.net/svnroot/ajh-ros-pkg/cmucam_png/trunk

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

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|

Re: ros node protocol

Andrew Harris
On Jan 17, 2010, at 2:12 PM, Andrew Harris <[hidden email]>  
wrote:

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

Let me also apologize for totally hijacking this thread.  I guess I  
heard the word microcontoller and got excited.

-andrew

>

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
ros-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ros-users