Exemplo n.º 1
0
 def __init__(self, name=None):
     Robot.__init__(self, "victim")
     self.name = name
     self.properties(Class = "VictimClass", \
                     Path = "morse/robots/victim", \
                     Victim_Tag = True, Requirements = "1,2,3", \
                     Injured = True, Severity = 10)
Exemplo n.º 2
0
 def __init__(self, name=None):
     Robot.__init__(self, "hummer")
     self.name = name
     self.properties(Class = "HummerClass", \
                     Path = "morse/robots/hummer", \
                     brakes = 0.0, friction = 200.0, force = 0.0, \
                     steer = 0.0, init = 0, cid = 0)
Exemplo n.º 3
0
    def __init__(self, filename='human'):
        """ The 'style' parameter is only to switch to the mocap_human file.

        :param filename: 'human' (default) or 'mocap_human'
        """
        Robot.__init__(self, filename)
        self.name = 'Human' # XXX BUG #237

        self.armature = None

        try:
            self.armature = Armature("HumanArmature", "human_posture")
            # new way of loading class (drop 'Class' and 'Path' properties)
            self.armature.properties(classpath="morse.sensors.human_posture.HumanPostureClass")
            self.append(self.armature)
        except KeyError:
            logger.error("Could not find the human armature! (I was looking " +\
                         "for an object called 'HumanArmature' in the 'Human'" +\
                         " children). I won't be able to export the human pose" +\
                         " to any middleware.")

        # fix for Blender 2.6 Animations
        armature_object = self.get_child(self.armature.name)
        if armature_object:
            hips = self.get_child("Hips_Empty")
            # IK human has no object called Hips_Empty, so avoid this step
            if hips:
                for i, actuator in enumerate(hips.game.actuators):
                    actuator.layer = i
                for i, actuator in enumerate(armature_object.game.actuators):
                    actuator.layer = i
Exemplo n.º 4
0
    def __init__(self, name=None):
        Robot.__init__(self, "rmax", name)
        self.properties(classpath="morse.robots.rmax.RMax", NoGravity=True)

        self.set_rigid_body()
        rotor = self.get_child('Rotor')
        rotor.game.physics_type = 'NO_COLLISION'
Exemplo n.º 5
0
    def __init__(self, name=None):
        Robot.__init__(self, "rmax", name)
        self.properties(classpath = "morse.robots.rmax.RMax",
                        NoGravity = True)

        self.set_rigid_body()
        rotor = self.get_child('Rotor')
        rotor.game.physics_type = 'NO_COLLISION'
Exemplo n.º 6
0
    def __init__(self, name=None):
        Robot.__init__(self, "b21", name)
        self.properties(classpath = "morse.robots.b21.B21")

        self.set_rigid_body()
        self.set_collision_bounds()

        collision = self.get_child('b21_collision')
        collision.game.physics_type = 'STATIC'
Exemplo n.º 7
0
    def __init__(self, name=None):
        Robot.__init__(self, "jido", name)
        self.properties(classpath = "morse.robots.jido.Jido")

        self.set_dynamic()
        self.set_collision_bounds()
        self._bpy_object.game.radius = 0.01

        mesh = self.get_child('JidoBase')
        mesh.game.physics_type = 'STATIC'
Exemplo n.º 8
0
    def __init__(self, name=None):
        Robot.__init__(self, "morsy", name)
        self.properties(classpath = "morse.robots.morsy.Morsy")

        self.set_dynamic()
        mesh = self.get_child('morsy_mesh')
        mesh.game.physics_type = 'NO_COLLISION'

        self._bpy_object.game.radius = 0.01

        self.set_collision_bounds()
Exemplo n.º 9
0
    def __init__(self, name = None, debug = True):

        # theman.blend is located in the data/robots directory
        Robot.__init__(self, 'test_1/robots/theman.blend', name)
        self.properties(classpath = "test_1.robots.theman.Theman")
        self.suffix = self.name[-4:] if self.name[-4] == "." else ""
        try:
            self.armature = Armature("Armature" + self.suffix, "human_posture")
            # self.armature = Armature("Armature")
            self.append(self.armature)
            self.armature_pose = ArmaturePose() # armature_pose = joint states
            self.armature_pose.name="pose"
            self.armature.append(self.armature_pose)
            self.joint_state = CompoundSensor([self.armature_pose])
            self.append(self.joint_state)

        except KeyError:
            logger.error("Could not find the human armature! (I was looking " +\
                         "for an object called 'Armature' in the human" +\
                         " children). I won't be able to export the human pose" +\
                         " to any middleware.")


        ###################################
        # Actuators
        ###################################


        # (v,w) motion controller
        # Check here the other available actuators:
        # http://www.openrobots.org/morse/doc/stable/components_library.html#actuators

        # self.motion = MotionVW()
        # self.append(self.motion)

        # Optionally allow to move the robot with the keyboard
        if debug:
            keyboard = Keyboard()
            self.append(keyboard)

        ###################################
        # Sensors
        ###################################

        self.pose = Pose()
        self.append(self.pose)
Exemplo n.º 10
0
    def __init__(self, filename='human'):
        """ The 'style' parameter is only to switch to the mocap_human file.

        :param filename: 'human' (default) or 'mocap_human'
        """
        Robot.__init__(self, filename)

        self.suffix = self.name[-4:] if self.name[-4] == "." else ""

        self.armature = None
        if filename == 'mocap_human':
            self.properties(
                classpath="morse.robots.mocap_human.MocapHumanClass")
        else:
            self.properties(classpath="morse.robots.human.HumanClass")

        try:
            self.armature = Armature("HumanArmature" + self.suffix,
                                     "human_posture")
            # new way of loading class (drop 'Class' and 'Path' properties)
            self.armature.properties(
                classpath="morse.sensors.human_posture.HumanPosture")
            self.append(self.armature)
        except KeyError:
            logger.error("Could not find the human armature! (I was looking " +\
                         "for an object called 'HumanArmature' in the human" +\
                         " children). I won't be able to export the human pose" +\
                         " to any middleware.")

        # fix for Blender 2.6 Animations
        armature_object = self.get_child(self.armature.name)
        if armature_object:
            hips = self.get_child("Hips_Empty")
            # IK human has no object called Hips_Empty, so avoid this step
            if hips:
                for i, actuator in enumerate(hips.game.actuators):
                    actuator.layer = i
                for i, actuator in enumerate(armature_object.game.actuators):
                    actuator.layer = i
Exemplo n.º 11
0
    def __init__(self, filename='human', name = None):
        """ The 'style' parameter is only to switch to the mocap_human file.

        :param filename: 'human' (default) or 'mocap_human'
        """
        Robot.__init__(self, filename, name)

        self.suffix = self.name[-4:] if self.name[-4] == "." else ""

        self.armature = None
        if filename == 'mocap_human':
            self.properties(classpath="morse.robots.mocap_human.MocapHuman")
        else:
            self.properties(classpath="morse.robots.human.Human")

        try:
            self.armature = Armature("HumanArmature" + self.suffix, "human_posture")
            self.append(self.armature)
        except KeyError:
            logger.error("Could not find the human armature! (I was looking " +\
                         "for an object called 'HumanArmature' in the human" +\
                         " children). I won't be able to export the human pose" +\
                         " to any middleware.")

        # Add an armature sensor. "joint_stateS" to match standard ROS spelling.
        self.joint_states = ArmaturePose()
        self.armature.append(self.joint_states)

        # fix for Blender 2.6 Animations
        armature_object = self.get_child(self.armature.name)
        if armature_object:
            hips = self.get_child("Hips_Empty")
            # IK human has no object called Hips_Empty, so avoid this step
            if hips:
                for i, actuator in enumerate(hips.game.actuators):
                    actuator.layer = i
                for i, actuator in enumerate(armature_object.game.actuators):
                    actuator.layer = i
Exemplo n.º 12
0
 def __init__(self, name=None):
     Robot.__init__(self, "b21", name)
     self.properties(classpath = "morse.robots.b21.B21")
Exemplo n.º 13
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor_dynamic")
     self.name = name
     self.properties(Class = "QuadrotorClass", \
                     Path = "morse/robots/quadrotor")
Exemplo n.º 14
0
 def __init__(self, name=None):
     Robot.__init__(self, "submarine")
     self.name = name
     self.properties(Class = "SubmarineClass", \
                     Path = "morse/robots/submarine")
Exemplo n.º 15
0
 def __init__(self, name=None):
     Robot.__init__(self, "b21")
     self.name = name
     self.properties(Class = "B21Class", \
                     Path = "morse/robots/b21")
Exemplo n.º 16
0
 def __init__(self, name=None):
     Robot.__init__(self, "jido")
     self.name = name
     self.properties(Class = "JidoClass", \
                     Path = "morse/robots/jido")
Exemplo n.º 17
0
 def __init__(self, name=None):
     Robot.__init__(self, "rmax", name)
     self.properties(classpath="morse.robots.rmax.RMax")
Exemplo n.º 18
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor", name)
     self.properties(classpath = "morse.robots.quadrotor.Quadrotor")
     # Collision - Motion Game Logic
     self.set_no_collision()
Exemplo n.º 19
0
 def __init__(self, name=None):
     Robot.__init__(self, "jido")
     self.name = name
     self.properties(classpath = "morse.robots.jido.JidoClass")
Exemplo n.º 20
0
 def __init__(self, name=None):
     Robot.__init__(self, "atrv")
     self.name = name
     self.properties(classpath="morse.robots.atrv.ATRVClass")
Exemplo n.º 21
0
 def __init__(self, name=None):
     Robot.__init__(self, "morsy")
     self.name = name
Exemplo n.º 22
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor")
     self.name = name
     self.properties(classpath = "morse.robots.quadrotor.Quadrotor")
 def __init__(self, name=None):
     Robot.__init__(self, "rmax")
     self.name = name
     self.properties(classpath = "morse.robots.rmax.RmaxClass")
Exemplo n.º 24
0
 def __init__(self, name=None):
     Robot.__init__(self, "submarine")
     self.name = name
     self.properties(classpath = "morse.robots.submarine.SubmarineClass")
Exemplo n.º 25
0
 def __init__(self, name=None):
     Robot.__init__(self, "rmax")
     self.name = name
     self.properties(classpath = "morse.robots.rmax.RmaxClass")
Exemplo n.º 26
0
 def __init__(self, name=None):
     Robot.__init__(self, "jido", name)
     self.properties(classpath = "morse.robots.jido.Jido")
Exemplo n.º 27
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor", name)
     self.properties(classpath="morse.robots.quadrotor.Quadrotor")
     # Collision - Motion Game Logic
     self.set_no_collision()
Exemplo n.º 28
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor_dynamic")
     self.name = name
     self.properties(classpath = "morse.robots.quadrotor.QuadrotorClass")
Exemplo n.º 29
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor_dynamic", name)
     self.properties(classpath="morse.robots.quadrotor_dynamic.Quadrotor")
Exemplo n.º 30
0
 def __init__(self, name=None):
     Robot.__init__(self, "morsy", name)
     self.properties(classpath="morse.robots.morsy.Morsy")
Exemplo n.º 31
0
 def __init__(self, name=None):
     Robot.__init__(self, "quadrotor_dynamic", name)
     self.properties(classpath = "morse.robots.quadrotor_dynamic.Quadrotor")
Exemplo n.º 32
0
 def __init__(self, name=None, debug = True):
     Robot.__init__(self, 'robots/rotating_table.blend', name)
     self.properties(classpath = "morse.robots.rotating_table_services.RotatingTable")
Exemplo n.º 33
0
 def __init__(self, name=None):
     Robot.__init__(self, "submarine", name)
     self.properties(classpath = "morse.robots.submarine.Submarine")
Exemplo n.º 34
0
 def __init__(self, name=None):
     Robot.__init__(self, "cubemodule",
                    name)  # determines Blender model.blend
     self.properties(classpath="morse.robots.cubemodule.CubeModule"
                     )  # determines robot script.py
Exemplo n.º 35
0
 def __init__(self, name=None):
     Robot.__init__(self, "hummer")
     self.name = name
     self.properties(classpath = "morse.robots.hummer.HummerClass", \
                     brakes = 0.0, friction = 200.0, force = 0.0, \
                     steer = 0.0, init = 0, cid = 0)
Exemplo n.º 36
0
 def __init__(self, name=None):
     Robot.__init__(self, "atrv")
     self.name = name
     self.properties(Class = "ATRVClass", \
                     Path = "morse/robots/atrv")
Exemplo n.º 37
0
 def __init__(self, name=None):
     Robot.__init__(self, "b21")
     self.name = name
     self.properties(classpath = "morse.robots.b21.B21Class")
Exemplo n.º 38
0
 def __init__(self, name=None):
     Robot.__init__(self, "rmax")
     self.name = name
     self.properties(Class = "RmaxClass", \
                     Path = "morse/robots/rmax")
Exemplo n.º 39
0
 def __init__(self, name=None):
     Robot.__init__(self, "submarine", name)
     self.properties(classpath = "morse.robots.submarine.Submarine",
                     NoGravity = True)
     self.set_rigid_body()
     self.set_collision_bounds()
Exemplo n.º 40
0
 def __init__(self, name=None):
     Robot.__init__(self, "atrv", name)
     self.properties(classpath = "morse.robots.atrv.ATRV")
Exemplo n.º 41
0
 def __init__(self, name=None):
     Robot.__init__(self, "victim")
     self.name = name
     self.properties(classpath = "morse.robots.victim.VictimClass", \
                     Victim_Tag = True, Requirements = "1,2,3", \
                     Injured = True, Severity = 10)
Exemplo n.º 42
0
 def __init__(self, name=None):
     Robot.__init__(self, "hummer", name)
     self.properties(classpath = "morse.robots.hummer.Hummer", \
                     brakes = 0.0, friction = 200.0, force = 0.0, \
                     steer = 0.0, init = 0, cid = 0)
Exemplo n.º 43
0
 def __init__(self, name=None):
     Robot.__init__(self, name = name) # no Blender model -> a simple Empty will be created
     self.properties(classpath = "morse.robots.fakerobot.FakeRobot")
     self.set_no_collision()
Exemplo n.º 44
0
 def __init__(self, name=None):
     Robot.__init__(self, "morsy", name)
     self.properties(classpath = "morse.robots.morsy.Morsy")
Exemplo n.º 45
0
 def __init__(self, name=None):
     Robot.__init__(self, "morsy")
     self.name = name
Exemplo n.º 46
0
 def __init__(self, name=None):
     Robot.__init__(self, "rmax", name)
     self.properties(classpath = "morse.robots.rmax.RMax")
Exemplo n.º 47
0
 def __init__(self, name=None):
     Robot.__init__(self, "submarine", name)
     self.properties(classpath="morse.robots.submarine.Submarine",
                     NoGravity=True)
     self.set_rigid_body()
     self.set_collision_bounds()
Exemplo n.º 48
0
 def __init__(self, name=None):
     Robot.__init__(self, "victim", name)
     self.properties(classpath = "morse.robots.victim.Victim", \
                     Victim_Tag = True, Requirements = "1,2,3", \
                     Injured = True, Severity = 10)
Exemplo n.º 49
0
 def __init__(self, name=None):
     Robot.__init__(
         self,
         name=name)  # no Blender model -> a simple Empty will be created
     self.properties(classpath="morse.robots.fakerobot.FakeRobot")
     self.set_no_collision()