Skip to content
Permalink
Browse files

Add `ground_contact_geoms` property to the Walker base class.

This property is used to determine geoms that are allowed to be in contact with the ground during "normal" locomotion.

PiperOrigin-RevId: 246114030
  • Loading branch information...
saran-t authored and alimuldal committed May 1, 2019
1 parent 419efb2 commit e5d7a9a8d5352eb958fbf9426dd4483df93dd614
@@ -251,16 +251,20 @@ def root_body(self):

@composer.cached_property
def end_effectors(self):
return [self._mjcf_root.find('body', 'head_body')]
return (self._mjcf_root.find('body', 'head_body'),)

@composer.cached_property
def observable_joints(self):
return [self._mjcf_root.find('joint', 'kick')]
return (self._mjcf_root.find('joint', 'kick'),)

@composer.cached_property
def egocentric_camera(self):
return self._mjcf_root.find('camera', 'egocentric')

@composer.cached_property
def ground_contact_geoms(self):
return (self._mjcf_root.find('geom', 'shell'),)

@property
def prev_action(self):
return self._prev_action
@@ -170,6 +170,22 @@ def aliveness(self, physics):
"""
return 0.

@abc.abstractproperty
def ground_contact_geoms(self):
"""Geoms in this walker that are expected to be in contact with the ground.
This property is used by some tasks to determine contact-based failure
termination. It should only contain geoms that are expected to be in
contact with the ground during "normal" locomotion. For example, for a
humanoid model, this property would be expected to contain only the geoms
that make up the two feet.
Note that certain specialized tasks may also allow geoms that are not listed
here to be in contact with the ground. For example, a humanoid cartwheel
task would also allow the hands to touch the ground in addition to the feet.
"""
raise NotImplementedError

def after_compile(self, physics, unused_random_state):
super(Walker, self).after_compile(physics, unused_random_state)
self._end_effector_geom_ids = set()
@@ -55,6 +55,10 @@ def end_effectors(self):
def observable_joints(self):
return []

@property
def ground_contact_geoms(self):
return []

@property
def egocentric_camera(self):
return self._egocentric_camera

0 comments on commit e5d7a9a

Please sign in to comment.
You can’t perform that action at this time.