10000 Pose.from_transformation_matrix cause segmentation fault · Issue #220 · haosulab/SAPIEN · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pose.from_transformation_matrix cause segmentation fault #220

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

Open
1270645409 opened this issue Mar 28, 2025 · 3 comments
Open

Pose.from_transformation_matrix cause segmentation fault #220

1270645409 opened this issue Mar 28, 2025 · 3 comments

Comments

@1270645409
Copy link

System:

  • OS version:Ubuntu 22.04
  • Python version Python 3.8
  • SAPIEN version 0.8:
  • Environment: Desktop

Describe the bug
A segmentation fault occurs when using sapien.Pose.from_transformation_matrix() with certain transformation matrices, while no explicit error message is shown. The issue disappears when using quaternion representation instead.
Below are the codes to reproduce.

To Reproduce

import numpy as np
import sapien.core as sapien
from env import Env
from camera import Camera
from scipy.spatial.transform import Rotation as Rot
from robots.panda_robot import Robot
env = Env(show_gui=True)
cam = Camera(env, image_size=720, random_position=False, fixed_position=True, dist=4)
robot_urdf_fn = './robots/panda_gripper.urdf'
robot_material = env.get_material(4, 4, 0.01)
robot = Robot(env, robot_urdf_fn, robot_material, open_gripper=True)
rotmat = np.array([ 
    [0,0,1,0],
    [0,-1,0,0.],
    [1,0,0,0],
    [0,0,0,1]
])
start_pose = sapien.Pose.from_transformation_matrix(rotmat)
# uncomment the following lines fix the bug
# quat = Rot.from_matrix(rotmat[:3,:3]).as_quat()[[1,2,3,0]]
# start_pose = sapien.Pose(p=np.array([0, 0, 0]),q=np.array(quat))
robot.robot.set_root_pose(start_pose)
while True:
    env.render()
    env.step() # once the simulation is started, segmentation fault occurs
@fbxiang
Copy link
Collaborator
fbxiang commented Mar 28, 2025

Support for SAPIEN version 0.8 has long been halted. There have been 3 major version releases at this point. Please use SAPIEN 3 and see if the problem still exists.

@1270645409
Copy link
Author

Thank you very much for your patient reply! Actually, my intention is not to resolve this bug; rather, it is to provide a reference for those who might encounter similar issues and need assistance. There are some excellent open-source projects that are using older versions of Sapien(0.8), such as Where2Act, which could benefit from the insights discussed in this issue.

@fbxiang
Copy link
Collaborator
fbxiang commented Mar 28, 2025

We have actually provided support to where2act back then. However it is a research project and the code is no longer maintained, and we cannot continue to support such projects. If anyone is happy to maintain an abandoned repo, we can provide support for issues encountered in upgrading.

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

2 participants
0