unrealcv / unrealcv

UnrealCV: Connecting Computer Vision to Unreal Engine
https://unrealcv.org
MIT License
1.86k stars 432 forks source link

Dynamic camera position not reflecting #232

Open mcs32 opened 1 year ago

mcs32 commented 1 year ago
  1. Press play in the Unreal Engine to start the game
  2. Press the button C by executing the request client.request('vset /action/keyboard C 1'). This will change the camera location (for example it can translate the camera by 5 units along Z axis). The camera location is updated in the level blueprint.
  3. Execute the line print(client.request('vget /camera/0/pose')) to check if location change is reflecting in unrealcv. It is not reflecting.
  4. Execute the following to get the lit image
        res = client.request('vget /camera/0/lit png')
        rgb = read_png(res)

    It returns the lit image from the old camera position since the location change is not available.

Note that after executing the step 2, the camera location does change in the unreal engine's viewport but the changes don't reflect in unrealcv. Also, there is only one camera actor in this setup. I have also tried using sleep to wait for the change to reflect but it didn't help.

I understand that I can explicitly set the camera pose by using vset /camera/0/pose, that said, I was wondering if what I am observing is the expected behavior.

Thanks

alexanderias commented 1 year ago

Hello mcs32,

I actually have the exact same problem and wanted to ask if you have found a solution by chance?