Changing ROS Camera Prim Parameters

Is there a way to change ROS Camera prim parameters after creation while the simulator is running in Python? Eg start the camera with some resolution, then change it while simulating.

I tried doing ChangeProperty, but it does not seem to have done anything.

Alternatively, could one delete the prim and create a new one with different parameters? What command would do this?

If you change the resolution property on the ROS Camera prim you need to call stop and play again to properly resize the image. Would that solve your use case?

I don’t think it worked, though I might be doing something wrong:

start_time = time.time()
test = False
while self.kit.app.is_running():
    self.kit.update()
    if time.time() - start_time > 20 and not test:
        omni.kit.commands.execute(
            "ChangeProperty",
            prop_path=self.Sdf.Path("/ROS_Camera.resolution"),
            value=self.Gf.Vec2i(128, 72),
            prev=None)
        self.kit.stop()
        self.kit.play()
        test = True

Is the code I’m using to change resolution after having created the camera with:

omni.kit.commands.execute(
        "ROSBridgeCreateCamera",
        path="/ROS_Camera",
        enabled=True,
        resolution=Gf.Vec2i(1280, 720),
        frame_id="sim_camera",
        camera_info_topic="/camera_info",
        rgb_enabled=True,
        rgb_topic="/rgb",
        depth_enabled=False,
        depth_topic="/depth",
        segmentation_enabled=False,
        semantic_topic="/semantic",
        instance_topic="/instance",
        label_topic="/label",
        bbox2d_enabled=False,
        bbox2d_topic="/bbox_2d",
        bbox3d_enabled=False,
        bbox3d_topic="/bbox_3d",
        queue_size=10,
        camera_prim_rel=["/sim_camera"],
    )

I am getting the following error:


Apologies for the delay, I’m attaching a modified version of the carter_stereo.py sample here.
I think you are just missing a call to update between stop and play so the renderer has a frame to reset.
carter_stereo_random_res.py (2.9 KB)