erwincoumans/motion_imitation

error of whole_body_control_example

YandongJi opened this issue · 5 comments

Hi, I got the error "FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/input/event24/device/name'" while running whole_body_controller_example, is the joypad necessary for this program?
Also when I ran mpc_example.py, it crashed and returned the error
"in ComputeJacobian
return super(Laikago, self).ComputeJacobian(leg_id)[(2, 0, 1), :]
IndexError: index 2 is out of bounds for axis 0 with size 0
"
Any help? Thx

You don't need a gamepad, just comment out the line in whole_body_controller_example.py
from motion_imitation.robots.gamepad import gamepad_reader
Will check the mpc_example.py, it probably isn't updated. Try running

python3 mpc_controller/locomotion_controller_example.py

locomotion_controller_example.py is running.
As for whole body control, after I commented out that line the robot didn't show up. Followings are all the output:
pybullet build time: Oct 8 2020 00:11:27 I1123 22:18:59.446287 139633378199360 openloop_gait_generator.py:189] lost contact detected.

Check the command-line args by looking at locomotion_controller_example.py , gui is disabled by default

have you fixed mpc_example.py? It crashed and had the following error:
in ComputeJacobian return super(Laikago, self).ComputeJacobian(leg_id)[(2, 0, 1), :] IndexError: index 2 is out of bounds for axis 0 with size 0

Following is the error:
Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/yandol/motion_imitation/motion_imitation/examples/mpc_example.py", line 153, in <module> app.run(main) File "/home/yandol/.local/lib/python3.8/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/home/yandol/.local/lib/python3.8/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "/home/yandol/motion_imitation/motion_imitation/examples/mpc_example.py", line 149, in main _run_example() File "/home/yandol/motion_imitation/motion_imitation/examples/mpc_example.py", line 141, in _run_example hybrid_action, info = controller.get_action() File "/home/yandol/motion_imitation/mpc_controller/locomotion_controller.py", line 88, in get_action stance_action, qp_sol = self._stance_leg_controller.get_action() File "/home/yandol/motion_imitation/mpc_controller/torque_stance_leg_controller.py", line 179, in get_action motor_torques = self._robot.MapContactForceToJointTorques(leg_id, force) File "/home/yandol/motion_imitation/motion_imitation/robots/minitaur.py", line 695, in MapContactForceToJointTorques jv = self.ComputeJacobian(leg_id) File "/home/yandol/motion_imitation/motion_imitation/robots/laikago.py", line 249, in ComputeJacobian return super(Laikago, self).ComputeJacobian(leg_id)[(2, 0, 1), :] IndexError: index 2 is out of bounds for axis 0 with size 0
Thx