I new to PX4 and to mavlink, and need some confirmation on my thought process and some answers to some of my questions.
I am able to send and receive data through UART/USB Serial interface, and use the c library from mavlink to decode and encode messages. I know that every time I receive a hearbeat packet from the pixhawk, I should send out a heartbeat from our flight controller. My question with this process: Is there any certain fields to send out with the heartbeat packet from my flight controller? Is there a dynamic way of obtaining a system ID or do I statically define a system ID (from either from my flight controller to the pixhawk)?
I also just want to get an output like a tune or a spinning motor to show that I have something working. Should I arm the drone first then send what ever commands because when I just send the tune command nothing happens.
Also is this a good code to arm/disarm the drone:
longCommand.command = MAV_CMD_COMPONENT_ARM_DISARM;
command.params.param1 = 1.0f; // arm
Last but not least how should I get the drone to fly after it’s armed? What is the general process (with packet names)?