Is it possible to use PX4 just for motion commands?

Hi,

I’d like to train a RL algorithm with Gazebo and Ros. I have been trying to train it with the SITL simulation, so, it works but when I reset the position with the “model_state” topic of gazebo, it takes some time till the firmware resets the position and velocity to the GPS data. So I have two questions which can are obvious, but I am new.

1- I would like to use gazebo as the simulator as I had to add some sensors to the drone, so, I would like to know if there is any way to use the px4 just for controlling the drone via the topics “mavros/setpoint_velocity” and “mavros/setpoint_position” and taking the position from gazebo without launching all the firmware, I mean just use the PX4 for executing the motion commands, so it is closer to a simple dynamics simulation. I need that because I’d like perform a velocity control in [vx,vy,vz,wyaw] and mixed with position control when needed. And I think later will be easier to adapt the environment for re-train in SITL.

2- If that is not possible, I just need to know how to restart the EFK via python, so when reseting the position also reset the ekf and maybe even if the firmware is in the loop, it can be trained.

Thanks you very much!