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

python: Update mavros.mavlink module for 2.0 support. #569

Closed
vooon opened this issue Jun 28, 2016 · 5 comments
Closed

python: Update mavros.mavlink module for 2.0 support. #569

vooon opened this issue Jun 28, 2016 · 5 comments
Labels
Milestone

Comments

@vooon
Copy link
Member

vooon commented Jun 28, 2016

I forgot to update module according to message changes.

@vooon
Copy link
Member Author

vooon commented Jul 3, 2016

Module updated for 2.0, but without signing in convert_to_rosmsg() since i do not found how extract signature block.

@vooon vooon closed this as completed Jul 3, 2016
@danielkalmanson
Copy link
Contributor

Hi,
The issue with the signature extraction on mavlink2.0 to ros mavlink makes my code crash every time with the following error message:

File "/opt/ros/humble/local/lib/python3.10/dist-packages/mavros/mavlink.py", line 117, in convert_to_rosmsg return Mavlink(
File "/opt/ros/humble/local/lib/python3.10/dist-packages/mavros_msgs/msg/_mavlink.py", line 174, in init self.signature = array.array('B', kwargs.get('signature', []))
TypeError: 'NoneType' object is not iterable
The following exception was never retrieved: 'NoneType' object is not iterable

I believe the problem is that the signature argument given to the message is always None, while the message builder in _mavlink.py expects an array.
Even without the full fix of extracting Mavlink signatures properly, I think a simple [] instead of None given to the message, could be a quick patch to make the code run smoothly.

Would very much appreciate this fix!

@vooon

@vooon
Copy link
Member Author

vooon commented Apr 16, 2024

Try to add or [] after get. So it will always return empty list instead of none to array pack.

self.signature = array.array('B', kwargs.get('signature', []) or [])

@danielkalmanson
Copy link
Contributor

Yes, that's what I did in my code, but I think it would be a great idea to push it to the master branch, so people would have this fix built-in when downloading or updating the package.
I wouldn't want to fix this issue every time I update the package from the source.

@vooon
Copy link
Member Author

vooon commented Apr 17, 2024

You're welcome to PR.

danielkalmanson added a commit to danielkalmanson/mavros that referenced this issue May 15, 2024
Fixed bug mavlink#569 from mavros. Fixed another bug in the building of the ros mavlink message- the seq field was not added to the ros mavlink message.
danielkalmanson added a commit to danielkalmanson/mavros that referenced this issue May 15, 2024
vooon pushed a commit that referenced this issue May 16, 2024
Fixed bug #569 from mavros. Fixed another bug in the building of the ros mavlink message- the seq field was not added to the ros mavlink message.
vooon pushed a commit that referenced this issue May 16, 2024
Kept #569 FIXME tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants