def on_step_single_frame()

in bisk/tasks/goalwall.py [0:0]


    def on_step_single_frame(self):
        contact = self.p.data.contact
        ball_wall = (np.in1d(contact.geom1, self.wall_geom)
                     & np.in1d(contact.geom2, self.ball_geom))
        touching = contact.dist <= 0
        if np.any(ball_wall & touching):
            if self.is_2d:
                self.ball_yz = [0, self.p.named.data.qpos['ball-z'][0]]
            else:
                self.ball_yz = self.p.named.data.qpos['ball'][1:3].copy()

        if not self.ball_touched:
            for c in contact:
                names = self.p.named.model.name_geomadr.axes.row.names
                if names[c.geom1].startswith('ball') and names[
                        c.geom2].startswith('robot') and c.dist < 0:
                    self.ball_touched = True