christsa / dgrasp

Official code release for CVPR 2022 paper D-Grasp: Physically Plausible Dynamic Grasp Synthesis for Hand-Object Interactions
Other
78 stars 13 forks source link

Unable to run raisimGymTorch/python setup.py develop #14

Open Arioch-77 opened 9 months ago

Arioch-77 commented 9 months ago

I am trying to run dgrasp on a Win11 machine, RaiSim 1.17, under Anaconda env. No problem in installing and running RaiSim's GymTorch example but when I try to execute

python setup.py develop

I'm unable to correctly build because of several

raisimGymTorch\env\envs\dgrasp_test\Environment.hpp(657,1): error C3861: 'RotmatToEuler': identifier not found

Which [lib / include / version of] am I missing? Thanks!

christsa commented 9 months ago

Hi,

I added this function here: https://github.com/christsa/dgrasp/blob/main/raisim/linux/include/raisim/math.hpp#L1027-L1041

Can you try to change the respective windows file accordingly by adding it here: https://github.com/christsa/dgrasp/blob/main/raisim/win32/include/raisim/math.hpp

Arioch-77 commented 9 months ago

RotmatToEuler, eulerToQuat added to math.cpp windows version, and quatInvQuatMul parameters updated

christsa commented 9 months ago

And it's working now?

Arioch-77 commented 9 months ago

Yes, I managed to compile both raisim and DGrasp. Result is not yet 100% complete, as you may guess by the attached screenshot.

EDIT: I just realized that in the rsc folder all textures are missing. I manually added those in the official raisim distr.

The simulation is freezed, btw... could it be because of the impossibility to load textures?

Screenshot 2023-12-20 131719

christsa commented 9 months ago

The texture should not have any direct effect on being able to run the simulation as far as I know. The texture maps should already be included in the rsc folder (e.g. https://github.com/christsa/dgrasp/blob/main/rsc/meshes_simplified/002_master_chef_can/texture_map.png)

What do you mean exactly by the simulation is frozen? Can you give a bit more context what exactly you are running?

Arioch-77 commented 9 months ago

Sure:

My installation procedure:

  1. I created an Anaconda Env using python 3.9 (otherwise some complaining happen during compile time)
  2. I downloaded your D-Grasp rep
  3. Build dir created
  4. Raisim compiled using CMAKE, no errors returned, examples working
  5. raisimGymTorch compiled and installed (no errors returned)
  6. all *dll of raisim (in \raisim\win32\bin) copied to raisimGymTorch\env\bin
  7. conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
  8. conda install packaging
  9. conda install joblib
  10. from anaconda navigator I installed ruamel.yaml 0.17.21 and ruamel.yaml_clib (if installed otherwise, I am unable to execute runner_motion.py due to issues related to the dump command syntax)
  11. Example tried using this command python raisimGymTorch/env/envs/dgrasp/runner_motion.py -o 12 -e '021_bleach_dexycb' -sd 'pretrained_policies' -w 'full_3000.pt' after launching raisimUnity\win32\RaisimUnity.exe and checked auto-connect.

this is the output of Anaconda Prompt:

Configuration file: "cfg.yaml"
Experiment name: "021_bleach_dexycb"
num envs 18

Reloading checkpoint: C:\RaisimProject\dgrasp2\raisimGymTorch\raisimGymTorch\env\envs\dgrasp/../../../../../raisimGymTorch/pretrained_policies/021_bleach_dexycb/full_3000.pt

[2023:12:22:14:26:39 RaisimServer.hpp:226] Connection to 840 is established

The RaisimUnity shows what I posted in my previous comment, nothing happens for a while, then Anaconda Prompt stops responding and I have to kill it.

EDIT: Time value in RaisimUnity remains 0

christsa commented 9 months ago

Hmm, this is very strange behavior.

Can you open an issue in the official RaiSim repo (https://github.com/raisimTech/raisimLib)?

I unfortunately don't have experience with running RaiSim on Windows and currently don't have capacity to investigate it due to a deadline.

manuelbirlo commented 4 months ago

In case this issue here still persists: I just installed dgrasp on a Windows 11 computer. The installation process turned out to be not as straight forward as I thought. I had a similar experience: running the RaiSim examples seemed to easer than running the dgrasp simulations. However, I now seem to be able to run it: dgrasp

christsa commented 4 months ago

Thanks for looking into this @manuelbirlo! Could you elaborate what the main steps were to set it up correctly (that are different from the official raisim guide for Windows)? I will add it to the installation guidelines.

manuelbirlo commented 4 months ago

I have to recap what I did and will post it here soon. Just a quick question for now: Is the expected behavior of your examples that the user sees a Unity-based grasp scene that is static, or should the user see an animation in Unity, as shown below?

dgrasp_2

I can rotate the Unity scene via mouse interaction, display jount state etc., but there is no animation as shown in your README. So I assume something is still not working correctly? Or is it just a matter of choosing the right command line arguments?

manuelbirlo commented 4 months ago

Quick update: I think I know now why the simulation gets stuck when I run it under Windows 11:

After calling python raisimGymTorch/env/envs/dgrasp/runner_motion.py -o 12 -e '021_bleach_dexycb' -sd 'pretrained_policies' -w 'full_3000.pt' the script does not return from the execution of the call to the wrapper function step(...): reward_ll, dones = env.step(action_ll.astype('float32'))
click here to see the code

Are you aware of any problems this function may cause?