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

Plugin Architecture For 3D Display #184

Closed
micahcc opened this issue Aug 5, 2019 · 2 comments
Closed

Plugin Architecture For 3D Display #184

micahcc opened this issue Aug 5, 2019 · 2 comments

Comments

@micahcc
Copy link

micahcc commented Aug 5, 2019

It would be nice to have the ability to display any message in the 3D visualizer without producing markers ahead of time similar to Plotting doesn't require a special format.

Is there any work going on to do this? It is obviously more difficult to write a generic message to message conversion system than simply finding a field to plot. Maybe allowing users to dump a javascript function or class along the lines of:

{
   topic: 'xxx',
   convert: function(msg: ThingMsg) {
        ...
        return markers;
   }
}

Any thoughts? Thanks for doing great work btw.

@vidaaudrey
Copy link
Contributor

Hey @MicahChambers, Webviz currently already have such structure called Node. You can define a Webviz Node like this:

      const NodeB = {
        datatypes: {}, 
        inputs: ["/webviz/a/counter"],
        output: { name: "/webviz/b", datatype: "b" },
        callback({ message }) {
          return {
            messages: [makeNodeMessage("/webviz/b", "b", { count: message.message.count })],
            state: undefined,
          };
        },
      };

and register it in loadWebviz, e.g

nodes: () => {
    const NodeB = require("SOME_PATH").default;
    return [NodeB];
}

All panels will have access to the node messages. We are also actively working on a feature called Node Playground which will allow people to create Webviz nodes dynamically. Stay tuned!

@micahcc
Copy link
Author

micahcc commented Aug 5, 2019

Thanks Audey! Thats perfect!

@micahcc micahcc closed this as completed Aug 5, 2019
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