APM quadcopter 3D simulation/ AI traning

Hello, I have a project on AI/object avoidance and i am trying to find a direction here. I plan to run a 3D drone simulation using SITL and gazebo to train my drone. I would like to ask:

  1. Do i need to program the dynamics of the drone if i am using gazebo with ROS?
  2. If ROS have the dynamics of quadcopter, then i just need give instruction to the drone?
  3. in the end can i transfer the program to my drone after the drone is done training? or is it just for simulation?
  4. do i need anything else other than gazebo/ROS, SITL to train my drone?

Thanks guys. Drone using APM2.6 as flight controller. plan to use Raspi to control the flight controller.

Hello, I think you can look at thiscodebase, and the blog posts 1 and 2. I think what ayushgaud is doing is very similar to what you want to do.