hello,
I am form china .we want to build our first AUV.
we want to use tx2+pix,
pix – ArduSub
and We communicate with USB through pix on TX2.、
I receive a heartbeat but then the code hangs at this point in the script and does not print
Why is this?
At the same time, I installed Ubuntu 16.04 on a computer, and I found that I couldn’t read the sensor values when the computer communicated with pix via Pymavlink without opening qgc. At the same time, once I open the QGC once, I can read the return value of the sensor on the serial port.
Any help much appreciated.
Thanks
Hi,
I would first recommend to take a look and read our pymavlink documentation.
As pointed in the documentation, you need to send heartbeats periodically to the pixhawk.
Also, can you share the code ?
Probably because QGC is sending the necessary heartbeats for you.
from pymavlink import mavutil
master = mavutil.mavlink_connection(
‘/dev/ttyTHS2’,
baud=57600)
master.mav.request_data_stream_send(master.target_system, master.target_component, 0, 30, 1)
while True:
a = master.recv_match()
if a:
a=a.to_dict()
if a[‘mavpackettype’] == ‘ATTITUDE’ :
print a
I have solved the problem!Thank you very much!!!
Besides i want to know: In STABILIZE mode, how to send move instructions? What are the instructions for controlling robot move in mavlink?
We use MANUAL_CONTROL.
Take a look in Send Manual Control.