import time
from pymavlink import mavutil
mavutil.set_dialect(“ardupilotmega”)
autopilot = mavutil.mavlink_connection(‘/dev/ttyACM0’)
msg = None
while msg is None:
msg = autopilot.recv_msg()
print msg
autopilot.mav.heartbeat_send(
6,
8,
192,
0,
4,
3
)
autopilot.mav.command_long_send(
1,
1,
2510,
0,0,0,0,0,0,0,0)
print autopilot.mav.command_long_send(1,1,2510,0,0,0,0,0,0,0,0)
time.sleep(2)
autopilot.mav.command_long_send(
1,
1,
2511,
0,0,0,0,0,0,0,0)
I used the above python code. The code ran but I am not able to figure out where the sensor data is being logged.
Also if this does not work , can you provide alternate code to get and read sensor data?