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

pyulog represents char[x] as x columns of individual chars #92

Open
BWStearns opened this issue Feb 7, 2024 · 5 comments
Open

pyulog represents char[x] as x columns of individual chars #92

BWStearns opened this issue Feb 7, 2024 · 5 comments

Comments

@BWStearns
Copy link

BWStearns commented Feb 7, 2024

pyulog represents char[x] fields as x number of str fields. It seems less surprising to represent them all as one string instead of having to have a postprocess that concats them later. In the docs it's described as a char[127] which would more intuitively map to a string than 127 char values each with their own key (or in this case column).

I've shown an example here but as far as I can tell it impacts all fields that are char[x].

image

# A logging message, output with PX4_{WARN,ERR,INFO}

uint64 timestamp		# time since system start (microseconds)

uint8 severity # log level (same as in the linux kernel, starting with 0)
char[127] text

uint8 ORB_QUEUE_LENGTH = 4

https://docs.px4.io/main/en/msg_docs/LogMessage.html

@BWStearns BWStearns changed the title pyulog represents pyulog represents char[x] as x columns of individual chars Feb 7, 2024
@bkueng
Copy link
Member

bkueng commented Feb 9, 2024

We can add a helper to do the conversion. It makes sense, but I'd like to avoid breaking API changes or special handling in the parser for this.

@BWStearns
Copy link
Author

A helper would be great.

@bkueng
Copy link
Member

bkueng commented Feb 12, 2024

Can you create a PR?

@BWStearns
Copy link
Author

I can. I just need to figure out where to put the changes. Got any pointers off the top of your head for where would make sense to put it?

@bkueng
Copy link
Member

bkueng commented Feb 13, 2024

You could add it to the Data class: https://github.com/PX4/pyulog/blob/main/pyulog/core.py#L487

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

No branches or pull requests

2 participants