I want to be able to control directly the speed of each individual motor from the companion computer of the drone.
Could it be done by creating a new mavlink message?
Platform
Can you describe the application?
@JonathanPlasse, it's possible using the motor test feature although only for a few seconds..
On Mon, 22 Jul 2019, Randy Mackay wrote:
@JonathanPlasse, it's possible using the motor test feature although only
for a few seconds..
I think notionally you could use pass-through using RC channel options.
Note that this is typically a terrible, terrible idea as the latencies
(and jitter!) will give you terrible control.
The suggestion to use rc passthrough (i.e. set SERVOx_FUNCTION = RCIN1) is OK although this would mean the transmitter couldn't be used because it would be overwritten by the RC_OVERRIDE input from the companion computer. Also the regular AP flight code couldn't control the vehicle because it would be looking for SERVOx_FUNCTION = motor1,2,3,etc).
I think strategically the best way would be to create a new message (if we can't find one) and then add a new sub-mode to Guided mode so that if we are receiving these messages (and we're in guided) we accept these messages and pass them straight through.
Can you describe the application?
@magicrub, It is to test low level control algorithms as MPC on the companion board.
Well then just map an input to an output instead of to a motor. ServoX_function=RCinYpassthrough.
And to control with the companion computer, can I use RC_CHANNELS_OVERRIDE?
@JonathanPlasse yes
Thanks a lot
Most helpful comment
The suggestion to use rc passthrough (i.e. set SERVOx_FUNCTION = RCIN1) is OK although this would mean the transmitter couldn't be used because it would be overwritten by the RC_OVERRIDE input from the companion computer. Also the regular AP flight code couldn't control the vehicle because it would be looking for SERVOx_FUNCTION = motor1,2,3,etc).
I think strategically the best way would be to create a new message (if we can't find one) and then add a new sub-mode to Guided mode so that if we are receiving these messages (and we're in guided) we accept these messages and pass them straight through.