Testing new controllers PX4 autopilot

Hello @bresch ,
I am working to implement different controllers other than PID and want to test on PX4 autopilot in SITL.

Can you please guide me where do i need to make changes in the firmware stack to test a new controller?

Hi @Ranjeet. This might be a good place to start looking:

Hi @benasena @bresch , I have gone through the current PID controller that works at 4 levels (attitude rate, attitude, velocity and position). And, I can see that mc_att_control, mc_pos_control and mc_rate_control are modules that deal with controller implemented.

Like, Suppose I just want to implement a position controller (say sliding mode controller), then many parameters (PID gains) will not be required and few parameters has to be added.
I was thinking of testing different controllers in PX4_sitl. I am aware that i need to write a module for another controller but what communications are going on among other modules and the present controller, if there is some picture, then that would be great.

You can probably take a look at this uorb graph to get an idea of message passing between the modules. Do note that some of the topic names maybe changed for the most-updated version.