Skip to content

Conversation

@noahredon
Copy link
Contributor

The condition now verify the right message received from m.get_srcSystem() instead of that of self.sysid

The condition now verify the right message received from m.get_srcSystem() instead of that of self.sysid
@peterbarker
Copy link
Contributor

This does feel right to me.

How have you tested this?

My chief concern is that this is a base-class implementation (mavfile.recv_match). Your patches here make recv_match specific to handling mavlink messages, and I don't see anything else in there currently which makes it specific to mavlink messages.

We use the same infrastructure for parsing messages of types other than MAVLink. DFReader is a good example of that, it creates DFMessage objects. In a slightly different world DFReader would only override recv_msg, not recv_match, in which case this patch would kill DFReader (DFMessage objects don't have get_srcSystem.

I can't find an in-tree example of this actually happening, but I think it's a reasonable concern.

At the very least we need a comment / apology to whoever this trips up where we are doing mavlink-message-specific things, and a plea to fix it. More reasonable would be to check the message to see if it has a get_srcSystem() attribute before attempting to use it as a method.

@noahredon
Copy link
Contributor Author

Sorry for my inactivity, I fixed this problem.

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