Ability to Set Vehicle Configurations on Launch#797
Conversation
|
@patrickelectric @rafaellehmkuhl I know this PR needs some work, but I wanted to get ya'lls thoughts before I continued on. |
| } | ||
| const config = await configResponse.json() | ||
| console.log(config) | ||
|
|
There was a problem hiding this comment.
I probably need to add a check for if the uri is empty here
There was a problem hiding this comment.
Yes.
And another question: wouldn't it make sense for this to be entirely on the vehicle store, or maybe on another file? I feel like we are bloating the App.vue file with things that are very specific.
There was a problem hiding this comment.
I wanted all of this to be in the main vehicle store, but I was having a hard time getting all the functionality working there initially. Now that I wave a working prototype. I can try again an put it in the main vehicle store. Are you on board with the way you can set environment variables in the docker container and pass them to the application via the config.json?
There was a problem hiding this comment.
Yes. I think it's totally fine, as long as we don't enforce it. Cockpit should work as a BlueOS extension as well as a standalone frontend, or an Electron application (although this is not being maintained right now, so it's not totally needed).
| const widgetStore = useWidgetManagerStore() | ||
| const vehicleStore = useMainVehicleStore() | ||
|
|
||
| onMounted(async () => { |
There was a problem hiding this comment.
this function also probably need to do the same with the RTC connection and maybe the base URL
There was a problem hiding this comment.
Yes.
And another thing: maybe it makes sense for all this config to be inside the main vehicle store?
|
@rafaellehmkuhl I noticed that PR #669 could be an alternative to this. What I really need is a way to set the Mavlink2Rest URL on cockpit applications I spawn. Setting the Mavlink2REST URL in the Cockpit URL might be a less intrusive way to accomplish the same thing. I know this PR has been out for a while so I was wondering if you all think this is still a good way to accomplish the setting of the URL parameter. let me know what you think |
I agree! I've been discussing with @Williangalvani, and we plan to merge that PR soon, as he's also needing this for the BlueSim project. |
Good to hear! Let me know if you need any help testing. I'll close this PR for now. |
close #526
This change attempts to read the connections from a file named
config.json. If the there is data in the config file cockpit updates its connections. If there is no data cockpit continues to use the default connections.The
config.jsonwhen running as a container is autogenerated from environment variables.This change allows me to auto deploy and configure cockpit in my online simulator
https://drive.google.com/file/d/1F942MelSPVq7T-_E5wbdtJYKI1cX72Mo/view?usp=sharing