How to start a simulation with the control allocator

Hello! I am trying to work with the new Control Allocator module for a multirotor project of mine. I am having trouble starting a gazebo simulation that uses the control allocator with the Iris model, and am hoping I am missing something simple. I found that the command make px4_sitl gazebo_iris_ctrlalloc attempts to start an iris_ctrlalloc model, which does not exist in the Tools/sitl_gazebo/models/ folder. As a simple test, I tried duplicating the iris model and updating names so I have an iris model named iris_ctrlalloc. When I did that, the gazebo simulator started up, but the rc.ctrlalloc had an error that it could not find the control_allocator. Given that, I am assuming I need to set a flag somewhere to enable the control_allocator capabilities (and possibly models), but I am unable to find something that enables those capabilities. Can someone help me please? Thank you!

1 Like

I think you need to use make px4_sitl_ctrlalloc in order to include the control_allocator module.

dan@ubuntu:~/projects/aidev$ make list_config_targets | grep ctrlalloc

Thank you! I was looking in the wrong place for the command. Looks like that works!