Set_camera_transform() failing with UP_AXIS_Z


It seems that some camera view matrices are not being computed correctly when a simulation has Z as its up-axis. Specifically, I’m getting bad view matrices from gym.set_camera_transform() and gym.attach_camera_to_body() when using gymapi.UP_AXIS_Z. It’s possible to work around it using gym.set_camera_location(), but I though you should be aware of the issue.

Here is a snippet of code to reproduce the problem:

from isaacgym import gymapi
gym = gymapi.acquire_gym()
sim_params = gymapi.SimParams()
sim_params.up_axis = gymapi.UP_AXIS_Z
sim = gym.create_sim(0, 0, gymapi.SIM_PHYSX, sim_params)
spacing = 2
lower = gymapi.Vec3(-spacing, 0.0, -spacing)
upper = gymapi.Vec3(spacing, spacing, spacing)
env_ptr = gym.create_env(sim, lower, upper, 1)
camera_props = gymapi.CameraProperties()
ch = gym.create_camera_sensor(env_ptr, camera_props)
p = gymapi.Vec3(1, 1, 0)
q = gymapi.Quat(1, 0, 0, 0)
gym.set_camera_transform(ch, env_ptr, gymapi.Transform(p, q))
print(“View matrix: {}”.format(gym.get_camera_view_matrix(sim, env_ptr, ch)))

1 Like

Hi @aidan,

We’re investigating this now and will provide updates when we have them.