Is it possible to provide GPS coordinates from ROS to PX4 for autonomous flight?

Hello everyone, hope you are all having a great time.
I recently read about PX4 and found out it has an autonomous flight which uses GPS coordinates for it.
I also found out that there is an offboard flight mode that allows us to use ROS to send navigation information through MavROS(Mavlink) to PX4.
Now me being a complete newbie, thought, if I get a series of GPS coordinates in ROS, would it be possible to just have autonomous flight if I simply send them to PX4 through mavlink?

Thanks a lot in advance