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

Transform record is polluted with unused fields when loading Example.bag #24

Closed
gkjohnson opened this issue Nov 13, 2018 · 1 comment
Closed

Comments

@gkjohnson
Copy link
Contributor

When loading the example bag in the fixtures folder with the following code:

   const bag = await open('.../example.bag')
    bag.readMessages({ topics: '/tf' }, msg => {
        console.log(JSON.stringify(msg.message, (key, val) => val === undefined ? null : val, 2));
    });

Record is printed out in the following form:

{
  "transforms": [
    {
      "x": null,
      "y": null,
      "z": null,
      "w": null,
      "header": {
        "x": null,
        "y": null,
        "z": null,
        "w": null,
        "seq": 0,
        "stamp": {
          "sec": 1396293888,
          "nsec": 56065082
        },
        "frame_id": "world"
      },
      "child_frame_id": "turtle2",
      "transform": {
        "x": null,
        "y": null,
        "z": null,
        "w": null,
        "translation": {
          "x": 4,
          "y": 9.088889122009277,
          "z": 0,
          "w": null
        },
        "rotation": {
          "x": 0,
          "y": 0,
          "z": 0,
          "w": 1
        }
      }
    }
  ]
}

The same thing happens in the browser, as well:

image

You can see that a lot of the objects in the record definition seem to be inheriting from the Quaternion class unnecessarily, even the translation field.

@gkjohnson gkjohnson changed the title Transform record is polluted unused fields when loading Example.bag Transform record is polluted with unused fields when loading Example.bag Nov 13, 2018
@jtbandes
Copy link
Contributor

Good find, thank you! I think I broke this in #20. Fix incoming. You should also feel free to investigate issues you find — we're happy to accept PRs!

jtbandes added a commit that referenced this issue Nov 13, 2018
Fix a small logic error when searching for message classes by name. Fixes #24.
Stuk pushed a commit that referenced this issue Apr 5, 2023
Fix a small logic error when searching for message classes by name. Fixes #24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants