GrauleM / somo

a framework to facilitate the simulation of continuum manipulators in pybullet
65 stars 21 forks source link

URDF file 'urdfs/smallSquareBox.urdf' not found #14

Open MingshanHe opened 2 years ago

MingshanHe commented 2 years ago

Expected Behavior

I have run the python file 'finger_blocked_force_demo.py' and I want to run this code which is performed in your article.

Actual Behavior

`b3Printf: URDF file 'urdfs/smallSquareBox.urdf' not found

Traceback (most recent call last): File "/home/brl/somo/examples/basic/blocked_force/finger_blocked_force_demo.py", line 166, in run() File "/home/brl/somo/examples/basic/blocked_force/finger_blocked_force_demo.py", line 56, in run boxId, boxConstraintId = load_constrained_urdf( File "/home/brl/somo/somo/utils.py", line 124, in load_constrained_urdf bodyUniqueId = p.loadURDF( pybullet.error: Cannot load URDF file. `

Steps to Reproduce the Problem

  1. python finger_blocked_force_demo.py in correct workspace location

Specifications

SantiDiazC commented 1 year ago

Hi @MingshanHe , I wanted to try that example as well and the way to solve that Issue is to copy: ~/somo/examples/basic/cm_assembly_playground/sim_speed_test/smallSquareBox.urdf to your blocked_force folder.

However, doing that I found some other issue: the box is placed bellow the finger not above as in the image provided in the paper (as it should be the blocking force experiment), I think just changing the urdf file start position of the box may solve it. image

Also, there is some bug in the code, in line 108 of finger_blocked_force_demo.py:

finger.apply_actuationTorque(actuator_nr=0,` axis_nr=0, actuation_torques=torque_fns[0](sim_time))
finger.apply_actuationTorque(actuator_nr=0, axis_nr=1, actuation_torques=0)

You should replace it with this:

finger.apply_actuation_torques(actuator_nrs=[0], axis_nrs=[0], actuation_torques=[torque_fns[0](sim_time)])
finger.apply_actuation_torques(actuator_nrs=[0], axis_nrs=[1], actuation_torques=[np.float(0.0)])

Since the SMContinuumManipulator module has apply_actuation_torques and not apply_actuationTorque, and the arguments are lists not scalars.

If you find another way to solve box position rather than changing the position on the urdf please let me know. So far I haven't examine the results of this demo so I don't know if it has other issues, I just made it run.

Thanks in advance!