python_scripts/trial_prog.py
def full_active_mode(activationCode, force_sensor):
    '''
    Sub-program 3: Patient full-active treatment.
        Patient's strength level has increased into levels
        where they could start actively train their muscle strength.

        full active mode acts like an extremely light "work-out in a gym" 
        training for the stroke patient.

        The resistance of this rehabilitation training strategy uses
        haptic rendering of an admittance environment (inputs force, 
        outputs position). Other resistance strategies could be used such 
        as a friction model.  
        
        ADMITTANCE-type device algorithm (mass-spring-damper)
        1. read force of the user
        2. calculate the resulting position
        3. send corresponding position to low level controller
        4. CHANGE virtual environment STATE

        For analogy with IMPEDANCE-type algorithm (see stanford hapkit)
        1. read position of user (compute position in counts --> to meters)
        2. calculate the resulting force
        3. send corresponding force to motor
        4. change virtual environment of state
    '''
    #strength_option, serial_object, admittanceCode, 
    #                         force_input, position_output, force_sensor): 
    # full-active training selection (position or admittance control)
    
    if activationCode[1] == "0":
        isotonic_training(activationCode, force_sensor)
    elif activationCode[1] =="1":
        isometric_training(activationCode, force_sensor)

    Sub-program 3: Patient full-active treatment.
        Patient's strength level has increased into levels
        where they could start actively train their muscle strength.

        full active mode acts like an extremely light "work-out in a gym" 
        training for the stroke patient.

        The resistance of this rehabilitation training strategy uses
        haptic rendering of an admittance environment (inputs force, 
        outputs position). Other resistance strategies could be used such 
        as a friction model.  
        
        ADMITTANCE-type device algorithm (mass-spring-damper)
        1. read force of the user
        2. calculate the resulting position
        3. send corresponding position to low level controller
        4. CHANGE virtual environment STATE

        For analogy with IMPEDANCE-type algorithm (see stanford hapkit)
        1. read position of user (compute position in counts --> to meters)
        2. calculate the resulting force
        3. send corresponding force to motor
        4. change virtual environment of state
    
Sub-program 3: Patient full-active treatment.
Patient's strength level has increased into levels
where they could start actively train their muscle strength.

full active mode acts like an extremely light "work-out in a gym"
training for the stroke patient.

The resistance of this rehabilitation training strategy uses
haptic rendering of an admittance environment (inputs force,
outputs position). Other resistance strategies could be used such
as a friction model.

ADMITTANCE-type device algorithm (mass-spring-damper)
1. read force of the user
2. calculate the resulting position
3. send corresponding position to low level controller
4. CHANGE virtual environment STATE

For analogy with IMPEDANCE-type algorithm
1. read position of user (compute position in counts --> to meters)
2. calculate the resulting force
3. send corresponding force to motor
4. change virtual environment of state
Sub - program 3 : Patient full - active treatment . Patient ' s strength level has increased into levels where they could start actively train their muscle strength . full active mode acts like an extremely light " work - out in a gym " training for the stroke patient . The resistance of this rehabilitation training strategy uses haptic rendering of an admittance environment ( inputs force outputs position ) . Other resistance strategies could be used such as a friction model . ADMITTANCE - type device algorithm ( mass - spring - damper ) 1 . read force of the user 2 . calculate the resulting position 3 . send corresponding position to low level controller 4 . CHANGE virtual environment STATE For analogy with IMPEDANCE - type algorithm 1 . read position of user ( compute position in counts -- > to meters ) 2 . calculate the resulting force 3 . send corresponding force to motor 4 . change virtual environment of state
def full_active_mode(activationCode, force_sensor):
    if activationCode[1] == "0":
        isotonic_training(activationCode, force_sensor)
    elif activationCode[1] =="1":
        isometric_training(activationCode, force_sensor)
def full_active_mode ( activationCode , force_sensor ) : if activationCode [ 1 ] == "0" : isotonic_training ( activationCode , force_sensor ) elif activationCode [ 1 ] == "1" : isometric_training ( activationCode , force_sensor )
Sub-program 3: Patient full-active treatment.
Sub - program 3 : Patient full - active treatment .
'''
    Sub-program 3: Patient full-active treatment.
        Patient's strength level has increased into levels
        where they could start actively train their muscle strength.

        full active mode acts like an extremely light "work-out in a gym" 
        training for the stroke patient.

        The resistance of this rehabilitation training strategy uses
        haptic rendering of an admittance environment (inputs force, 
        outputs position). Other resistance strategies could be used such 
        as a friction model.  
        
        ADMITTANCE-type device algorithm (mass-spring-damper)
        1. read force of the user
        2. calculate the resulting position
        3. send corresponding position to low level controller
        4. CHANGE virtual environment STATE

        For analogy with IMPEDANCE-type algorithm (see stanford hapkit)
        1. read position of user (compute position in counts --> to meters)
        2. calculate the resulting force
        3. send corresponding force to motor
        4. change virtual environment of state
    ''' #strength_option, serial_object, admittanceCode,  #                         force_input, position_output, force_sensor):  # full-active training selection (position or admittance control)
activationCode
force_sensor