ArduCopter SITL take off controlled by MAVLink commands

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;
}

Are you using the latest FW version? You should.

Sorry,I didn’t, I used FW as opposed to pixhawk2.4.8, because afterwards I wanted to use the MAVLink protocol to control the Ardupilot system with pixhawk2.4.8.Any other solutions?

Sorry, but the latest ArduCopter FW does not oppose to pixhawk 2.4.8. On the contrary, both work incredibly well together.

And yes, you can use both MAV_CMD_NAV_TAKEOFF in COMMAND_LONG and COMMAND_INT form with that particular Firmware version.