Skip to content

Ability to Set Vehicle Configurations on Launch#797

Closed
ericjohnson97 wants to merge 1 commit into
bluerobotics:masterfrom
ericjohnson97:feature/configure_vehicle_uri_at_runtime
Closed

Ability to Set Vehicle Configurations on Launch#797
ericjohnson97 wants to merge 1 commit into
bluerobotics:masterfrom
ericjohnson97:feature/configure_vehicle_uri_at_runtime

Conversation

@ericjohnson97

Copy link
Copy Markdown
Contributor

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.json when 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

@ericjohnson97

Copy link
Copy Markdown
Contributor Author

@patrickelectric @rafaellehmkuhl

I know this PR needs some work, but I wanted to get ya'lls thoughts before I continued on.

Comment thread src/App.vue
}
const config = await configResponse.json()
console.log(config)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably need to add a check for if the uri is empty here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread src/App.vue
const widgetStore = useWidgetManagerStore()
const vehicleStore = useMainVehicleStore()

onMounted(async () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function also probably need to do the same with the RTC connection and maybe the base URL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

And another thing: maybe it makes sense for all this config to be inside the main vehicle store?

@ericjohnson97 ericjohnson97 marked this pull request as draft March 4, 2024 16:32
@ericjohnson97

Copy link
Copy Markdown
Contributor Author

@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

@rafaellehmkuhl

Copy link
Copy Markdown
Member

@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.

@ericjohnson97

Copy link
Copy Markdown
Contributor Author

@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.

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.

Strategies for a better video stream

2 participants