Hello,I have a question about using the MAV_CMD_NAV_TAKEOFF command in the mavlink_command_long format in the MAVLink protocol to maneuver the quadcopter in the simulator to take off, before this command I have changed the GUIDED mode, and successfully executed the ARM DISARM, and after I executed the ’ TAKEOFF’ command the console shows Got COMMAND_ACK: NAV_TAKEOFF: ACCEPTED but unfortunately the drone did not leave the ground. May I ask why this happens?
This is my C code snippet using MAVLink C library:
int auto_take_off( int altitude)
{
// Prepare command for Take-off
mavlink_command_long_t com = { 0 };
com.target_system = system_id;
com.target_component = autopilot_id;
com.command = MAV_CMD_NAV_TAKEOFF;
com.param7 = altitude;
}
The takeoff_land example in mavsdk also doesn’t perfectly make the copter in sitl take off and is in C++, I want to reproduce the example in C. I’m sure that I receive in console
“Got COMMAND_ACK: COMPONENT_ARM_DISARM: ACCEPTED
AP: Arming motors
ARMED”
I quoted the ‘common.h’ library that generates C using the MAVLink tool.
Well, since my development environment doesn’t allow me to debug a program based on controlling drone flight on an on-board computer on a real copter, I had to use a simulator to debug my control program, and I wanted to control the copter flight using a MAVLink-based C program