Exemple #1
0
    def __init__(self, filename='human_rig', name=None):
        """
        :param filename: the human model. Default: 'human_rig'
        """
        GroundRobot.__init__(self, filename, name)
        self.properties(classpath="morse.robots.human.Human")

        self.skeleton = None

        try:
            self.skeleton = Armature(
                armature_name=self.get_child("HumanSkeleton").name)
            self.append(self.skeleton)
        except KeyError:
            logger.error("Could not find the human armature! (I was looking " +\
                         "for an object called 'HumanSkeleton' in the children " + \
                         "objects of the human). I won't be able to export the " + \
                         "human pose to any middleware.")

        if self.skeleton:
            self.skeleton.create_ik_targets(self.IK_TARGETS)
            for t, name in self.skeleton.ik_targets:
                t.parent = self._bpy_object

            # Add an armature sensor. "joint_stateS" to match standard ROS spelling.
            self.joint_states = ArmaturePose("joint_states")
            self.skeleton.append(self.joint_states)
Exemple #2
0
    def __init__(self, filename='human_rig', name = None):
        """ The 'style' parameter is only to switch to the mocap_human file.

        :param filename: the human model. Default: 'human_rig'
        """
        GroundRobot.__init__(self, filename, name)
        self.properties(classpath = "morse.robots.human.Human")

        self.skeleton = None

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

        if self.skeleton:
            self.skeleton.create_ik_targets(self.IK_TARGETS)
            for t, name in self.skeleton.ik_targets:
                t.parent = self._bpy_object

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

        self.keyboard = Keyboard()
        self.keyboard.properties(Speed=1.15)
        self.append(self.keyboard)
 def __init__(self, name=None):
     GroundRobot.__init__(self, "victim", name)
     self.properties(classpath="morse.robots.victim.Victim",
                     Victim_Tag=True,
                     Requirements="1,2,3",
                     Injured=True,
                     Severity=10)
 def __init__(self, name=None):
     GroundRobot.__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)
    def __init__(self, name=None):
        GroundRobot.__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'
Exemple #6
0
    def __init__(self, name=None):
        GroundRobot.__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'
    def __init__(self, name=None):
        GroundRobot.__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'
Exemple #8
0
    def __init__(self, name=None):
        GroundRobot.__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'
    def __init__(self, name=None):
        GroundRobot.__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.08

        self.set_collision_bounds()
Exemple #10
0
    def __init__(self, name=None):
        GroundRobot.__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.08

        self.set_collision_bounds()
Exemple #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'
        """
        GroundRobot.__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(armature_name = "HumanArmature" + self.suffix)
            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

        self.make_grasper('Hand_Grab.R')
 def __init__(self, name=None):
     GroundRobot.__init__(self, "atrv", name)
     self.properties(classpath="morse.robots.atrv.ATRV")
Exemple #13
0
 def __init__(self, name=None):
     GroundRobot.__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)
Exemple #14
0
 def __init__(self, name=None):
     GroundRobot.__init__(self, "atrv", name)
     self.properties(classpath = "morse.robots.atrv.ATRV")
Exemple #15
0
 def __init__(self, name=None):
     GroundRobot.__init__(self, "victim", name)
     self.properties(classpath = "morse.robots.victim.Victim",
                     Victim_Tag = True, Requirements = "1,2,3",
                     Injured = True, Severity = 10)