analyses/utils.py
def stack_states(states: list[dict], key: str = "q"):
    """
    Stack the controls in one vector

    Parameters
    ----------
    states : list[dict]
        List of dictionaries containing the states
    key : str
        Key of the states to stack such as "q" or "qdot"
    """
    return np.hstack((states[0][key][:, :-1], states[1][key][:, :]))

    Stack the controls in one vector

    Parameters
    ----------
    states : list[dict]
        List of dictionaries containing the states
    key : str
        Key of the states to stack such as "q" or "qdot"
    
Stack the controls in one vector
Parameters

states : list[dict]
List of dictionaries containing the states
key : str
Key of the states to stack such as "q" or "qdot"
Stack the controls in one vector Parameters states : list [ dict ] List of dictionaries containing the states key : str Key of the states to stack such as " q " or " qdot "
def stack_states(states: list[dict], key: str = "q"):
    return np.hstack((states[0][key][:, :-1], states[1][key][:, :]))
def stack_states ( states : list [ dict ] , key : str = "q" ) : return np . hstack ( ( states [ 0 ] [ key ] [ : , : - 1 ] , states [ 1 ] [ key ] [ : , : ] ) )
Stack the controls in one vector
Parameters
Stack the controls in one vector Parameters
"""
    Stack the controls in one vector

    Parameters
    ----------
    states : list[dict]
        List of dictionaries containing the states
    key : str
        Key of the states to stack such as "q" or "qdot"
    """
states
list[dict]
key
str