Hi all,
I am trying to implement a control allocation (CA) algorithm. I wonder if it’s possible to 1) read the given thrust and torque input and 2) distribute them to each motor using my CA algorithm and then 3) execute it using offboard control. For example,
thrust_and_torque = read()
motor_cmds = my_CA(thrust_and_torque)
offboard_control.publish(motor_cmds)
I think the above idea can make it easy to implement a user-defined algorithm in a modular sense, increasing its extensibility.
Please feel free to give me comments regarding this idea, and let me know if you know how to do this. Thank you!
@JinraeKim You can look at the control_allocator module that does exactly that 
1 Like
@Jaeyoung-Lim , yes, we can modify the control_allocator
module to do so. However, I wonder if it’s possible to do the same via offboard control interface.
The reason why I’m looking for this is the ease of implementation. I only know that we can inject direct actuator commands via offboard control, while I don’t know how to subscribe the intermediate command (thrust/torque) to allocate.
If there is no such an interface, yes, I can modify the control_allocator
module manually.
@JinraeKim I didn’t mean that you should modify the control_allocator, but rather use it as an example. The control_allocator module uses the control_allocation
library that implements the allocation itself. So you can have a quick look if parts of it would be useful for you.
The main concern for me for doing offboard control with actuator setpoints is that the hardware needs to be carefully engineered that the communication latency and jitter is sufficient for control. If you are using mavlink for the offboard interface, this is normally not possible, or results in quite bad flight performance.