from sys import argv
from time import sleep

from sot_talos_balance.utils.run_test_utils import (ask_for_confirmation,
                                                    get_file_folder,
                                                    run_ft_calibration,
                                                    run_test, runCommandClient)

test_folder, sot_talos_balance_folder = get_file_folder(argv)

run_test('appli_no_admittance.py')

run_ft_calibration('robot.ftc')

if test_folder is not None:
    c = ask_for_confirmation('Execute trajectory?')
    if c:
        print('Executing the trajectory')
        runCommandClient('robot.triggerTrajGen.sin.value = 1')
    else:
        print('Not executing the trajectory')
else:
    c = ask_for_confirmation("Execute a sinusoid?")
    if c:
        print("Putting the robot in position...")
        runCommandClient('robot.comTrajGen.move(1,-0.025,1.0)')
        sleep(1.0)
        print("Robot is in position!")

        c2 = ask_for_confirmation("Confirm executing the sinusoid?")
        if c2:
from time import sleep

from sot_talos_balance.utils.run_test_utils import (ask_for_confirmation,
                                                    get_file_folder,
                                                    run_ft_calibration,
                                                    run_test, runCommandClient)

try:
    # Python 2
    input = raw_input  # noqa
except NameError:
    pass

test_folder, sot_talos_balance_folder = get_file_folder(argv)

use_distribute = ask_for_confirmation("Use output of force distribution?")
print(("Using" if use_distribute else "Not using") +
      " output of force distribution")

run_test('appli_dcm_zmp_control_distribute.py')

run_ft_calibration('robot.ftc')
input("Wait before running the test")

# Connect ZMP reference and reset controllers
print('Connect ZMP reference')
runCommandClient(
    'plug(robot.zmp_estimator.emergencyStop,robot.cm.emergencyStop_zmp)')
if use_distribute:
    runCommandClient(
        'plug(robot.distribute.emergencyStop,robot.cm.emergencyStop_distribute)'
Example #3
0
'''Test CoM admittance control as described in paper, with pre-loaded movements'''
from sys import argv

from sot_talos_balance.utils.run_test_utils import ask_for_confirmation, run_test, runCommandClient

try:
    # Python 2
    input = raw_input  # noqa
except NameError:
    pass

test_folder = argv[1] if len(argv) > 1 else 'TestKajita2003WalkingOnSpot64/DSP20SSP780'
print('Using folder ' + test_folder)

runCommandClient('test_folder = "' + test_folder + '"')

run_test('appli_base_estimator.py')

c = ask_for_confirmation('Execute trajectory?')
if c:
    print('Executing the trajectory')
    runCommandClient('robot.triggerTrajGen.sin.value = 1')
else:
    print('Not executing the trajectory')

input("Wait before dumping the data")
Example #4
0
from time import sleep

from sot_talos_balance.utils.run_test_utils import ask_for_confirmation, evalCommandClient, run_test, runCommandClient

run_test('appli_simple_ankle_admittance.py')

sleep(1.0)

RightPitchJoint = 10
LeftPitchJoint = 4
RightRollJoint = 11
LeftRollJoint = 5

c = ask_for_confirmation(
    "Do you want to use the current torques values as reference?")
if c:
    runCommandClient(
        'robot.rightPitchAnkleController.tauDes.value = robot.device.ptorque.value[RightPitchJoint]'
    )
    runCommandClient(
        'robot.leftPitchAnkleController.tauDes.value = robot.device.ptorque.value[LeftPitchJoint]'
    )
    runCommandClient(
        'robot.rightRollAnkleController.tauDes.value = robot.device.ptorque.value[RightRollJoint]'
    )
    runCommandClient(
        'robot.leftRollAnkleController.tauDes.value = robot.device.ptorque.value[LeftRollJoint]'
    )

    print("Setting desired torques with current values")
else:
Example #5
0
input("Wait before running the test")

# Connect ZMP reference and reset controllers
print('Set controller')
runCommandClient(
    'plug(robot.zmp_estimator.emergencyStop,robot.cm.emergencyStop_zmp)')
runCommandClient(
    'plug(robot.distribute.emergencyStop,robot.cm.emergencyStop_distribute)')
runCommandClient('robot.pitchController.kSum.value = [0.0]')
runCommandClient('robot.pitchController.kDiff.value = [0.0]')
runCommandClient('robot.rollController.kSum.value = [0.0]')
runCommandClient('robot.rollController.kDiff.value =  [0.0]')
runCommandClient('robot.dcm_control.resetDcmIntegralError()')
runCommandClient('robot.dcm_control.Ki.value = Ki_dcm')

c = ask_for_confirmation("Execute a sinusoid?")
if c:
    print("Putting the robot in position...")
    runCommandClient('robot.comTrajGen.move(1,-0.025,1.0)')
    sleep(1.0)
    print("Robot is in position!")

    c2 = ask_for_confirmation("Confirm executing the sinusoid?")
    if c2:
        print("Executing the sinusoid...")
        runCommandClient('robot.comTrajGen.startSinusoid(1,0.025,2.0)')
        print("Sinusoid started!")
    else:
        print("Not executing the sinusoid")

    c3 = ask_for_confirmation("Put the robot back?")