Program Mission/Control On Board

Hi everyone.

I have successfully flown a fixed wing plane in manual and also using a GCS (QGroundControl). However, I would like to now completely control my flight using the Pixhawk, with onboard modules.

I have the following questions:

Is there a uORB topic that can be used for detecting/changing the flight mode (based on a transmitter switch?)

I have also attempted to use the vehicle_command topic to write MAVlink messages directly, using the syntax as given pixhawk.org/dev/set_flight_mode , but instead of changing flight mode I’ve used commands such as “VEHICLE_CMD_NAV_WAYPOINT”.

I’m a bit confused about using the vehicle_command topic because it requires a target/source, but my board is the target and the source!

In other words, is there way to just program waypoints using topics, rather than through a GCS?

Thanks