Hi,
in previous versions we used to record videos by doing something like this:
cam = rep.create.camera(
position=position,
look_at=look_at,
clipping_range=(0.45, 1.21),
)
res = self._task._cfg["video_capture_params"]["video_resolution"]
resolution = (res, res)
_render_product_path = rep.create.render_product(cam, resolution=resolution)
In 2023.1.1 this code throws an error because it is attempted to call .split() on cam which is not defined.
So far the only workaround we found is to pass the path to an existing camera (and modify its pose).
rep.create.render_product("/OmniverseKit_Persp", resolution)
Is that behavior expected? There are still many examples in the omni.isaac package that pass camera objects directly.
You seem to be having the same issue I had although it was lidar related
I was advised to change
_, render_product_path = create_hydra_texture([1, 1], sensor.GetPath().pathString)
to
render_product_path = rep.create.render_product(sensor.GetPath(), [1, 1], name=“Isaac”)
I would try to mod your code similarly to what I have done here.
Thank you for the suggestion, but the camera object does not implement such a function (as far as I can tell)
'ReplicatorItem' object has no attribute 'GetPath'.
ahaidu
January 24, 2024, 5:11pm
5
Hi there, does this script work for you:
import omni.replicator.core as rep
cam = rep.create.camera(position=(0, 0, 5), look_at=(0, 0, 0), name="MyCamera")
rp = rep.create.render_product(cam, (512, 512), name="MyRenderProduct")
Hi,
it works this far, but then I would usually do
rgb = rep.AnnotatorRegistry.get_annotator("rgb")
rgb.attach([rp])
and the second line here throws the error:
File "/home/pitz_ja/isaachand/isaachand/envs/vec_env_rlgames.py", line 151, in spawn_camera
2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]: rgb.attach([_render_product_path])
rgb.attach([_render_product_path])2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/extscache/omni.replicator.core-1.10.20+105.1.lx64.r.cp310/omni/replicator/core/scripts/annotators.py", line 561, in attach
File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/extscache/omni.replicator.core-1.10.20+105.1.lx64.r.cp310/omni/replicator/core/scripts/annotators.py", line 561, in attach
2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,869ms] [Error] [omni.kit.app._impl] [py stderr]: sdg_iface.activate_node_template(
sdg_iface.activate_node_template(2024-01-25 09:42:27 [220,870ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,870ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/kit/exts/omni.syntheticdata/omni/syntheticdata/scripts/SyntheticData.py", line 1435, in activate_node_template
File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/kit/exts/omni.syntheticdata/omni/syntheticdata/scripts/SyntheticData.py", line 1435, in activate_node_template
2024-01-25 09:42:27 [220,870ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,871ms] [Error] [omni.kit.app._impl] [py stderr]: node_path = SyntheticData._get_node_path(
node_path = SyntheticData._get_node_path(2024-01-25 09:42:27 [220,871ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,871ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/kit/exts/omni.syntheticdata/omni/syntheticdata/scripts/SyntheticData.py", line 920, in _get_node_path
File "/home/pitz_ja/.local/share/ov/pkg/isaac_sim-2023.1.1/kit/exts/omni.syntheticdata/omni/syntheticdata/scripts/SyntheticData.py", line 920, in _get_node_path
2024-01-25 09:42:27 [220,871ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,871ms] [Error] [omni.kit.app._impl] [py stderr]: renderProductName = renderProductPath.split("/")[-1]
renderProductName = renderProductPath.split("/")[-1]2024-01-25 09:42:27 [220,872ms] [Error] [omni.kit.app._impl] [py stderr]:
2024-01-25 09:42:27 [220,872ms] [Error] [omni.kit.app._impl] [py stderr]: AttributeError
AttributeError2024-01-25 09:42:27 [220,872ms] [Error] [omni.kit.app._impl] [py stderr]: :
: 2024-01-25 09:42:27 [220,872ms] [Error] [omni.kit.app._impl] [py stderr]: '_asyncio.Task' object has no attribute 'split'
'_asyncio.Task' object has no attribute 'split'2024-01-25 09:42:27 [220,872ms] [Error] [omni.kit.app._impl] [py stderr]:
ahaidu
January 25, 2024, 10:17am
7
The lines of code work for me:
import omni.replicator.core as rep
cam = rep.create.camera(position=(0, 0, 5), look_at=(0, 0, 0), name="MyCamera")
rp = rep.create.render_product(cam, (512, 512), name="MyRenderProduct")
rgb = rep.AnnotatorRegistry.get_annotator("rgb")
rgb.attach([rp])
print(f"rgb annot name: {rgb.get_name()}")
Is it possible to provide a small repro script with the issue?