irom-princeton / AdaptSim

Code Release for AdaptSim: Task-Driven Simulation Adaptation for Sim-to-Real Transfer
MIT License
13 stars 1 forks source link

Can't run code #1

Open axel-kaliff opened 7 months ago

axel-kaliff commented 7 months ago

Hi, I'm trying to recreate the experiment but can't run the code after following the instructions.

After creating a conda environment from the YAML file, building the forked drake code from source using cmake for use with the python bindings, but when I try to run the code, even just the installation test code

"python3 -c 'import pydrake.all; print(pydrake.file)'"

I'm getting "ModuleNotFoundError: No module named 'pydrake.common._module_py'", and I've exported the correct directory to the python path.

Running on Ubuntu 22.04.

Would greatly appreciate any help :)

allenzren commented 7 months ago

Hi, thanks for the interest in our work!

Our setup was done on Ubuntu 20.04, and we haven't not used 22.04. Would it be possible for you to test it on 20.04 instead? The forked Drake version is for 20.04.

axel-kaliff commented 7 months ago

Thanks for the reply, I'll try on Ubuntu 20.04 :)

axel-kaliff commented 7 months ago

I changed the ubuntu version and I can import pydrake :)

Now however, I'm getting this error when running 'python test/test_double_pendulum_linearized.py'

I had to change some lines that imported util.numeric instead of adaptsim.util.numeric but I can't see how that caused this.

Traceback (most recent call last):
  File "test/test_double_pendulum_linearized.py", line 36, in <module>
    obs, reward, done, info = env.step(action=None)
  File "/home/axel/AdaptSim/adaptsim/env/double_pendulum_linearized_env.py", line 110, in step
    return self.step_continuous(K)
  File "/home/axel/AdaptSim/adaptsim/env/double_pendulum_linearized_env.py", line 121, in step_continuous
    ret = integrate.solve_ivp(
  File "/home/axel/miniconda3/envs/adaptsim/lib/python3.8/site-packages/scipy/integrate/_ivp/ivp.py", line 555, in solve_ivp
    solver = method(fun, t0, y0, tf, vectorized=vectorized, **options)
  File "/home/axel/miniconda3/envs/adaptsim/lib/python3.8/site-packages/scipy/integrate/_ivp/rk.py", line 94, in __init__
    self.f = self.fun(self.t, self.y)
  File "/home/axel/miniconda3/envs/adaptsim/lib/python3.8/site-packages/scipy/integrate/_ivp/base.py", line 138, in fun
    return self.fun_single(t, y)
  File "/home/axel/miniconda3/envs/adaptsim/lib/python3.8/site-packages/scipy/integrate/_ivp/base.py", line 20, in fun_wrapped
    return np.asarray(fun(t, y), dtype=dtype)
  File "/home/axel/AdaptSim/adaptsim/env/double_pendulum_linearized_env.py", line 117, in system
    u = -K @ x
TypeError: bad operand type for unary -: 'NoneType'
allenzren commented 7 months ago

Ah my bad. I pushed a commit https://github.com/irom-lab/AdaptSim/commit/9cf80fb4268749fddf21c39eb861498bc7b052c3. Now the optimal K matrix will be used in this test example.

axel-kaliff commented 7 months ago

Great thank you!

Testing and training for the double pendulum works, but for the push and scoop task there seems to be assets missing.

RuntimeError: /home/axel/AdaptSim/asset/franka_description/urdf/panda_arm.urdf:16: error: URI 'package://drake/manipulation/models/franka_description/meshes/visual/link0.obj' resolved to '/home/axel/drake-build/install/share/drake/manipulation/models/franka_description/meshes/visual/link0.obj' which does not exist.

can't find the "meshes" directory in the drake fork.

allenzren commented 7 months ago

These meshes should show up in your drake-build folder; they are not in the Drake fork but generated when you build it. I am surprised that they are not generated under /home/axel/drake-build/install/share/drake/manipulation/models/franka_description. Could you take a look at /home/axel/drake-build/install/share/drake/manipulation/models/?

axel-kaliff commented 7 months ago

Sure, this is the result of 'ls' in that directory:

jaco_description       
ur3e
franka_description        
realsense2_description  
wsg_50_description
iiwa_description          
tri_homecart            
ycb

There is no 'meshes' directory in the 'franka_description', only

LICENSE.TXT
README.md
urdf