Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mavlogfile class for generic log files that have no timestamps. #24

Merged
merged 1 commit into from
Oct 13, 2016

Conversation

phollands
Copy link
Contributor

I am updating MatrixPilot to use the latest mavlink generator for C and Python files. (it's been a while).

Before the enclosed commit, If I run mavlogdump.py on a generic matrixpilot raw log file I get the following errors message with previous MatrixPilot mavlink log files:-

Peters-iMac:tools phollands$ ./mavlogdump.py --dialect matrixpilot --no-timestamps /tmp/log.raw 
ERROR LOADING MAVNATIVE - falling back to python implementation
Traceback (most recent call last):
  File "./mavlogdump.py", line 113, in <module>
    m = mlog.recv_match(blocking=args.follow)
  File "/Users/phollands/MatrixPilot/Tools/MAVLink/mavlink/pymavlink/mavutil.py", line 344, in recv_match
    m = self.recv_msg()
  File "/Users/phollands/MatrixPilot/Tools/MAVLink/mavlink/pymavlink/mavutil.py", line 323, in recv_msg
    self.post_message(msg)
  File "/Users/phollands/MatrixPilot/Tools/MAVLink/mavlink/pymavlink/mavutil.py", line 1125, in post_message
    msg._link = self._link
AttributeError: 'mavlogfile' object has no attribute '_link'

And after initialising self._link as shown in the attached commit, I have no error, and I can process MatrixPilot log files again.

I think that function post_message will initialise self._link to 0 for the planner_format, but not for MatrixPilot :-). So here I initialise the _link to be 0, and anything that happens later on, can override that value of 0.

I'm looking forward to any comments that you might have.

Best wishes, Pete

@peterbarker peterbarker merged commit c391c9d into ArduPilot:master Oct 13, 2016
@peterbarker
Copy link
Contributor

@phollands Sorry, no comments.

Merged, thanks!

@phollands phollands deleted the initialise_underscore_link branch October 14, 2016 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants