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

736 add a duplicate feature for plugins #737

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rjb0026
Copy link
Contributor

@rjb0026 rjb0026 commented Jun 6, 2021

Closes #736. Added a "duplicate" feature to quickly create a deep copy of a plugin including all its configurations. Current methods for creating a duplicate:

  • Right click on the plugin to duplicate and select the "duplicate" option in the drop down
  • Select the plugin to duplicate and press the "Ctrl+d" hotkey
mapviz_duplicate_demo_0.mp4

@danthony06
Copy link
Contributor

Looks pretty useful at first glance. I need to look at the temp file code, that seems a little odd.

@rjb0026
Copy link
Contributor Author

rjb0026 commented Jun 11, 2021

There might be a more efficient way, but I was trying to use the existing plugin interface. I didn't initially see a super easy way to go from YAML::Emitter to YAML::Node directly. I did however see a way to go from YAML::Node to YAML::Emitter easily. It would be nice if the MapvizPlugin::SaveConfig interface took in a YAML::Node directly and then let the user decide how to save that since it's not actually saving to a file in any of the implementations I've looked at.

Changing the existing MapvizPlugin interface or adding another pure virtual method to the MapvizPlugin class would break all existing plugins. Avoiding that was my primary objective for doing something kinda quick and dirty. I can look around in yaml-cpp to see if there is a more efficient way to do that conversion in case I'm just missing something.

@rjb0026
Copy link
Contributor Author

rjb0026 commented Jun 12, 2021

@danthony06 I found a better way to save/load the config for the plugin to be duplicated that does not require using a temp file. I've tested locally on melodic. The CI seems to be failing because it can't find catkin tools, so It didn't even make it to the build.

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

Successfully merging this pull request may close these issues.

Add a "duplicate" feature for plugins
3 participants