示例#1
0
    def __init__(self, robot):
        LoopPrimitive.__init__(self, robot, 1)

        self.freq = 0.1

        self.sinus = [
            Sinus(self.robot,
                  50, [self.robot.shoulder_pitch],
                  amp=30,
                  freq=self.freq,
                  offset=15),
            Sinus(self.robot,
                  50, [self.robot.shoulder_roll],
                  amp=30,
                  freq=self.freq,
                  offset=30),
            Sinus(self.robot,
                  50, [self.robot.elbow_pitch],
                  amp=30,
                  freq=self.freq,
                  offset=30),
            Sinus(self.robot,
                  50, [self.robot.arm_yaw],
                  amp=30,
                  freq=self.freq,
                  offset=40),
        ]
示例#2
0
    def __init__(self, robot, freq, face_detector):
        LoopPrimitive.__init__(self, robot, freq)

        self.face_detector = face_detector

        self.dx, self.dy = 60, 50
        self._tracked_face = None
示例#3
0
    def __init__(self, robot, move_file):
        LoopPrimitive.__init__(self, robot, 50)

        with open(move_file) as f:
            self.reader = csv.DictReader(f)
            self.data = [row for row in self.reader]
            self.i = 0
 def __init__(self, environment, freq, motors, mov, primitive_duration, log):
     LoopPrimitive.__init__(self, environment.robot, freq)
     self.motors = motors
     self.mov = mov
     self.primitive_duration = primitive_duration
     self.one_step_duration = primitive_duration / mov.shape[0]
     self.log = log
     self.env = environment
示例#5
0
 def __init__(self, environment, freq, motors, mov, primitive_duration,
              log):
     LoopPrimitive.__init__(self, environment.robot, freq)
     self.motors = motors
     self.mov = mov
     self.primitive_duration = primitive_duration
     self.one_step_duration = primitive_duration / mov.shape[0]
     self.log = log
     self.env = environment
示例#6
0
    def __init__(self, robot, freq=0.5, temp_limit=40,
                 time_reduce_torque=5, small_torque=20,
                 time_compliant=10, player='aplay', sound=None):

        LoopPrimitive.__init__(self, robot, freq)

        self.temp_limit = temp_limit
        self.time_reduce_torque = time_reduce_torque
        self.time_compliant = time_compliant
        self.small_torque = small_torque
        self.player = player
        self.sound = sound
        self._overheat_time = {}
示例#7
0
    def __init__(self, robot, leg, refresh_freq=50):
        LoopPrimitive.__init__(self, robot, refresh_freq)
        # you should never access directly to the motors in a primitive, because this is the goal of the Primitives manager
        # to manage this acces for all the primitives : https://poppy-project.github.io/pypot/primitive.html
        fake_motors = getattr(self.robot, leg)
        self.knee = fake_motors[2]
        self.hip = fake_motors[1]
        self.hip_lateral = fake_motors[0]
        self.motors = fake_motors

        # size of segment's leg
        self.shin = 63
        self.thigh = 55
        self.pelvis = 38
示例#8
0
 def __init__(self, robot, command_freq = 40):
     
     LoopPrimitive.__init__(self, robot, command_freq)
     
     self.legs = []
     self.all_leg_motors = []
     
     for i in range(4):
         leg_motors = getattr(self.robot, DiploTurnLeft.leg_names[i])
         self.legs.append(DiploLeg(leg_motors, DiploTurnLeft.is_front[i]))
         self.all_leg_motors.extend(leg_motors)
         
     self.command_freq = command_freq
     self.dt = 1. / command_freq
示例#9
0
    def __init__(self, robot, distance, step_duration, frequency=50):
        LoopPrimitive.__init__(self, robot, frequency)

        self.step_length = 0.1
        self.step_height = 0.01
        self.pelvis_height = 0.098
        self.motors = dict([(m.name, self.get_mockup_motor(m))
                            for m in self.robot.motors])
        self.distance_left = distance
        self.step_duration = step_duration
        ssp_ratio = .75
        self.ssp_duration = ssp_ratio * step_duration
        self.dsp_duration = (1 - ssp_ratio) * step_duration
        self.dt = 1. / frequency
        self.pos = None
示例#10
0
    def __init__(self, robot, freq, detector, tracked_id):
        LoopPrimitive.__init__(self, robot, freq)

        self.dx, self.dy = 60, 50

        def get_marker_pos():
            marker = [m.position for m in getattr(detector, 'markers')
                      if m.id == tracked_id]

            if len(marker) == 1:
                return marker[0]

            return None

        self.get_marker_pos = get_marker_pos
示例#11
0
    def __init__(self, robot, freq, detector, tracked_id):
        LoopPrimitive.__init__(self, robot, freq)

        self.dx, self.dy = 60, 50

        def get_marker_pos():
            marker = [
                m.position for m in getattr(detector, 'markers')
                if m.id == tracked_id
            ]

            if len(marker) == 1:
                return marker[0]

            return None

        self.get_marker_pos = get_marker_pos
示例#12
0
    def __init__(self,
                 robot,
                 freq=0.5,
                 temp_limit=40,
                 time_reduce_torque=5,
                 small_torque=20,
                 time_compliant=10,
                 player='aplay',
                 sound=None):

        LoopPrimitive.__init__(self, robot, freq)

        self.temp_limit = temp_limit
        self.time_reduce_torque = time_reduce_torque
        self.time_compliant = time_compliant
        self.small_torque = small_torque
        self.player = player
        self.sound = sound
        self._overheat_time = {}
示例#13
0
文件: move.py 项目: SteveNguyen/pypot
 def __init__(self, robot, move):
     LoopPrimitive.__init__(self, robot, move.framerate)
     self.move = move
示例#14
0
 def __init__(self, robot):
     LoopPrimitive.__init__(self, robot, 1.)
示例#15
0
 def __init__(self, robot, refresh_freq):
     self.robot = robot
     LoopPrimitive.__init__(self, robot, refresh_freq)
示例#16
0
文件: move.py 项目: SteveNguyen/pypot
    def __init__(self, robot, freq, tracked_motors):
        LoopPrimitive.__init__(self, robot, freq)
        self.freq = freq

        self.tracked_motors = map(self.get_mockup_motor, tracked_motors)
 def __init__(self, robot, move):
     LoopPrimitive.__init__(self, robot, move.framerate)
     self.positions = move.positions()
     self.motors = robot.motors
     self.maxPreviousPos = 10
     self.previousPoses = []
示例#18
0
 def __init__(self, robot, freq=5):
     LoopPrimitive.__init__(self, robot, freq)
示例#19
0
文件: posture.py 项目: xepost/reachy
 def __init__(self, robot):
     LoopPrimitive.__init__(self, robot, 1.0)
示例#20
0
 def __init__(self, robot):
     LoopPrimitive.__init__(self, robot, 50.0)
     self.motors = [self.robot.arm_yaw]
示例#21
0
 def __init__(self, robot):
     LoopPrimitive.__init__(self, robot, 1)
     self.record_name = "demo_example"
示例#22
0
 def __init__(self, robot, freq=5):
     LoopPrimitive.__init__(self, robot, freq)
示例#23
0
 def __init__(self, robot, motors):
     LoopPrimitive.__init__(self, robot, 50)
     self.motors = motors