osrf / rvizweb

RVizWeb: RViz on the browser
285 stars 59 forks source link

Ability to load config from launch #10

Closed athackst closed 5 years ago

athackst commented 5 years ago

I would like to be able to start up ros rviz with a given configuration file

jubeira commented 5 years ago

Some thoughts on this:

So the file has to be made available to the backend (using a ROS param for example?), and the configuration should be applied to the screen right after startup. JSON.parse should do the job to convert the file's contents to a variable.

If configuration the file was installed together with all HTML stuff it would be more straightforward than loading it during runtime. @chapulina any thoughts about this? Perhaps there's a cleaner way to do so instead of using a ROS parameter. I'll give it one more thought anyway.

chapulina commented 5 years ago

I think it would make sense that the configuration file has the same structure as the configuration

+1

A user shouldn't need to reinstall rvizweb to change a configuration.

+1

using a ROS param for example?

Yeah I think a param that holds the whole configuration as a string could work. I can't think of a better alternative, maybe a "set config" service? Either way, we could write a basic node that reads a json file and sets a param or calls a service.

If configuration the file was installed together with all HTML stuff it would be more straightforward than loading it during runtime

But then would users need to clone, edit and reinstall rvizweb to use the new file?

jubeira commented 5 years ago

But then would users need to clone, edit and reinstall rvizweb to use the new file?

Indeed, and that's not good from the user's perspective. The 'problem' with using ROS to retrieve the configuration is that you would need to get a handle to ROS when starting and try retrieving a parameter / calling a service, and my first thought was that it's not super clean to do so when initializing the configuration variables. Anyway, thanks for the comments! I think I'll go that way.