Open SshiJwu opened 7 months ago
I believe the issue is that set_qf with passive force needs to be called every step to compensate gravity. In SPAIEN 3 (currently dev releases), we provide a better way to achieve this by disabling gravity of the robot completely.
How do I fix it?
You can try set_qf
every step.
self.robot.set_drive_target(action)
print("action:",action)
qf = self.robot.compute_passive_force(gravity=True, coriolis_and_centrifugal=True)
self.robot.set_qf(qf)
for i in range(self.frame_skip):
# add these lines
qf = self.robot.compute_passive_force(gravity=True, coriolis_and_centrifugal=True)
self.robot.set_qf(qf)
self.scene.step()
self.render()
self.current_step += 1
print("joint_position", self.robot.get_qpos())
print("\n")
obs = self.get_observation()
return obs
Thanks for your reply! I have one more question: How can I get a GT point cloud of objects in the scene?
All geometries in SAPIEN are mesh so there is no GT point cloud. I guess you could mean 2 things.
Point cloud from GT depth map of cameras. This has been discussed in SAPIEN's documentation rendering section.
Sampled point cloud from collision or visual meshes. For this I would suggest converting SAPIEN meshes to trimesh and use trimesh sampling functions. Assuming you are using SAPIEN 2, the example code for this conversion can be found here https://github.com/haosulab/ManiSkill2/blob/main/mani_skill2%2Futils%2Ftrimesh_utils.py
How do I fix it?
Traceback (most recent call last): File "examples/gen_demonstration_expert.py", line 236, in
main() File "examples/gen_demonstration_expert.py", line 75, in main env = create_env(task_name=task_name, File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/create_env.py", line 37, in create_env env = LaptopRLEnv(env_params, friction=5) File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/rl_env/laptop_env.py", line 20, in init super().init(use_gui, frame_skip, friction=friction, index=index, renderer_kwargs) File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/sim_env/laptop_env.py", line 15, in init super().init(use_gui=use_gui, frame_skip=frame_skip, renderer_kwargs) File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/rl_env/base.py", line 32, in init super().init(use_gui=use_gui, frame_skip=frame_skip, use_visual_obs=use_visual_obs, renderer_kwargs) File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/sim_env/base.py", line 25, in init engine, renderer = get_engine_and_renderer(use_gui=use_gui, need_offscreen_render=need_offscreen_render, File "/home/user/Downloads/diffusion_rl/third_party/dexart-release/dexart/env/sim_env/constructor.py", line 36, in get_engine_and_renderer _renderer = sapien.SapienRenderer(default_mipmap_levels=mipmap_levels, offscreen_only=not use_gui, RuntimeError: Cannot find any cuda device suitable for rendering.
I run nvidia-smi
,nvcc -V
and vulkaninfo
,then return no error. I think this is a error about SAPIEN.
Can you start a new issue and post the result of vulkaninfo
and nvidia-smi
?
Hi, I want to execute position control in SAPIEN. But it's not quite what I thought. This is my code: def step(self, action: np.ndarray):
The returned results are:
How do I make the robot reach the target position?