I have made test for geofence polygon by using Mission Planner to create the fence polygon and then making fence inclusion and writing the polygon setup to Cube.
When attempting to read the polygon points with Raspberry, I noted that the command
master.mav.mission_request_list_send(master.target_system, master.target_component,mavutil.mavlink.MAV_MISSION_TYPE_FENCE) does not work correctly. The result from request is same as when requesting MAV_MISSION_TYPE_MISSION. I.e. the count of waypoints is received in the answer message (MISSION_COUNT). I checked the contents of the mission_request_list_send, and indeed the mission_type is always set = 0, and the requested mission type is ignored.
Message “master.mav.mission_request_int_send(master.target_system, master.target_component,
index, # index
mavutil.mavlink.MAV_MISSION_TYPE_FENCE)” does work if the geofence corner count is correct. I.e. that message is built correctly with the included mission type set to = mission_type_fence. This part works ok.
Is there any reason why the mission_type_fence is ignored in library built mission_request_list_send - message? Or actually forced value is mission_type_mission?
When using the Mission Planner to read fence corner items, everything works ok. I have checked the messages with Wireshark and mission_type is set correctly there.