MAVLink Launch and Land Commands

475 views
Skip to first unread message

Epsilonorion

unread,
Jul 11, 2013, 10:25:35 AM7/11/13
to mav...@googlegroups.com
I am trying to work with a simple launch and land command before moving further to waypoints on an APM2.5+.  I attempted the commands last night, however, the vehicle did not behave as desired.  When sending the launch command the vehicle first did not launch.  After sending a second time, the vehicle launched.  When at the desired altitude it began to drift wildly.  I tried to regain control with the RC, but none of my commands were received.  Afterwards, I attempted to send the land command since the vehicle was not under my control.  At this moment, all motors shut off and the vehicle crashed.  As soon as the vehicle crashed, the motors started back up and the vehicle began to listen to my commands.

The commands used are as follows:

Launch Function

master.mav.mission_count_send(master.target_system, master.target_component, 2)

    # Dummy Waypoint
    master.mav.mission_item_send(master.target_system, master.target_component, 
                                 0, 0, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF,
                                 0, 0, 0,
                                 0, 0, 0, 
                                 0, 0, 0)

    # Launch Waypoint
    master.mav.mission_item_send(master.target_system, master.target_component, 
                                 1,     # Waypoint Number
                                 0, mavutil.mavlink.MAV_CMD_NAV_TAKEOFF,
                                 1,     # Is Current Waypoint
                                 0,     # Should Autocontinue to next wp
                                 0,     # NAV Command: Radius for accept within range (meters)
                                 0,     # NAV Command: Hold Time (ms)
                                 0,     # LOITER Command: Orbit to circle (meters).  Positive clockwise, Negative counter-clockwise
                                 270,     # NAV/LOITER Command: Yaw Orientation [o to 360 degrees]
                                 0,     # local: x position, global: latitude
                                 0,     # local: y position, global: longitude
                                 10)    # local: z position, global: altitude   (meters)

    # Set Launch Waypoint as Current Waypoint
    set_current_waypoint()
    receive_waypoint(1)
    
    # Trigger auto mode for launch command
    master.mav.set_mode_send(master.target_system, mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, AUTO)
    rospy.sleep(0.1)
    master.mav.set_mode_send(master.target_system, mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, AUTO)

Land Function

# Land Command
    master.mav.command_long_send(master.target_system, master.target_component,
                                 mavutil.mavlink.MAV_CMD_NAV_LAND, 0, 0,
                                 0, 0, 0,
                                 0, 0, 0)

Thanks for the help.

Meier Lorenz

unread,
Jul 11, 2013, 10:54:00 AM7/11/13
to mav...@googlegroups.com
This is not a MAVLink question, but one for APM. I'm sorry to hear you crashed, but you have to ask these questions to the APM community.


-------- Ursprüngliche Nachricht --------
Von: Epsilonorion <epsilo...@gmail.com>
Datum: 11.07.2013 4:25 PM (GMT+01:00)
An: mav...@googlegroups.com
Betreff: [MAVLINK] MAVLink Launch and Land Commands
--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe MAVLink beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an mavlink+u...@googlegroups.com.
Weitere Optionen: https://groups.google.com/groups/opt_out


Message has been deleted

Epsilonorion

unread,
Jul 11, 2013, 11:18:06 AM7/11/13
to mav...@googlegroups.com, Meier Lorenz
No problem.  I have just seen other questions that were APM related as well so I thought someone here may have a better idea.  I also was wondering if I was sending the correct MAVLink command, regardless of APM.
Reply all
Reply to author
Forward
0 new messages