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

How can I add a bridge client to a vehicle? #2072

Closed
josh-wende opened this issue Jun 2, 2022 · 2 comments
Closed

How can I add a bridge client to a vehicle? #2072

josh-wende opened this issue Jun 2, 2022 · 2 comments

Comments

@josh-wende
Copy link

josh-wende commented Jun 2, 2022

Hi,

I'm trying to work on getting the simulator to use local files, instead of relying on the WISE web UI. When I run a simulation from the Python API, though, I get the error Agent '...' is missing bridge client. How can I add a bridge client to the vehicle? What should the vehicle's JSON (the one with the sensor configuration included) look like? Is the BridgeClient a Unity component that needs to be added to the vehicle before building?

Thanks in advance for any guidance.

Update:
I added a Bridge Client component to my vehicle and rebuilt the AssetBundle. Now when I try to run my python script, I actually get the following error on sim.add_agent before even getting to ego.connect_bridge: Exception: Object reference not set to an instance of an object. I noticed in the manifest of the AssetBundle, supportedBridgeTypes and bridgeType are both set to null. Is this the problem?

@ertauren
Copy link

ertauren commented Jun 3, 2022

I would suggest looking at this issue first:
#1994

Then if it isn't suited to you somehow:
Instead adding it as component, I would suggest adding "BridgeData" to vehicle at AddAgent.cs file and let the SVL handle the instantiation / creating component part.
You will need to handle config object at :

if (config.BridgeData != null)

this is probably cause of the first add_agent command's error.
that config object initialized at :
var config = new AgentConfig(vehicleData.ToVehicleData());

so in fact BridgeData of vehicleData object should be initialized.

I didn't really test it. If it doesn't work right away, I still suggest tweaking that vehicleData object to your needs, maybe initialize it at the beginning (ConnectionUI.cs, simulationData)

@josh-wende
Copy link
Author

Thanks @ertauren! This was the correct line of inquiry. Putting the proper bridge info into the correct place in the vehicleData json got it working.

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

No branches or pull requests

2 participants