getCameraImage does not record UserDebugItems

Post Reply
Posts: 1
Joined: Mon Jan 02, 2023 2:55 pm

getCameraImage does not record UserDebugItems

Post by TPultke »

Hi there!

I am currently using pyBullet as a way to visualize my robotics application. One use case is exporting animations for my thesis, therefor I would like to take either images per timestep and convert them to a video with specified framerate or export a video directly.

I now tried two ways to achieve this:

1. get an image with getCameraImage per visualizer step (would result in e.g. 1500 imgs) and convert it to mp4 with imageio_ffmpeg. However problems occure with debug items like UserDebugLines (used to visualize distance to obstacles or show target frames). They're simply not shown when I acquire images like this per timestep - my assumption is, that this function actually is used to generate artificial camera images for e.g. simulating vision-based control? So Debug Items should normally not be visible? Is there a way to visualize them nevertheless?

2. use startStateLogging and log my visualization as mp4. This works in terms of capturing regular objects and debug items, but the framerate is not synchronized with the physics thread -> Therefor the actual animation length depends on the framerate and amount of frames at which the video is captured.

What would be my best bet to capture regular objects as well as debug items at a fixed framerate and amount of captured frames? Are there any hidden options I just didnt yet find?

Thanks in advance!
Post Reply