I am trying to build an extension that allows me to write thruster commands to a BlueBoat so that I can create a link to a different backseat payload which will handle the autonomous navigation of the vehicle. At the moment I am able to read MAVLink messages using the MAVLink2rest API but I seem to be stalling out when it comes to writing messages to the vehicle. In an ideal world I am directly writing PWM values to the boat such that I am able to write my own thruster mapping tables but when I try and go down this rout using the extension example provided (blueos extension example 5) I seem to run into permission issues writing to pins 1 and 3. Does anyone have any thoughts on the best way to directly control the thrusters through the raspberry pi?
Thanks for the tip. I am trying to follow some of the guides for both the navigator web assistant as well as the navigator library but it would still seem that I am unable to command the servos. Even when I issue the pwm_enable command if I get the state afterwards it is still false.
Im realizing that this code shows that I am trying to control PWM16. I have a test servo that I was using on that pin but I also tried the PWM channels for the thrusters.
This works for directly controlling the Thrusters. Just wanted to note however, if you use this method you are no longer able to read values coming from an rc receiver using the RC_CHANNELS message.
Alternatively you could use the DO_SET_SERVO approach described here. Note that both this and the RC_CHANNELS_OVERRIDE approach bypass the autopilot for motion control, which also means they bypass its failsafe mechanisms.