Esempio n. 1
0
def plant(T, initD):
    gain = sm.Gain(T)
    delay_x = sm.R(0)

    delay_y = sm.FeedbackAdd(sm.Gain(1), sm.R(initD))

    return sm.Cascade(sm.Cascade(gain, delay_x), delay_y)
Esempio n. 2
0
def plant(t, initD):
    """
    Returns a state machine whose input is the commanded velocity
    and whose output is the distance to the wall.
    
    Args:
        t - the duration of a time step
        initD - the starting distance from the wall
    """
    movement = sm.Gain(t)
    position = sm.R(initD)
    return sm.FeedbackAdd(movement, position)
Esempio n. 3
0
def plant(T, initD):
    return sm.Cascade(sm.Gain(-T), sm.FeedbackAdd(sm.R(initD), sm.Wire()))
Esempio n. 4
0
def sensor(initD):
    return sm.R(initD)
Esempio n. 5
0
def accumulator(init):
    none_there = sm.Gain(1)
    y_delay = sm.R(init)
    y = sm.FeedbackAdd(none_there, y_delay)
    return y
Esempio n. 6
0
def accumulatorDelay(init):
    x_delay = sm.R(0)
    return sm.Cascade(x_delay, accumulator(init))
Esempio n. 7
0
def accumulatorDelay(init):
    return sm.FeedbackAdd(sm.R(init), sm.Gain(1.0))
Esempio n. 8
0
def accumulatorDelayScaled(init, s):
    return sm.Cascade(sm.FeedbackAdd(sm.R(init), sm.Gain(1.0)), sm.Gain(s))
Esempio n. 9
0
def accumulator(init):
    """
    Returns a state machine such that y[n] = y[n-1] + x[n] with a starting state of init.
    """
    return sm.FeedbackAdd(sm.Gain(1), sm.R(init))
Esempio n. 10
0
def accumulatorDelay(init):
    """
    Returns a state machine such that y[n] = y[n-1] + x[n-1] witgh a starting state of init.
    """
    return sm.Cascade(accumulator(init), sm.R(init))
Esempio n. 11
0
def sensor(initD):
    """
    Returns a state machine whose input should be the distance to the wall
    and whose output should be the delayed distance to the wall.
    """
    return sm.R(initD)