dheera / rosboard

ROS node that turns your robot into a web server to visualize ROS topics
Other
823 stars 161 forks source link

Added plugin mechanism to send any data to the server #122

Open AlexanderHefner opened 6 months ago

AlexanderHefner commented 6 months ago

With this change it's possible to write viewer which will send data into the ros system. E.g. the #100 joystick controller pull request could be rewritten to use this instead of adding a special WebSocket message type.

I've already created a plugin with a special viewer and it's working like a charm. Already creating more of them.

Btw. Everyone loves rosboard at first glance :smile:

NINGCONG2021 commented 3 months ago

Hey, bro, I want to implement something similar to the functionality in RViz for publishing navigation points. How should I do that

AlexanderHefner commented 3 months ago

Hey, bro, I want to implement something similar to the functionality in RViz for publishing navigation points. How should I do that

Hey, just use the builtin functions of Rviz:

The information on this is published on specific topics. Just google for.

Bets regards, Alex

jimrong79 commented 2 months ago

Hi Alex, love this work. Is it possible to share your example with a plugin?

Also I have to update the handlers.py #12 to the following to get it run. otherwise getting a ModuleNotFoundError from rosboard.plugins import get_plugin_js_files, received_plugin_message

Thanks

AlexanderHefner commented 2 months ago

Hi Alex, love this work. Is it possible to share your example with a plugin?

Also I have to update the handlers.py #12 to the following to get it run. otherwise getting a ModuleNotFoundError from rosboard.plugins import get_plugin_js_files, received_plugin_message

Thanks

Hi, I'm happy to hear that you like my idea! 😄 Unfortunately I cannot share a real world example, but I added an example in plugin.md. Also you could rewrite the nipple.js commit #100 to use the plugin mechanism.

Fell free to ask if you need help writing your plugin I can support if needed.

dheera commented 3 weeks ago

Thank you for this! I'm trying to catch up to things after months of dealing with other personal issues.

I wanted to implement a publisher and service call alongside the subscribe mechanism. I'm trying to figure out whether this plugin mechanism is generalizable enough to be useful outside of that. Do you have any examples of plugins you wrote?

AlexanderHefner commented 3 weeks ago

Thank you for this! I'm trying to catch up to things after months of dealing with other personal issues.

I wanted to implement a publisher and service call alongside the subscribe mechanism. I'm trying to figure out whether this plugin mechanism is generalizable enough to be useful outside of that. Do you have any examples of plugins you wrote?

Happy to hear from you. No pressure regarding this, my personal life is quite busy as well 😅

Unfortunately I'm not allowed to share a working plugin, but I used it like this:

  1. Write a custom viewer for a topic
  2. The viewer has a button to send something into the ros system
  3. This button sends a signal to the python plugin
  4. In the python plugin the data is taken and published

What I wanted to add, but never had time for, was the way back. But this can be done with subscribing a topic in rosboard and writing a custom viewer for it.

Hope this helps :)