crocoddyl: AttributeError: 'DifferentialActionDataContactFwdDynamics' object has no attribute 'contacts'

Hi, python bipedal_walk.py successfully runs. When adding the display argument for visualization, the following error occurs:

File “bipedal_walk.py”, line 72, in <module> ddp[i].solve(xs, us, 100, False, 0.1) File “/opt/openrobots/lib/python3.6/site-packages/crocoddyl/init.py”, line 158, in call self.visualization.displayFromSolver(solver) File “/opt/openrobots/lib/python3.6/site-packages/crocoddyl/init.py”, line 91, in displayFromSolver fs = self.getForceTrajectoryFromSolver(solver) File “/opt/openrobots/lib/python3.6/site-packages/crocoddyl/init.py”, line 121, in getForceTrajectoryFromSolver for key, contact in data.differential.contacts.contacts.items(): AttributeError: ‘DifferentialActionDataContactFwdDynamics’ object has no attribute ‘contacts’

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (21 by maintainers)

Most upvoted comments

Hi cmastalli. Thanks for your time! I cannot seem to get the biped_walk to work. I have gepettogui running, when running biped_walk I for a second see the talos hips, then it flickers to only its foot(?), then crashes.

  • I am using python3.7 on Ubuntu19 on amd64
  • I installed via apt install robotpkg-py37-crocoddyl, robotpkg-py37-qt4-gepetto-viewer-corba, robotpkg-osg-dae
  • strangely, robotpkg-osg-dae is installed but gepettogui only lists OmniORB Server in plugins…I expected DAE plugin here. FindPlugins button doesnt find it and in fact “dpkg -L robotpkg-osg-dae” doesnt list any .so or python file…only a bunch of doc files and a few include ones. Only a pkgconfig file is installed in the /opt/openrobots/lib dir.
  • I did a pprint(vars(data.differential)) on the line 123 error in the output and it returns an empty {} … there is no contacts.contacts.items() on the object.
  • The robotpkg-py37-crocoddyl package does not install the /examples files…so I am running the examples from a github checkout…tried both master and devel branches.
  • examples do run without display
  • The double_pendulum and quadrotor seemed to work, arm_manipulation and quadruped ones also produce an error.

The entire output of bipedal_walk is:

guru@Kuba:~/src/crocoddyl/examples$ python3 bipedal_walk.py display plot
*** SOLVE walking ***
iter 	 cost 	      stop 	    grad 	  xreg 	      ureg 	 step 	 feas
   0  1.09774e+06  2.54565e+11  8.12082e+07  1.00000e-02  1.00000e-02   1.0000     1
   1  2.15012e+05  2.35119e+13  2.18849e+06  1.00000e-03  1.00000e-03   1.0000     1
   2  4.72918e+03  6.26126e+12  4.24250e+05  1.00000e-04  1.00000e-04   1.0000     1
   3  2.87295e+03  6.44189e+10  3.72378e+03  1.00000e-05  1.00000e-05   1.0000     1
{}
Traceback (most recent call last):
  File "bipedal_walk.py", line 73, in <module>
    ddp[i].solve(xs, us, 1000, False, 0.1)
  File "/opt/openrobots/lib/python3.7/site-packages/crocoddyl/__init__.py", line 160, in __call__
    self.visualization.displayFromSolver(solver)
  File "/opt/openrobots/lib/python3.7/site-packages/crocoddyl/__init__.py", line 92, in displayFromSolver
    fs = self.getForceTrajectoryFromSolver(solver)
  File "/opt/openrobots/lib/python3.7/site-packages/crocoddyl/__init__.py", line 123, in getForceTrajectoryFromSolver
    for key, contact in data.differential.contacts.contacts.items():
AttributeError: 'DifferentialActionDataContactFwdDynamics' object has no attribute 'contacts'

This is the output from the gepetto viewer. The code in bipedal_walk.py suggests that it loads the robot example file, is this correct? Or do I need to first load the talos robot in gepetto? Not sure why the iostream error, file not found maybe?

guru@Kuba:~/src/crocoddyl$ gepetto-gui 
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
List of GroupNodes :
   crocoddyl
   gepetto-gui
   hpp-gui
BOX does not exist.: iostream error
BOX does not exist.: iostream error
CYLINDER does not exist.: iostream error
CYLINDER does not exist.: iostream error
CYLINDER does not exist.: iostream error
CYLINDER does not exist.: iostream error
BOX does not exist.: iostream error
Node "world/robot/collisions/leg_left_6_link_0" does not exist.
Node "world/robot/collisions/leg_right_6_link_0" does not exist.
Node "world/robot/collisions/wrist_left_ft_link_0" does not exist.
Node "world/robot/collisions/wrist_left_ft_tool_link_0" does not exist.
Node "world/robot/collisions/wrist_right_ft_link_0" does not exist.
Node "world/robot/collisions/wrist_right_ft_tool_link_0" does not exist.
Node "world/robot/collisions/rgbd_link_0" does not exist.
You must initialize a Geode on world/robot/visuals/base_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_1_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_2_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_3_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_4_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_5_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_left_6_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_1_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_2_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_3_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_4_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_5_link_0 to use Alpha
You must initialize a Geode on world/robot/visuals/leg_right_6_link_0 to use Alpha