예제 #1
0
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy,
                 period):
        # Initialise encoder
        Encoders.__init__(self,
                          BigEncoder,
                          SmallEncoders,
                          small_encoders_required=False)
        # Initialise robot
        Robot.__init__(self,
                       values,
                       positions,
                       ALProxy,
                       masses=False,
                       acc_required=False,
                       gyro_required=False)

        self.order = [{
            'algo': Nothing,
            'duration': 20
        }, {
            'algo': Start,
            'duration': 30
        }, {
            'algo': IncreaseQuarterPeriod,
            'increasing': True,
            'max_angle': 5.0
        }, {
            'algo': MaintainGoodBadKick,
            'maintain_angle': 5,
            'duration': 60
        }, {
            'algo': IncreaseQuarterPeriod,
            'max_angle': 7.5
        }, {
            'algo': MaintainGoodBadKick,
            'maintain_angle': 7.5,
            'duration': 60
        }, {
            'algo': IncreaseQuarterPeriod,
            'min_angle': 5,
            'increasing': False
        }, {
            'algo': MaintainGoodBadKick,
            'duration': 230,
            'maintain_angle': 5
        }]

        #self.order = [{
        #'algo': Nothing,
        #'duration': 10
        #},{
        #'algo': MaintainFeedback,
        #'maintain_angle': 7.5
        #}]

        for dictionary in self.order:
            dictionary['period'] = period
예제 #2
0
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy, period):
        # Initialise encoder
        Encoders.__init__(self, BigEncoder, SmallEncoders)
        # Initialise robot
        Robot.__init__(self, values, positions, ALProxy, masses=False, acc_required=False, gyro_required=False)

        self.order = [{
            'algo': Nothing,
            'duration': 5
        },{
            'algo': IncreaseQuarterPeriod,
            'duration': 60}]

        for dictionary in self.order:
            dictionary['period'] = period
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy, period):
        # Initialise encoder
        Encoders.__init__(self, BigEncoder, SmallEncoders)
        # Initialise robot
        Robot.__init__(self, values, positions, ALProxy, masses=False, acc_required=False, gyro_required=False)

        self.order = [{
            'algo': Nothing,
            'duration': 5.0
        },{
            'algo': MaintainGoodBadKick,
            'maintain_angle': 10.0
        }]



        for dictionary in self.order:
            dictionary['period'] = period
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy, period):

        Encoders.__init__(self, BigEncoder, SmallEncoders, small_encoders_required=False)
        
        Robot.__init__(self, values, positions, ALProxy, masses=False, acc_required=False, gyro_required=False)

        self.order = [
        {        
            'algo': Nothing,
            'duration': 10
        },{        
            'algo': Triple,
            'duration': 30
        },{
            'algo': TripleIncrease,
            'duration' : 30
        },{
			'algo': Main,
			'duration': 30
		}
        ]
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy,
                 period):

        Encoders.__init__(self,
                          BigEncoder,
                          SmallEncoders,
                          small_encoders_required=False)

        Robot.__init__(self,
                       values,
                       positions,
                       ALProxy,
                       masses=False,
                       acc_required=True,
                       gyro_required=False)

        self.order = [{
            'algo': Nothing,
            'duration': 40
        }, {
            'algo': Acc,
            'duration': 600
        }]
예제 #6
0
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy,
                 period):

        Encoders.__init__(self,
                          BigEncoder,
                          SmallEncoders,
                          small_encoders_required=False)

        Robot.__init__(self,
                       values,
                       positions,
                       ALProxy,
                       masses=False,
                       acc_required=False,
                       gyro_required=False)

        self.order = [{
            'algo': Nothing_ML,
            'duration': 10
        }, {
            'algo': Machine_Learning_Bool,
            'duration': 600
        }]
    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy):
        # Initialise encoder
        Encoders.__init__(self, BigEncoder, SmallEncoders)
        # Initialise robot
        Robot.__init__(self, values, positions, ALProxy)

        # These are the classes that all containing the function algorithm that will be run,
        # this classes will be initialised one cycle before switching to the algorithm
        self.increase1 = IncreaseQuarterPeriod
        self.increase2 = Increase
        self.start = Start
        self.start = Nothing
        self.maintain = MaintainConstant

        self.order = [{
            'algo': self.start,
            'duration': 5.0
        }, {
            'algo': self.increase2,
            'duration': 35.0,
            'max_angle': 10.0,
            'decrease': False
        }]
import pandas as pd

from robot_interface import Robot
from encoder_interface import Encoders
from naoqi import ALProxy
from positions_sym import positions
from limb_data_2020 import values
import time
path.insert(0, "../Training_functions")
import SmallEncoders

from ml_old import ML
ml = ML()

Robot = Robot(values, positions, ALProxy)
Encoders = Encoders(BigEncoder, SmallEncoders)

#creates dictionary of ratios required to move whole torso relative to hip movements
crunched_pos = positions['crunched']
extended_pos = positions['extended']
torso_list = {
    'RHP', 'LHP', 'RSP', 'LSP', 'RSR', 'LSR', 'RER', 'LER', 'REY', 'LEY',
    'RWY', 'LWY'
}
hips = extended_pos['RHP'] - crunched_pos['RHP']
torso_dict = {}
for joint in torso_list:
    value = (extended_pos[joint] - crunched_pos[joint]) / hips
    torso_dict[joint] = value

    def __init__(self, BigEncoder, SmallEncoders, values, positions, ALProxy,
                 period):
        # Initialise encoder
        Encoders.__init__(self, BigEncoder, SmallEncoders)
        # Initialise robot
        Robot.__init__(self,
                       values,
                       positions,
                       ALProxy,
                       masses=False,
                       acc_required=False,
                       gyro_required=False)

        self.order = [{'algo': Nothing, 'duration': 30}]

        #self.order = [{
        #'algo': Nothing,
        #'duration': 10
        #},{
        #'algo': MaintainFeedback,
        #'duration': 90,
        #'masses': True
        #}]

        #self.order = [{
        #'algo': Nothing,
        #'duration': 90
        #}]

        #self.order = [{
        #'algo': Nothing,
        #'duration': 10
        #},

        #self.order = [{
        #'algo': Start,
        #'duration': 25
        #},{
        #'algo': IncreaseQuarterPeriod,
        #'max_angle': 15
        #},
        ##'algo': DecreaseQuarterPeriod,
        ##'increasing': False,
        ##'min_angle': 10
        ##},{
        ##'algo': MaintainConstant,
        ##'duration': 45
        #{
        #'algo': IncreaseParametric,
        #'duration': 60,
        #'max_angle': 40
        #},{
        #'algo': DecreaseParametric,
        #'duration': 60,
        #'increasing': False,
        #'min_angle': 5
        #},{
        #'algo': Nothing,
        #'duration': 10
        #}]

        for dictionary in self.order:
            dictionary['period'] = period