Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Somrthong wrong with points computation:RuntimeWarning: divide by zero encountered in divide world_coordinates = world_coordinates_homogeneous[:, :3] / world_coordinates_homogeneous[:, 3, np.newaxis] #15

Open
Sui0206 opened this issue Oct 16, 2024 · 0 comments

Comments

@Sui0206
Copy link

Sui0206 commented Oct 16, 2024

Hi!Thanks for your strong work! And when I tried to reproduce this task in the simulation environment, I encountered the following problems.
/ReKep/og_utils.py:126: RuntimeWarning: divide by zero encountered in divide
world_coordinates = world_coordinates_homogeneous[:, :3] / world_coordinates_homogeneous[:, 3, np.newaxis]

And I found that it seems caused by the code in the og_utils.py:

camera_coordinates_homogeneous = np.hstack((camera_coordinates, np.ones((camera_coordinates.shape[0], 1))))

# additional conversion to og convention
T_mod = np.array([[1., 0., 0., 0., ],
          [0., -1., 0., 0.,],
          [0., 0., -1., 0.,],
          [0., 0., 0., 1.,]])
camera_coordinates_homogeneous = camera_coordinates_homogeneous @ T_mod

After these code, the camera coordinates have some zeros of their w component.
So how to fix this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant