I'm trying to set fence for the copter using dronekit-python.I found command MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION
in this document .
But it doesn't work when I use the vehicle.message_factory.command_long_send
(which is the function command_long_send
in class MAVLink from the file ardupilotmega.py actually ), I cannot find mavutil.mavlink.MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION
either (so I use integer 5003 directly).
After reading the source code of ardupilotmega.py, I found that there is a function called fence_point_send
, so can anyone tell me how to use it? How can I set the geofence just like what Misson Planner do with python?
You should use this command MAV_CMD_DO_FENCE_ENABLE to enable or disable geo-fence. geo-fence has two parameters.
To change the parameters in code, you should use a function like PARAM_SET and pass the name and value for the parameter.
PS: You can do all that using GCS like Mission Planner, APM Planner2 or Mavproxy.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.