Control thruser by python

Hi @Richard1,

ArduSub uses a vehicle frame to determine which thrusters to activate when given a particular command - it can’t detect which or how many thrusters are connected. The rc_channels command operates on RC Inputs, so set_rc_channel_pwm(1, 1700) will specify a command of 1700 to the ‘pitch’ input. None of the default frames have any pitch component for thruster 1, so it’s not expected to activate with an input on channel 1.

If you want to control each thruster individually (at the cost of losing the ability to use ArduSub’s existing stabilisation modes and control algorithms) you could compile ArduSub with a custom frame configuration that’s set up with motion factors that make the first 6 input channels correspond to specific thrusters.

If you need fine-grained control of each thruster it likely makes more sense to implement that within ArduSub though (possibly as a custom flight mode), rather than as an external controller, because external control has more latency and less frequent sensor updates (e.g. IMU, compass, etc).


As a side note, I’ve pasted your text file contents into a code block, so people don’t need to download your file to view it. There are instructions for how make code blocks in the Formatting a Post/Comment section of the How to Use the Blue Robotics Forums post :slight_smile: