Wednesday, August 22, 2018

Pymavlink Ardupilot SITL

  • ardupilot SITL

  • pamavlink

  • Terminal 1

sim_vehicle.py --console
  • Terminal 2 (python code)
from pymavlink import mavutil master = mavutil.mavlink_connection('tcp:127.0.0.1:5762') # Get some information ! while True: try: print(master.recv_match().to_dict()) except: pass

  • Terminal 3 (netstat -natp)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:5760 0.0.0.0:* LISTEN 5976/arducopter tcp 0 0 0.0.0.0:5762 0.0.0.0:* LISTEN 5976/arducopter tcp 0 0 0.0.0.0:5763 0.0.0.0:* LISTEN 5976/arducopter

python output

{'mavpackettype': 'TIMESYNC', 'ts1': 1854891080001, 'tc1': 0} {'custom_mode': 0, 'system_status': 3, 'base_mode': 81, 'autopilot': 3, 'mavpackettype': 'HEARTBEAT', 'type': 2, 'mavlink_version': 3} {'custom_mode': 0, 'system_status': 3, 'base_mode': 81, 'autopilot': 3, 'mavpackettype': 'HEARTBEAT', 'type': 2, 'mavlink_version': 3} {'custom_mode': 0, 'system_status': 3, 'base_mode': 81, 'autopilot': 3, 'mavpackettype': 'HEARTBEAT', 'type': 2, 'mavlink_version': 3}

No comments: