ArduCopter Post 3.4 recommended way to programmatically Takeoff within a mavproxy module

First Post: I had been working on a mavproxy module that generates a flight plan automatically and the user just needs to say go after selecting a few parameters. I had a state machine that went through POSHOLD, ARM, AUTO, RC 3 1200 commands

self.master.set_mode(posholdNUM) # all executed in separate state machine operations
self.module(‘rc’).cmd_rc([3, 1250])

in order to launch. Since 3.4 this doesn’t work. Always seemed a bit clumsy so I am up for a new way. On the command line we now have the Takeoff command but I haven’t found a good way to execute that command in code in a mavproxy module. Any suggestions?

Alright I’ll toss my own suggestion in here. If there are better ways I’m all ears. Maybe this will help someone who isn’t familiar with the commands available. I found this under in the MAVProxy module directory. There is other good stuff in there once you know about it.

mavutil.mavlink.MAV_COMP_ID_SYSTEM_CONTROL, # target_component
mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, # command
0, # confirmation
0, # param1
0, # param2
0, # param3
0, # param4
0, # param5
0, # param6
takeoffAlt) # param7