def _create_enter_carry_posture(sim, posture_state, carry_target, track):
    var_map = {
        PostureSpecVariable.CARRY_TARGET:
        carry_target,
        PostureSpecVariable.HAND:
        track_to_hand(track),
        PostureSpecVariable.POSTURE_TYPE_CARRY_OBJECT:
        carry_target.get_carry_object_posture()
    }
    pick_up_operation = PostureOperation.PickUpObject(
        PostureSpecVariable.POSTURE_TYPE_CARRY_OBJECT,
        PostureSpecVariable.CARRY_TARGET)
    new_source_aop = pick_up_operation.associated_aop(sim, var_map)
    new_posture_spec = pick_up_operation.apply(
        posture_state.get_posture_spec(var_map),
        enter_carry_while_holding=True)
    if new_posture_spec is None:
        raise RuntimeError(
            '[rmccord] Failed to create new_posture_spec in enter_carry_while_holding!'
        )
    new_posture_state = PostureState(sim, posture_state, new_posture_spec,
                                     var_map)
    new_posture = new_posture_state.get_aspect(track)
    from carry.carry_postures import CarryingNothing
    if new_posture is None or isinstance(new_posture, CarryingNothing):
        raise RuntimeError(
            '[rmccord] Failed to create a valid new_posture ({}) from new_posture_state ({}) in enter_carry_while_holding!'
            .format(new_posture, new_posture_state))
    new_posture.external_transition = True
    return (new_posture_state, new_posture, new_source_aop, var_map)
 def get_provided_posture_change(cls, aop):
     return PostureOperation.PickUpObject(cls.CARRY_NOTHING_POSTURE_TYPE, None)
 def get_provided_posture_change(cls, aop):
     return PostureOperation.PickUpObject(cls._carry_posture_type, aop.target)