Ardupilot 3.5 Failed to take off using dronekit

Hi,

I am using raspberry pi and pixhawk to run a basic take off script with dronekit. When I try to take off using ground controller, the drone take off successfully; while when switching to the script, the drone tried to take off but flipped over on the ground. Anyone please help me to figure out the reason?

Here is the RC output of motors in log file.

Thank you