Access Camera in CameraSensor

Hi,
How can I assign a camera at runtime to the slot in camera sensor? I got an error saying that I cannot get a component using get component in unity if it not derives from monobehaviour. I used get component with the interface Isensor but I don’t know how to assign a camera at runtime from here. Any help would be great…
thanks

You should be able to set the Camera property on the CameraSensorComponent (which is a MonoBehavior), which will update the Camera on the sensor.

Here’s the relevant parts in the code:

1 Like

Using one camera in a CameraSensorComponent I successfully get an observation in a Jupyter notebook.
What I want however is to have two cameras so that I can research in 3D vision.
When I have two cameras in two separate CameraSensorComponents, however, and call “env.reset()”, it is stuck with showing the asterisk that the cell is running.
Does anybody know what may be wrong?