def shaped_input(unshaped_func, CurrTime, Shaper, *args):
    """
    Function to create a shaped input given a function for an unshaped command

    Arguments:
      unshaped_func : function representing the unshaped command
                      must accept current timestep as its first argument
      CurrTime : The current timestep to deteremint the input for
      Shaper : The shaper to use, should be in [ti Ai] form
      *args : optional arguments to pass to unshaped_func

    Returns:
      shaped : the current timestep of the shaped command
    """

    shaped = 0.0

    for impulse_time, impulse_amp in Shaper:
        shaped = shaped + impulse_amp * unshaped_func(CurrTime - impulse_time, *args)

    return shaped