(2019-02-02, 08:58 AM)seandepagnier Wrote: What do the scripts do? How do they communicate to the motor?
It would make more sense to implement a driver for your controller in servo.py It would not be efficient to execute bash scripts for this purpose since the autopilot commands the motor at 10-25hz any lag would degrade performance.
I have the arduino driver used by many, but there is also a driver for direct control from raspberry gpio pins. You could implement another driver. I can't say more without more information,
thanks for your fast answer. this would be cool, but im not sure if this would have benefits for you or the community.
The controller is an arduino(or similar) with polulu motor controller, but the arduino has more sensors attached with a small control panel...it works standalone...arduino output goes to an raspi and has a program but its not very good and stable. so reorganisation is not so easy.
the scripts just opens serial and send some command
For steering: it just sends an "s" and a value...from -45 to 45
For driving: it send "m" and a value...from -255(reverse) to 255
the arduino sends back changes...eg the motor slowly accelerates...so serial gives mit back:
M0
M1
M2
M3
And of course fail reporting.
This is why i asked to script it. Or how would you do it? Perhaps direct serial commands?or did you implement pipes?