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

JSON output represents NaN as literal NaN which is a non-standard extension and causes compatibility issues with PlotJuggler et al #61

Closed
pavel-kirienko opened this issue Aug 15, 2022 · 1 comment · Fixed by #78
Labels

Comments

@pavel-kirienko
Copy link
Member

pavel-kirienko commented Aug 15, 2022

Related facontidavide/PlotJuggler#640

Here we should set ignore_nan=True I suppose to ensure that NaN is represented as null:

return lambda data: cast(str, json.dumps(data, ensure_ascii=False, separators=(",", ":"))) + _NEWLINE

@pavel-kirienko
Copy link
Member Author

As a temporary workaround, pipe Yakut output through jq --compact-output --unbuffered, which correctly converts NaN to null. Example:

y sub 100:reg.udral.service.actuator.common.feedback 110:reg.udral.physics.dynamics.rotation.PlanarTs 120:reg.udral.physics.electricity.PowerTs 150:zubax.telega.DQ --sync \
| jq --compact-output --unbuffered \
| nc -u localhost 9870

pavel-kirienko added a commit that referenced this issue Feb 24, 2023
pavel-kirienko added a commit that referenced this issue Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant