30) > 15 or abs(robot.getAngle("r" + joint) - 30) > 15:
                print "!!!!!!!!!! Joint " + joint + " in wrong position " + str(
                    robot.getAngle("r" + joint) -
                    30) + " . Please do not break my arm! !!!!!!!!!!!!"
                quit()
            else:
                print ""
        else:
            print "!!!!!!!!!! Joint " + joint + " in wrong position . Please do not break my arm! !!!!!!!!!!!!"
            quit()

# set the robot to be compliant
#robot.disableTorqueAll()

mover_path = "../../../../moves_and_positions/"
mov = Mover.Mover(robot, stiff_off=False)

fe = faceExpression()
fe.sendFaceExpression("happiness")
#time.sleep(1)

# build the neural network
print("Building network")
network = build_net()

print("Loading network from files")
# And load parameters from file

# used for evaqluation : model_selflearning-CORE1-0.0701329990989.npz

with np.load('model_selflearning-MERGED-0.0455165514722.npz') as f:
Ejemplo n.º 2
0
# Very simple example to use the mover class
# Toggle the right arm between two position and open and close the hands
# (Leads to a dice throw, if you put the dice in the robots hand)


import logging
import time

from nicomotion import Motion, Mover

logging.basicConfig(level=logging.WARNING)

mover_path = "../../../moves_and_positions/"
robot = Motion.Motion("../../../json/nico_humanoid_upper.json", vrep=False)
mov = Mover.Mover(robot, stiff_off=True)

key = "c"
while key != "q":
    # mov.play_movement(mover_path+"mov_from_table_to_get.csv",
    # subsetfname=mover_path+"subset_left_arm_and_head.csv",move_speed=0.01)
    mov.move_file_position(mover_path + "pos_from_table_to_get.csv",
                           subsetfname=(
                               mover_path + "subset_left_arm_and_head.csv"),
                           move_speed=0.05)
    robot.openHand("LHand")
    raw_input()
    robot.closeHand("LHand", 1.0, 0.5)
    time.sleep(2)
    # mov.play_movement(mover_path+"mov_from_get_throw.csv",subsetfname=mover_path+"subset_left_arm.csv",move_speed=0.03)
    ttw = mov.move_file_position(mover_path + "pos_from_get_throw.csv",