/usr/lib/python3/dist-packages/morse/builder/robots/morserobots.py is in python3-morse-simulator 1.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | import logging; logger = logging.getLogger("morserobots." + __name__)
from morse.builder import Robot, GroundRobot, WheeledRobot
class Morsy(GroundRobot):
def __init__(self, name=None):
GroundRobot.__init__(self, "morsy", name)
self.properties(classpath = "morse.robots.morsy.Morsy")
self.set_rigid_body()
mesh = self.get_child('morsy_mesh')
mesh.game.physics_type = 'NO_COLLISION'
self._bpy_object.game.radius = 0.08
self.set_collision_bounds()
def set_color(self, color = (0.0, 0.0, 0.8)):
"""
Allows to change Morsy's body color.
"""
mats = self.get_child('morsy_mesh').material_slots.keys()
[body_mat] = [mat for mat in mats if mat.startswith('body')] # account for body.001, body.002...
self.get_child('morsy_mesh').material_slots[body_mat].material.diffuse_color = color
class ATRV(GroundRobot):
def __init__(self, name=None):
GroundRobot.__init__(self, "atrv", name)
self.properties(classpath = "morse.robots.atrv.ATRV")
class B21(GroundRobot):
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'
# see src/morse/robots/environment.py
class FakeRobot(Robot):
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()
class Hummer(GroundRobot):
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)
class Jido(GroundRobot):
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'
# see human.py
#class MocapHuman(Robot):
# def __init__(self, name="Human"):
# Robot.__init__(self, "mocap_human")
# self.name = name
# self.properties(classpath = "morse.robots.mocap_human.MocapHuman",\
# Sensitivity = 0.001, Speed = 0.01, \
# DraggedObject = "", move_cameraFP = True)
# # Mouse Game Logic
class Pioneer3DX(WheeledRobot):
def __init__(self, name=None):
WheeledRobot.__init__(self, "pioneer3dx", name)
self.properties(classpath = "morse.robots.pioneer3dx.Pioneer3DX",
HasSuspension = False, HasSteering = False,
Influence = 0.1, Friction = 0.8,
WheelFLName = "Wheel_L", WheelFRName = "Wheel_R",
WheelRLName = "None", WheelRRName = "None",
CasterWheelName = "CasterWheel",
FixTurningSpeed = 0.52)
class QUAD2012(Robot):
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()
class Quadrotor(Robot):
def __init__(self, name=None):
Robot.__init__(self, "quadrotor_dynamic", name)
self.properties(classpath = "morse.robots.quadrotor_dynamic.Quadrotor")
class RMax(Robot):
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'
class SegwayRMP400(WheeledRobot):
def __init__(self, name=None):
WheeledRobot.__init__(self, "segwayrmp400", name)
self.properties(classpath = "morse.robots.segwayrmp400.SegwayRMP400",
HasSuspension = False, HasSteering = False,
Influence = 0.1, Friction = 0.8, FixTurningSpeed = 1.16,
WheelFLName = "wheel1", WheelFRName = "wheel2",
WheelRLName = "wheel3", WheelRRName = "wheel4")
class Submarine(Robot):
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()
class Victim(GroundRobot):
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)
class PatrolBot(WheeledRobot):
def __init__(self, name=None):
WheeledRobot.__init__(self, "patrolbot", name)
self.properties(classpath = "morse.robots.patrolbot.PatrolBot",
HasSuspension = False, HasSteering = False,
Influence = 0.1, Friction = 0.8,
WheelFLName = "Wheel_L", WheelFRName = "Wheel_R",
WheelRLName = "None", WheelRRName = "None",
CasterWheelName = "CasterWheel")
|