questions regarding pymavlink and mavproxy

303 views
Skip to first unread message

Andre S

unread,
Sep 3, 2011, 3:25:40 AM9/3/11
to MAVLink
Hi all,

Currently I'm trying to set up mavproxy for HIL simulation of APM with
flightgear and qgroundcontrol on Mac OSX 10.6.8. I think I have it
almost
(hehe) working but there appear to be some issues with the
dependencies. I'm sorry if this is the wrong place for posting
questions
about pymavlink, please someone point me to a different one in this
case.

Alright, so I'm currently using the following versions:

- tridge-pymavlink-64b6ae4.tar.gz from the git repo
- pyserial-2.5
- python 3.2

I had trouble with the older python versions so I updated to the
latest
stable release. Since I'm not very familiar with python it may well be
that
something went wrong in the process. I already identified one
incompatibility
with the python version I'm using (line 1141 in mavproxy.py uses
raw_input()
which apparently was replaced by input()). After that, the error I get
is the
following:

ASmbp:APMHIL andre$ python3.2 mavproxy.py --master=/dev/tty.usbserial-
A600dLKS
Logging to mav.log
MAV> Exception in thread Thread-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/
python3.2/threading.py", line 736, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/
python3.2/threading.py", line 689, in run
self._target(*self._args, **self._kwargs)
File "mavproxy.py", line 1092, in main_loop
mav_master.wait_heartbeat()
File "/Users/andre/APMHIL/tridge-pymavlink-64b6ae4/mavutil.py", line
125, in wait_heartbeat
return self.recv_match(type='HEARTBEAT', blocking=blocking)
File "/Users/andre/APMHIL/tridge-pymavlink-64b6ae4/mavutil.py", line
103, in recv_match
m = self.recv_msg()
File "/Users/andre/APMHIL/tridge-pymavlink-64b6ae4/mavutil.py", line
94, in recv_msg
self.logfile_raw.write(s)
TypeError: must be str, not bytes

Assuming I didn't do anything wrong, what would be the latest version
of the dependencies (pyserial, python and possibly also flightgear and
APM) that let's me run the combo for HIL?

Thanks a lot for help, any hints are greatly appreciated,

Andre

tri...@samba.org

unread,
Sep 3, 2011, 5:50:32 AM9/3/11
to mav...@googlegroups.com
Hi Andre,

> - tridge-pymavlink-64b6ae4.tar.gz from the git repo
> - pyserial-2.5
> - python 3.2

I'd recommend you use a 2.x version of python. I ported the basic
pymavlink code to python 3.x last week, but not all of mavproxy.

> 94, in recv_msg
> self.logfile_raw.write(s)
> TypeError: must be str, not bytes

One of the main differences between python 2.x and 3.x is string
handling. I've just pushed a fix for a bug related to this for python
2.x, but mavproxy itself still does not work correctly with python
3.x.

I will fix up mavproxy for python 3.x soon, but in the meantime please
use python 2.x.

Cheers, Tridge

Reply all
Reply to author
Forward
0 new messages