I was able to run the servor.py or motor.py (written by modifying servo.py) under the folder Navio2/Python by “sudo python motor.py”, this works fine and my wheel can rotate and move.
The problem is that I need to incorporate these two functions to the ROS node and got an IOError because permission denied: ‘sys/class/pwm/pwmchip0/export’ when I ran “rosrun my_package_name node_name.py”
I then type “chmod 666 /syss/class/pwm” and used “rosrun my_package_name node_name.py” to run my node again, but got another OSError of rcio (see graph attached).
It seems I always got errors when trying to control pmw pins by running ros node using rosrun.
Any suggestions? (Note: I cannot use “sudo rosrun” to get the persmission as I did for the example in the very beginning…)