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

add high resolution magnetic field message #52

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Magnetic field readings, in Gauss, in body frame, high resolution version

tridge marked this conversation as resolved.
Show resolved Hide resolved
uint8 sensor_id
float32[3] magnetic_field_ga
25 changes: 25 additions & 0 deletions list_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
'''
list all messages sorted by DTID
'''

import sys
import logging

from dronecan import dsdl

parsed = list(dsdl.parse_namespaces(['uavcan','com','ardupilot', 'dronecan']))
if not parsed:
print("Failed to parse namespaces")
sys.exit(1)

parsed = [ p for p in parsed if p.default_dtid is not None]
parsed.sort(key=lambda x: x.default_dtid)

KIND_MAP = {
0: "Service",
1: "Broadcast",
}

for p in parsed:
print(p.default_dtid, KIND_MAP[p.kind], p.full_name)
Loading