Closed athackst closed 5 years ago
Some thoughts on this:
{
"globalOptions": {
"background": "#111111",
"colladaLoader": "collada2",
"colladaServer": "http://localhost:8001/",
"fixedFrame": "/base_link",
"url": "ws://localhost:9090",
"videoServer": "http://localhost:9999"
},
"sidebarOpened": true,
"displays": [
{
"isShown": true,
"name": "Grid",
"options": {
"cellSize": "1",
"color": "#cccccc",
"numCells": "10"
},
"type": "grid"
},
{
"isShown": true,
"name": "Image",
"options": {
"topic": "/camera/image"
},
"type": "image"
}
]
}
rvizweb
to change a configuration.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.
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?
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.
I would like to be able to start up ros rviz with a given configuration file