ravens/agents/dummy.py
def act(self, obs, info):
        """Run inference and return best action given visual observations."""
        act = {'camera_config': self.camera_config, 'primitive': None}
        if not obs:
            return act

        # [Optional] Get heightmap from RGB-D images.
        colormap, heightmap = self.get_heightmap(obs, self.camera_config)

        # Do something here.

        # Dummy behavior: move to the middle of the workspace.
        p0_position = (self.bounds[:, 1] - self.bounds[:, 0]) / 2
        p0_position += self.bounds[:, 0]
        p1_position = p0_position
        rotation = p.getQuaternionFromEuler((0, 0, 0))

        # Select task-specific motion primitive.
        act['primitive'] = 'pick_place'
        if self.task == 'sweeping':
            act['primitive'] = 'sweep'
        elif self.task == 'pushing':
            act['primitive'] = 'push'

        params = {'pose0': (p0_position, rotation),
                  'pose1': (p1_position, rotation)}
        act['params'] = params
        return act
Run inference and return best action given visual observations.
Run inference and return best action given visual observations.
Run inference and return best action given visual observations .
def act(self, obs, info):
        act = {'camera_config': self.camera_config, 'primitive': None}
        if not obs:
            return act
        colormap, heightmap = self.get_heightmap(obs, self.camera_config)
        p0_position = (self.bounds[:, 1] - self.bounds[:, 0]) / 2
        p0_position += self.bounds[:, 0]
        p1_position = p0_position
        rotation = p.getQuaternionFromEuler((0, 0, 0))
        act['primitive'] = 'pick_place'
        if self.task == 'sweeping':
            act['primitive'] = 'sweep'
        elif self.task == 'pushing':
            act['primitive'] = 'push'
        params = {'pose0': (p0_position, rotation),
                  'pose1': (p1_position, rotation)}
        act['params'] = params
        return act
def act ( self , obs , info ) : act = { 'camera_config' : self . camera_config , 'primitive' : None } if not obs : return act colormap , heightmap = self . get_heightmap ( obs , self . camera_config ) p0_position = ( self . bounds [ : , 1 ] - self . bounds [ : , 0 ] ) / 2 p0_position += self . bounds [ : , 0 ] p1_position = p0_position rotation = p . getQuaternionFromEuler ( ( 0 , 0 , 0 ) ) act [ 'primitive' ] = 'pick_place' if self . task == 'sweeping' : act [ 'primitive' ] = 'sweep' elif self . task == 'pushing' : act [ 'primitive' ] = 'push' params = { 'pose0' : ( p0_position , rotation ) , 'pose1' : ( p1_position , rotation ) } act [ 'params' ] = params return act
Run inference and return best action given visual observations.
Run inference and return best action given visual observations .
"""Run inference and return best action given visual observations.""" # [Optional] Get heightmap from RGB-D images. # Do something here. # Dummy behavior: move to the middle of the workspace. # Select task-specific motion primitive.
self
obs
info