Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Error when running bringup.launch #15

Closed
zmk5 opened this issue Aug 5, 2022 · 3 comments
Closed

Permission Error when running bringup.launch #15

zmk5 opened this issue Aug 5, 2022 · 3 comments

Comments

@zmk5
Copy link

zmk5 commented Aug 5, 2022

Hi, I've followed the directions for installing minipupper_ros on my Mini Pupper but I always seem to get this error when attempting to run the bringup.launch command:

[ERROR] [1659729481.595176]: bad callback: <function callback at 0xffff9384fa60>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/ubuntu/Robotics/pupper_ws/src/minipupper_ros/servo_interface/scripts/servo_interface.py", line 70, in callback
    set_servo_angle(15,a1)
  File "/home/ubuntu/Robotics/pupper_ws/src/minipupper_ros/servo_interface/scripts/servo_interface.py", line 16, in set_servo_angle
    f = open(servo_pin, "w")
PermissionError: [Errno 13] Permission denied: '/sys/class/pwm/pwmchip0/pwm15/duty_cycle'

Is there something I messed up during the installation instructions?

OS: Ubuntu Mate 20.04
Fireware: QuadrupedRobot
ROS Version: Noetic

Way I installed my the firmware on a clean system is located here

@zmk5
Copy link
Author

zmk5 commented Aug 6, 2022

Hey MangDang, I've figured out how to give the default user permissions for the PWM device on Ubuntu without the need for root access. This is a modification of the solution here.

Create a /etc/udev/rules.d/99-com.rules

Create the file using `sudo

sudo nano /etc/udev/rules.d/99-com.rules

And fill with the following:

SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
	  	    chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
	  	    chown -R root:gpio /sys/class/pwm/pwmchip0/pwm* && chmod -R 770 /sys/class/pwm/pwmchip0/pwm*;\
	  	    chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"

Save, reload rules, and then reboot:

~$ sudo udevadm control --reload-rules
~$ sudo udevadm trigger
~$ sudo reboot

This will enable the Pupper to use PWM without needing root access since we are now giving the group gpio access to PWM.

@sskorol
Copy link

sskorol commented Aug 11, 2022

@zmk5 thanks, very helpful. Just a note: if you use it in Docker, it's enough to set a privileged flag to get required permissions.

@mangdangroboticsclub
Copy link
Owner

Sorry for the late feedback, we updated the readme, please confirm it again, thanks!
It should be related to the below step.
1.2.1 Hardware Dependencies and ROS
You should first install dependencies of servos, battery moniter and display screen.
See minipupper-bsp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants