robotology / gym-ignition-models

Collection of robot models compatible with gym-ignition
https://github.com/robotology/gym-ignition
GNU Lesser General Public License v3.0
24 stars 7 forks source link

Add Panda robot model #2

Closed paolo-viceconte closed 4 years ago

paolo-viceconte commented 4 years ago

The Panda.urdf model was obtained from the models provided in https://github.com/mkrizmancic/franka_gazebo/robots by executing

rosrun xacro xacro --inorder panda_arm_hand.urdf.xacro > Panda.urdf

Before the conversion, the original panda_arm_hand.urdf.xacro file was modified as follows:

The included files (panda_arm.xacro and hand.xacro) were in turn modified as follows:

The mesh files were instead taken from https://github.com/cpezzato/panda_simulation because they have the phong ambient parameter set to 1 1 1 1 which results in a Panda robot visualized in its original colors. The phong ambient parameter set to 0 0 0 1 in the mesh files provided in https://github.com/mkrizmancic/franka_gazebo/robots resulted instead in a Panda robot visualized in dark gray.

panda

diegoferigo commented 4 years ago

I want to test this locally but the PR looks good to me. Though, I would wait before merging because I'm not actually sure whether the file:// prefix is required or not. I suspect that it will work with Ignition Gazebo but it won't work with PyBullet, so I would rather remove the URI and just leave the relative path. I just checked and using the IGN_FILE_PATH everything seems to work. I let you know how to proceed.

Actually, I found a bug in sdformat that prevents using relative paths if the model is urdf. Instead, if it gets converted to an sdf, relative meshes are loaded correctly. At this point we still have to rely on IGN_FILE_PATH waiting an upstream fix.

The same comment applies to #1.

diegoferigo commented 4 years ago

Without the file:// URI, urdf models do not find mesh files even if IGN_FILE_PATH is configured. For the time being we can merge the models as they are. They are not yet compatible with PyBullet, but they will be as soon as resolving relative mesh folders will be fixed for urdfs (and the URI get removed).

diegoferigo commented 4 years ago

I copy here for future reference a comment by @paolo-viceconte from a private repo:

I discovered that both in https://github.com/mkrizmancic/franka_gazebo and in https://github.com/cpezzato/panda_simulation the visual meshes (i.e. all the *.dae files) have the transparent tag set to A_ONE, which seems to be ok only in old versions of gazebo. One possible solution is to set it to RGB_ZERO, as detailed here.

Related to https://github.com/ignitionrobotics/ign-rendering/issues/89. Tested with OGRE 1.

paolo-viceconte commented 4 years ago

I discovered that both in https://github.com/mkrizmancic/franka_gazebo and in https://github.com/cpezzato/panda_simulation the visual meshes (i.e. all the *.dae files) have the transparent tag set to A_ONE, which seems to be ok only in old versions of gazebo. One possible solution is to set it to RGB_ZERO, as detailed here.

Given the most recent updates from ignitionrobotics/ign-rendering#89, the RGB_ZERO transparent tags inserted in the Panda visual meshes need to be reverted to the original A_ONE value. Done via https://github.com/robotology/gym-ignition-models/pull/24.