Closed loop controllers for ardupilot

I am trying to use this repo, It uses mavros_controllers for the closed-loop control to make sure the MAV is following the path planned by the FAST planner but mavros_controllers are not working well with Ardupilot Firmware, more info on this issue can be found here

I was wondering if there is native support for closed-loop control for ardupilot or does something similar to mavros_controllers exist for ardupilot?


1 Like


I see that you had an excellent support from Dr. Hall @Leonardthall , I suspect we might not have better qualified resources to help you on this issue. I suggest you get more acquainted with ArduPilot methods as they differ greatly from PX4.

And his conclusions are:
This is clearly not an ArduCopter problem, an ArduCopter tuning problem or a problem with the PR. Mavros is commanding the aircraft to crash and the aircraft is then doing what it is told to do.
The only thing that makes sense looking at this is that mavros is commanding the rates in degrees per second instead of radians.

This is completly the wrong thing to do. The problem is not there and you are just blindly trying things hoping it works. In any case mate, I am satisfied that this is not a problem with ArduCopter and that the problem is with mavros or the settings you are using there.

I am looking for an alternative to that approach


Hi, @ppoirier @rmackay9 I found this discussion on gitter. I saw a conversation about the fast planner, @ppoirier were you able to implement FAST-Planner with ardupilot?


No, just made test with simulator and as you probably know, these controllers are now implemented with convolutional network as this latest release from ETHZ:

Hi, I want to know how you implemented that in simulator?
yes I have seen that approach but i have to stick with fast planner


I mean within ROS environment and using RVIZ.
You might give a try on the vision channel, asking if anyone interested to help.

oh okay, I am trying to implement that with gazebo, I will join the discord
one more question, does ardupilot have controllers to make sure the mav follows the path given by the path planner?


@shubham-shahh, yes, Guided mode has all sorts of controls for allowing external companion computers to control the vehicle.

Hi @rmackay9 thanks for the response. My planner gives out pos, vel, acc, yaw. when I publish those commands on /mavros/setpoint_raw/local which takes in all the params mentioned above, the UAV does not follow the trajectory given by the planner. I am curious if there is some feedback controller in ardupilot which can make sure the UAV is following the trajectory given by the Fast Planner


Are you using ArduCopter 4.1.1-rc1? Please do.

1 Like

@amilcarlucas please note the extensive support given by @Leonardthall on this link

AAAHH, that one. It has more than enough homework to do from the other thread.
@shubham-shahh please follow the instructions from @Leonardthall and let us know when you fixed it.


The previous set of problems may have been update rate or latency issues. But the aircraft was doing what it was told to do.

As for this approach. I did exactly this in a vicon style chamber and it followed the path very precisly. I suspect that you are not generating the path correctly or creating the correct Mavlink commands.

Again you have not provided a log so anybody can tell you what is happening in the flight controller.

The aircraft does run the guided commands through the position controller so you get exactly what you ask for. If you are running some external position controller rather than just the path generation then the two may be intereacting.

Hello @Leonardthall ,

Trying to help on discord an I just tested your branch , it is working fine with quaternions

But roll and pitch are not responding that well using body rates but yaw is OK. What values can we pass on that mode ?

I just went looking for you on discord.

Thanks for helping @Leonardthall , it works fine now I am in the correct branch :wink:

Will update once it is fixed