llanesc / lqr-tracking

A state dependent LQR controller for high accuracy trajectory tracking.
MIT License
20 stars 6 forks source link

Problem towards the inner loop PID control of PX4 #2

Closed AllenHuangDongyue closed 3 years ago

AllenHuangDongyue commented 3 years ago

Hi, I was wondering if you just post the attitude message through the AttitudeTarget in mavros, the PID control of the inner loop in PX4 still working. How can you ensure that LQR works in this scenerio?

Best, Allen

llanesc commented 3 years ago

The attitude message is commanding body rates and collective thrust. PX4 handles the inner controller for that. If you have a question related to the theory then I recommend looking over the paper in the references.

AllenHuangDongyue commented 3 years ago

The attitude message is commanding body rates and collective thrust. PX4 handles the inner controller for that. If you have a question related to the theory then I recommend looking over the paper in the references.

That is great! Thank you! But I still think that the controller using right now is PID+LQR since you haven't disabled the inner loop PID control.

llanesc commented 3 years ago

Yeah the inner loop controller is a PID controller to track body rates and thrust directly implemented in PX4. The LQR is kinematics based and treats the inputs as body rates so that the LQR commands body rates and collective thrust which the inner PID controller tracks. This is okay to do since the attitude dynamics are much faster than the position dynamics.

AllenHuangDongyue commented 3 years ago

Yeah the inner loop controller is a PID controller to track body rates and thrust directly implemented in PX4. The LQR is kinematics based and treats the inputs as body rates so that the LQR commands body rates and collective thrust which the inner PID controller tracks. This is okay to do since the attitude dynamics are much faster than the position dynamics.

Cool!!! Thank you!

AllenHuangDongyue commented 3 years ago

Right, have you ever try corrupted size vs. prev_size: 0x000000000107a520 *** when running the roslaunch lqr_controller lqr_euler.launch?

AllenHuangDongyue commented 3 years ago

image

llanesc commented 3 years ago

I don't think i've ever seen that error. Do you have all the dependencies? https://github.com/ethz-adrl/control-toolbox, mavros, mav_trajectory_generation, and a few others supporting those 3?

AllenHuangDongyue commented 3 years ago

I don't think i've ever seen that error. Do you have all the dependencies? https://github.com/ethz-adrl/control-toolbox, mavros, mav_trajectory_generation, and a few others supporting those 3?

I have these 3 dependencies, but it still has this problem.