0

I'm using the PXfmini with the raspberrypi3 for a project and I need to use mavros and python code. My operative system is Frambuesa. I created the catkin workspace and I tested the c++ file takeoff_land_ and it works very well.

Now I need to test the python code, because I have to work with it, I’m using this example and I followed all the instructions to compile the statusleds.py :

https://github.com/erlerobot/ros_erle_statusled

But this is the error that the screen showed me:

this

How can I fix this?

I already tried this commands: Access GPIO pins without root. No access to /dev/mem. Try running as root!

thank you :)

flavia13
  • 33
  • 1
  • 3
  • 7
  • To confirm, have you tried running it as root as suggested (sudo rosrun ...)? What happens if you do that? – Aurora0001 Oct 24 '17 at 16:01
  • sudo rosrun ros_erle_statusled statusleds.py [sudo] password for erle: sudo: rosrun: command not found – flavia13 Oct 24 '17 at 16:11

1 Answers1

2

Raspbian supports the /dev/gpiomem device which allows access to the GPIO without being the root user.

If /dev/gpiomem does not exist on your system you will need to run the Python script as the root user (with all the risks that entails).

joan
  • 71,024
  • 5
  • 73
  • 106
  • But when I write: sudo python statusleds.py Traceback (most recent call last): File "statusleds.py", line 2, in import rospy ImportError: No module named rospy – flavia13 Oct 24 '17 at 16:13
  • That is a path problem. You need to install rospy in a standard location so that it is in the path of the root user. – joan Oct 24 '17 at 16:47