Setpoint_attitude/attitude quaternion transformation

Hi Jaeyoung,
I have several more questions.

  1. Is there a reason you use angular rates instead of desired roll pitch yaw to do this?

  2. I saw there is a function quaternion acc2quaternion(acceleration, yaw). Does that mean after I get aceleration from my own PID controller, I directly use directly use this function to get the desired quaternion angle? Then I can pub this quaternion angle to setpoin_attitude/attitude ?

  3. If question 2 is correct, what should I use for cmd_att.pose.position.x y z as shown in your post? https://404warehouse.net/2015/12/20/autopilot-offboard-control-using-mavros-package-on-ros/
    My understanding is that px4 wouldn’t use these three position values since it is the attitude control, only concentrate on the attitude values. Is it correct?

  4. From your answer this post, https://discuss.px4.io/t/trajectory-following-via-acceleration-setpoints-which-controller-to-use/7106, it seems I can directly use three desired accelerations to control the quad with setpoint_accel/accel. Is it correct? (Actually my desired attitude and thrust is calculated from desired accelerations based on the flatness equation). If yes, it would simplify my work.

Thanks for your time.