Helloworld pymavlink script

Hi All

I am new to arducopter, and I am trying to get my head around using MAVLink.

Is there a hello-world script somehwere which shows how can I :

- takeoff

- fly forward for a few seconds

- land

- print state information

I tried using mavutil.py to set the arducopter in auto mode, and then send a takeoff command by doing:

m = mavutil.mavlink_connection("/dev/ttyUSB1")

m.set_mode_auto()

m.mav.command_long_send(m.target_system, m.target_component, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 100, 0, 0, 0, 0, 0)

but this does not work, as in the arducopter does not respond. 

Thank you very much.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –