Falko
Falko

Reputation: 17942

Access GPIO pins of Raspberry Pi 2 with ROS

I'm trying to access the GPIO pins of a Raspberry Pi 2 using the robot operating systen ROS. I know, there are many tutorials on this topic. But my problem is as follows:

So, what's the "easiest" way to get GPIO access within a ROS node?

Upvotes: 0

Views: 2274

Answers (1)

Falko
Falko

Reputation: 17942

I think I've found a rather clean solution to my problem:

The pigpio library is what I needed. It runs a daemon started with sudo, which is controlling the GPIO pins. A client program (started without sudo) communicates with the deamon and thus indirectly controls the pins.

You can even run the client on a remote machine. This way a ROS node can control the GPIO pins of a remote raspberry, which itself isn't even running ROS.

My current setup is a rospy node (indigo) on a fitlet PC talking to a Raspberry Pi 2, both running Ubuntu 14.04.

djsw's answer in the ROS forum pointed me in the right direction.

Upvotes: 1

Related Questions