def action_correction(actions, policy='conservative'):
    """
    功能：修正生成舞蹈中出现的舵机参数错误，7号舵机的角度必须要小于12号舵机的角度。
        注意，舵机角度值必须反归一化到[0, 180]
    输入：舞蹈动作矩阵，格式为numpy.array。
    返回：修正后的舞蹈动作矩阵。
    """
    if policy == 'conservative':
        for i in range(actions.shape[0]):
            if actions[i][6] > actions[i][11]:
                if 180 - actions[i][6] < actions[i][11]:
                    actions[i][6] = actions[i][11] - 1
                else:
                    actions[i][11] = actions[i][6] + 1
    else:
        for i in range(actions.shape[0]):
            if actions[i][6] > actions[i][11]:
                if 180 - actions[i][6] < actions[i][11]:
                    actions[i][11] = actions[i][6] + 1
                else:
                    actions[i][6] = actions[i][11] - 1
    return actions.clip(0, 180)
