UAT 207 Communication and Data Network Systems

Worksheet 3 Capturing and analysing MAVLink

Lab 6 hAssesses CLO2

Objective

Read MAVLink messages with a script, compute packet loss from sequence numbers and detect bad frames in a byte stream

Equipment and materials

  • ArduPilot SITL and MAVProxy
  • Python with pymavlink
  • Wireshark
  • Telemetry radio on a serial port (if available)

Safety

  • Simulation and bench work only; no flying

Steps

  1. Start SITL and MAVProxy; record endpoints, ports and system IDs
  2. Write a pymavlink script that reads ATTITUDE and logs sequence and time to CSV
  3. Use Example 1 to compute packet loss per sender
  4. Capture loopback packets with Wireshark; compare the rate with the script
  5. If a radio is available, record raw serial bytes and count bad frames with Example 2

Record of results

Table 1 Connections in the experiment
ComponentEndpoint or IP addressPortSystem ID / component ID
Table 2 Packet loss per sender against Wireshark
Sender (sysid/compid)ReceivedLostLoss rate (%)Wireshark packet rate (per s)Script read rate (per s)
Box 3 Good and bad frame counts from the byte stream, with explanation

Questions

  1. What packet loss did you compute in SITL? If it is unusually high, check whether you merged several senders or forgot the wrap after 255.

  2. Did the Wireshark packet rate differ from the rate the script read? If packets arrive often but the position value never changes, what does that tell you?

  3. When a frame fails its CRC, what does the receiver do next, and why is that better than passing the frame's values to the application?

  4. The companion computer at 192.168.10.70 cannot get heartbeats to the GCS at 192.168.10.10/26 although the radio works. What do you check before blaming the radio?

Check before you hand in

What to hand in

  • Connection diagram
  • Script and CSV file
  • Packet-loss table against Wireshark
  • Bad-frame count with explanation

CLO2 Analyse telemetry and the MAVLink protocol. (CLOs are a web-team draft; the course owner sets the final ones.)

Instructors: answers and teaching notes for this worksheet are in the teaching pack