Cannot set scale of a visual cuboid

Hello.

I am struggling with something I think should be very basic. I would like to make a visual cuboid with side lengths of 0.4, 1 and 0.3. But it ends up as a cube with all sides equal to 0.05

What am I doing wrong with this simple task? Here is my code. I am using Isaac Sim 2022.1

import json
import numpy as np
import sys

from omni.isaac.kit import SimulationApp


app_config = {
    "width": 780,
    "height": 440,
    "window_width": 1320,
    "window_height": 760,
    "headless": True,
    "renderer": "RayTracedLighting",
    "display_options": 3220,
}
simulation_app = SimulationApp(app_config)

simulation_app.set_setting("/app/window/drawMouse", True)
simulation_app.set_setting("/app/livestream/proto", "ws")
simulation_app.set_setting("/app/livestream/websocket/framerate_limit", 30)
simulation_app.set_setting("/ngx/enabled", False)

from omni.isaac.core.prims.xform_prim import XFormPrim
from omni.isaac.core.objects import DynamicCuboid, VisualCuboid
from omni.isaac.core.utils.extensions import enable_extension
import omni.kit
from omni.isaac.core import World


enable_extension("omni.services.streamclient.websocket")

world = World()
ground_plane = world.scene.add_default_ground_plane()
XFormPrim(ground_plane.prim_path + "/SphereLight").set_visibility(False)

world.scene.add(VisualCuboid(
    prim_path="/World/spawn_region",
    position=[0.7, 0, 0.45],
    scale=np.array([0.4, 1.0, 0.3]),
    color=np.array([1, 0, 1]),
))

world.reset()
prim = XFormPrim("/World/spawn_region")
print("Spawn region", prim.get_local_pose(), prim.get_local_scale(), prim.get_world_scale())

while simulation_app._app.is_running() and not simulation_app.is_exiting():
    simulation_app.update()
simulation_app.close()

Hi - Sorry for the delay in the response. Let us know if you still having this issue/question with the latest Isaac Sim 2022.2.1 release.

Currently, with Isaac Sim 2022.1.1, I found out that one needs to pass size=1 to the VisualCuboid constructor (together with the scale). The default value is 0.05 which shrinks the cuboid.

Thanks for confirming. in 2022.2.1, it would change to

from omni.isaac.core import World
from omni.isaac.core.objects import cuboid, sphere, capsule
from omni.isaac.core.prims import XFormPrim, GeometryPrimView

import numpy as np 

world = World()
ground_plane = world.scene.add_default_ground_plane()
XFormPrim(ground_plane.prim_path + "/SphereLight").set_visibility(False)

world.scene.add(cuboid.VisualCuboid(
    prim_path="/World/spawn_region",
    position=[0.7, 0, 0.45],
    scale=np.array([0.4, 1.0, 0.3]),
    color=np.array([1, 0, 1]),
))

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.