diff --git a/examples/pybullet/gym/pybullet_envs/robot_bases.py b/examples/pybullet/gym/pybullet_envs/robot_bases.py index 1e14cd6db..989d22a54 100644 --- a/examples/pybullet/gym/pybullet_envs/robot_bases.py +++ b/examples/pybullet/gym/pybullet_envs/robot_bases.py @@ -103,7 +103,7 @@ class MJCFBasedRobot(XmlBasedRobot): Base class for mujoco .xml based agents. """ - def __init__(self, model_xml, robot_name, action_dim, obs_dim, self_collision=False): + def __init__(self, model_xml, robot_name, action_dim, obs_dim, self_collision=True): XmlBasedRobot.__init__(self, robot_name, action_dim, obs_dim, self_collision) self.model_xml = model_xml self.doneLoading=0 @@ -114,12 +114,9 @@ class MJCFBasedRobot(XmlBasedRobot): self.ordered_joints = [] self.doneLoading=1 if self.self_collision: - print("self_collision enabled loadMJCF") - #self.objects = p.loadMJCF(os.path.join(pybullet_data.getDataPath(),"mjcf", self.model_xml), flags=p.URDF_USE_SELF_COLLISION+p.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS) - self.objects = p.loadMJCF(os.path.join(pybullet_data.getDataPath(),"mjcf", self.model_xml)) + self.objects = p.loadMJCF(os.path.join(pybullet_data.getDataPath(),"mjcf", self.model_xml), flags=p.URDF_USE_SELF_COLLISION|p.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS) self.parts, self.jdict, self.ordered_joints, self.robot_body = self.addToScene(self.objects ) else: - print("no self_collision enabled loadMJCF") self.objects = p.loadMJCF(os.path.join(pybullet_data.getDataPath(),"mjcf", self.model_xml)) self.parts, self.jdict, self.ordered_joints, self.robot_body = self.addToScene(self.objects) self.robot_specific_reset() diff --git a/examples/pybullet/gym/pybullet_envs/scene_stadium.py b/examples/pybullet/gym/pybullet_envs/scene_stadium.py index f05a48943..c68e628a6 100644 --- a/examples/pybullet/gym/pybullet_envs/scene_stadium.py +++ b/examples/pybullet/gym/pybullet_envs/scene_stadium.py @@ -28,7 +28,7 @@ class StadiumScene(Scene): self.stadium = p.loadSDF(filename) planeName = os.path.join(pybullet_data.getDataPath(),"mjcf/ground_plane.xml") - self.ground_plane_mjcf = p.loadMJCF(planeName) + self.ground_plane_mjcf = p.loadMJCF(planeName, flags=p.URDF_USE_SELF_COLLISION|p.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS) for i in self.ground_plane_mjcf: p.changeVisualShape(i,-1,rgbaColor=[0,0,0,0])