ravens/tasks/task.py
def params_no_rots(self, vertex_pos, target_pos, overshoot):
        """Helper to handle common pick-place code for the oracle policy.

        We often have this patten: vertex positions and target positions in
        2D, and then potentially slightly overshoot the target. For example,
        with cloth it's helpful to do this since otherwise the physics will
        favor the cloth 'resetting' to its original state. Get the direction
        by creating vectors and then add to the new target. Then form tuples
        for the action params. Assumes no new rotations.

        Args:
            vertex_pos: 2D tuple or array representing picking position.
            target_pos: 2D tuple or array representing target position.
            overshoot: how much to go beyond the target position.

        Returns:
            Dict for the action with 'pose0' and 'pose1' keys.
        """
        p0 = (vertex_pos[0], vertex_pos[1], 0.001)
        p1 = (target_pos[0], target_pos[1], 0.001)
        direction = np.float32(p0) - np.float32(p1)
        length = np.linalg.norm(direction)
        direction = direction / length
        new_p0 = np.float32(p1) + direction * (length - 0.00)
        new_p1 = np.float32(p0) - direction * (length + overshoot)
        p0, p1 = tuple(new_p0), tuple(new_p1)
        params = {'pose0': (p0, (0,0,0,1)), 'pose1': (p1, (0,0,0,1))}
        return params
Helper to handle common pick-place code for the oracle policy.

        We often have this patten: vertex positions and target positions in
        2D, and then potentially slightly overshoot the target. For example,
        with cloth it's helpful to do this since otherwise the physics will
        favor the cloth 'resetting' to its original state. Get the direction
        by creating vectors and then add to the new target. Then form tuples
        for the action params. Assumes no new rotations.

        Args:
            vertex_pos: 2D tuple or array representing picking position.
            target_pos: 2D tuple or array representing target position.
            overshoot: how much to go beyond the target position.

        Returns:
            Dict for the action with 'pose0' and 'pose1' keys.
        
Helper to handle common pick-place code for the oracle policy.
We often have this patten: vertex positions and target positions in
2D, and then potentially slightly overshoot the target. For example,
with cloth it's helpful to do this since otherwise the physics will
favor the cloth 'resetting' to its original state. Get the direction
by creating vectors and then add to the new target. Then form tuples
for the action params. Assumes no new rotations.
Helper to handle common pick - place code for the oracle policy . We often have this patten : vertex positions and target positions in 2D and then potentially slightly overshoot the target . For example with cloth it ' s helpful to do this since otherwise the physics will favor the cloth ' resetting ' to its original state . Get the direction by creating vectors and then add to the new target . Then form tuples for the action params . Assumes no new rotations .
def params_no_rots(self, vertex_pos, target_pos, overshoot):
        p0 = (vertex_pos[0], vertex_pos[1], 0.001)
        p1 = (target_pos[0], target_pos[1], 0.001)
        direction = np.float32(p0) - np.float32(p1)
        length = np.linalg.norm(direction)
        direction = direction / length
        new_p0 = np.float32(p1) + direction * (length - 0.00)
        new_p1 = np.float32(p0) - direction * (length + overshoot)
        p0, p1 = tuple(new_p0), tuple(new_p1)
        params = {'pose0': (p0, (0,0,0,1)), 'pose1': (p1, (0,0,0,1))}
        return params
def params_no_rots ( self , vertex_pos , target_pos , overshoot ) : p0 = ( vertex_pos [ 0 ] , vertex_pos [ 1 ] , 0.001 ) p1 = ( target_pos [ 0 ] , target_pos [ 1 ] , 0.001 ) direction = np . float32 ( p0 ) - np . float32 ( p1 ) length = np . linalg . norm ( direction ) direction = direction / length new_p0 = np . float32 ( p1 ) + direction * ( length - 0.00 ) new_p1 = np . float32 ( p0 ) - direction * ( length + overshoot ) p0 , p1 = tuple ( new_p0 ) , tuple ( new_p1 ) params = { 'pose0' : ( p0 , ( 0 , 0 , 0 , 1 ) ) , 'pose1' : ( p1 , ( 0 , 0 , 0 , 1 ) ) } return params
Helper to handle common pick-place code for the oracle policy.
Helper to handle common pick - place code for the oracle policy .
"""Helper to handle common pick-place code for the oracle policy.

        We often have this patten: vertex positions and target positions in
        2D, and then potentially slightly overshoot the target. For example,
        with cloth it's helpful to do this since otherwise the physics will
        favor the cloth 'resetting' to its original state. Get the direction
        by creating vectors and then add to the new target. Then form tuples
        for the action params. Assumes no new rotations.

        Args:
            vertex_pos: 2D tuple or array representing picking position.
            target_pos: 2D tuple or array representing target position.
            overshoot: how much to go beyond the target position.

        Returns:
            Dict for the action with 'pose0' and 'pose1' keys.
        """
Dict for the action with 'pose0' and 'pose1' keys.
Dict for the action with ' pose0 ' and ' pose1 ' keys .
self
vertex_pos
2D tuple or array representing picking position.
2D tuple or array representing picking position .
target_pos
2D tuple or array representing target position.
2D tuple or array representing target position .
overshoot
None