morse.builder package¶
Subpackages¶
Submodules¶
morse.builder.abstractcomponent module¶
- class AbstractComponent(obj=None, filename='', category='')[source]¶
Bases:
object
- add_interface(interface, **kwargs)[source]¶
Add a service and stream interface to the component
Its argument is the name of the interface to be used.
- add_overlay(datastream, overlay, config=None, **kwargs)[source]¶
Add a service overlay for a specific service manager to the component
Similar to the add_stream function. Its argument is the name of the datastream to be used.
- add_service(interface, component=None, config=None)[source]¶
Add a service interface to the component
Similar to the previous function. Its argument is the name of the interface to be used.
- add_stream(datastream, method=None, path=None, classpath=None, direction=None, **kwargs)[source]¶
Add a data stream interface to the component
Do the binding between a component and the method to export/import its data. This must be used in general by sensors and actuators. A single component can make several calls to this function to add bindings with more than one middleware.
- Parameters
datastream – enum in [‘ros’, ‘socket’, ‘yarp’, ‘text’, ‘pocolibs’, ‘moos’]
classpath – if set, force to use the configuration of the given component, instead of our own (default=None).
You can pass other argument to this method, they will be added as a map to the configuration.
component.add_stream('ros', topic='/myrobots/data') component.add_stream('moos', moos_host=127.0.0.1, moos_port=9000, moos_freq=10)
- alter(modifier_name=None, classpath=None, direction=None, **kwargs)[source]¶
Add a modifier specified by its first argument to the component
- append(obj, child=None, level=1)[source]¶
Add a child to the current object
Add the object given as an argument as a child of this object. The argument is an instance to another component. This method is generally used to add components to a robot. e.g., : robot.append(sensor), will set the robot parent of the sensor.
If child is not None, the object will be parented to the named child of self instead of the root of self.
- append_collada(component=None)[source]¶
Append Collada objects to the scene
- Parameters
component – component in which the objects are located
- Returns
list of the imported Blender objects
- append_meshes(objects=None, component=None, prefix=None)[source]¶
Append the component’s Blender objects to the scene
The
objects
are located either in: MORSE_COMPONENTS/self._category
/component
.blend/Object/ or in: MORSE_RESOURCE_PATH/component
/Object/If component is not set (neither as argument of append_meshes nor through the
AbstractComponent
constructor), a Blender Empty is created instead.Note
By default, all the objects present in the component’s blend file are imported. If you need to exclude some (like lights you may have in your blend file), prefix the name of this objects with
_
so that MORSE ignores them.- Parameters
objects – list of the objects names to append
component – component in which the objects are located
prefix – filter the objects names to append (used by PassiveObject)
- Returns
list of the imported (selected) Blender objects
- components = []¶
- frequency(frequency=None)[source]¶
Set the frequency of the Python module
- Parameters
frequency – (int) Desired frequency, 0 < frequency < logic tics
- get_child(name, objects=None, recursive=True)[source]¶
get_child returns the child named :param name:
If several children match the name, a warning is printed and the first one is returned.
- Parameters
name – the textual name of the child
objects – if specified, look for the child in this list of bpy Objects
recursive – (default: True) if true, search for the child recursively
- level(level)[source]¶
Set the ‘realism level’ of the component.
Some components define several abstraction level that impact what data are exported.
See each component documentation for the list of available levels.
- property location¶
- morseable(calling_module=None)[source]¶
Make this component simulable in MORSE
- Parameters
calling_module –
Module called each simulation cycle. enum in [‘calling.sensor_action’,
’calling.actuator_action’, ‘calling.robot_action’]
- property name¶
- profile()[source]¶
Watch the average time used during the simulation.
Display the profile of the component on the viewport in percent. As Blender would for framerate and other debug-properties.
- properties(**kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
self.properties(capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
self.properties(my_clock = timer(5.0), my_speed = int(5/2))
- rotate(x=0.0, y=0.0, z=0.0)[source]¶
Rotate the current object
The rotation is an euler rotation relative to the object’s center. default: x=0, y=0, z=0, unit: radian
- property rotation_euler¶
- property scale¶
- class Configuration[source]¶
Bases:
object
- datastream = {}¶
- frequency = {}¶
- max_frequency()[source]¶
Returns the highest update frequency requested in the Builder script for any component (via component.frequency(…)). If no specific frequency has been set, returns MORSE’s default (60Hz)
- modifier = {}¶
- overlay = {}¶
- service = {}¶
- stream_manager = {}¶
morse.builder.actuators module¶
- class Destination(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class ExternalForce(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class ForceTorque(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class Gripper(name=None)[source]¶
Bases:
morse.builder.creator.ActuatorCreator
- properties(**kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
self.properties(capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
self.properties(my_clock = timer(5.0), my_speed = int(5/2))
- class KukaLWR(name=None)[source]¶
Bases:
morse.builder.actuators.Armature
This actuator provides a KUKA LWR mesh with the associated kinematic chain.
An IK target is available on the last join, allowing for cartesian control of the arm.
See the general documentation on armatures for details.
- class Light(name=None)[source]¶
Bases:
morse.builder.creator.ActuatorCreator
- properties(**kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
self.properties(capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
self.properties(my_clock = timer(5.0), my_speed = int(5/2))
- class MocapControl(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class MotionVWDiff(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class MotionXYW(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class Orientation(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class QuadrotorDynamicControl(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class RotorcraftAttitude(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class RotorcraftVelocity(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class RotorcraftWaypoint(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class StabilizedQuadrotor(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class SteerForce(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
morse.builder.blenderobjects module¶
- class Cone(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Coordsys(name)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
- mesh_primitive_add(**kwargs)¶
- class Cube(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Cylinder(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Empty(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class IcoSphere(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Mesh(name)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
- mesh_primitive_add(**kwargs)¶
- class Plane(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Sphere(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
- class Torus(name)[source]¶
Bases:
morse.builder.blenderobjects.Mesh
- mesh_primitive_add(**kwargs)¶
morse.builder.bpymorse module¶
This module wraps the calls to the Blender Python API. This is intended for all the cases we need to run MORSE code outside Blender (mostly for documentation generation purposes).
- add_actuator(*args, **kwargs)¶
- add_camera(*args, **kwargs)¶
- add_controller(*args, **kwargs)¶
- add_empty(*args, **kwargs)¶
- add_lamp(*args, **kwargs)¶
- add_mesh_cone(*args, **kwargs)¶
- add_mesh_cube(*args, **kwargs)¶
- add_mesh_cylinder(*args, **kwargs)¶
- add_mesh_ico_sphere(*args, **kwargs)¶
- add_mesh_monkey(*args, **kwargs)¶
- add_mesh_plane(*args, **kwargs)¶
- add_mesh_torus(*args, **kwargs)¶
- add_mesh_uv_sphere(*args, **kwargs)¶
- add_object(*args, **kwargs)¶
- add_sensor(*args, **kwargs)¶
- append(*args, **kwargs)¶
- apply_transform(*args, **kwargs)¶
- armatures(*args, **kwargs)¶
- collada_import(*args, **kwargs)¶
- del_scene(*args, **kwargs)¶
- fullscreen(fullscreen=True, desktop=True)[source]¶
Run the simulation fullscreen
- Parameters
fullscreen (Boolean, default: True) – Start player in a new fullscreen display
desktop (Boolean, default: True) – Use the current desktop resolution in fullscreen mode
- link(*args, **kwargs)¶
- link_append(*args, **kwargs)¶
- make_links_scene(*args, **kwargs)¶
- new_game_property(*args, **kwargs)¶
- new_material(*args, **kwargs)¶
- new_mesh(*args, **kwargs)¶
- new_object(*args, **kwargs)¶
- new_scene(*args, **kwargs)¶
- new_text(*args, **kwargs)¶
- open_sound(*args, **kwargs)¶
- properties(obj, **kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
properties(obj, capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
properties(obj, my_clock = timer(5.0), my_speed = int(5/2))
- save(filepath=None, check_existing=False, compress=True)[source]¶
Save .blend file
- Parameters
filepath (string, (optional, default: current file)) – File Path
check_existing (boolean, (optional, default: False)) – Check and warn on overwriting existing files
compress (boolean, (optional, default: True)) – Compress, Write compressed .blend file
- select_all(*args, **kwargs)¶
- set_speed(fps=60, logic_step_max=20, physics_step_max=20)[source]¶
Tune the speed of the simulation
- Parameters
fps (default 60) – Nominal number of game frames per second (physics fixed timestep = 1/fps, independently of actual frame rate)
logic_step_max (default value : 20) – Maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics
physics_step_max (default value : 20) – Maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime
usage:
bpymorse.set_speed(120, 5, 5)
Note
It is recommended to use the same value for logic_step_max | physics_step_max
Warning
This method must be called at the top of your Builder script, before creating any component.
- set_viewport(viewport_shade='WIREFRAME', clip_end=1000)[source]¶
Set the default view mode
- Parameters
viewport_shade – enum in [‘BOUNDBOX’, ‘WIREFRAME’, ‘SOLID’, ‘TEXTURED’], default ‘WIREFRAME’
morse.builder.creator module¶
- class ActuatorCreator(name=None, action=0, blendfile=None, blendobject=None, make_morseable=True)[source]¶
- class ComponentCreator(name, category, action=0, blendfile='', blendobject=None, make_morseable=True)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
- APPEND_EMPTY = 0¶
- LINK_EXISTING_OBJECT = 2¶
- USE_BLEND = 1¶
- append_collada(component=None)[source]¶
Append Collada objects to this component
Overloads
morse.builder.abstractcomponent.AbstractComponent.append_collada()
- Parameters
component – component in which the objects are located
- Returns
list of the imported Blender objects
- append_meshes(objects=None, component=None, prefix=None)[source]¶
Append the objects to this component
Overloads
morse.builder.abstractcomponent.AbstractComponent.append_meshes()
- Parameters
objects – list of the objects names to append
component – component in which the objects are located
- Returns
list of the imported Blender objects
morse.builder.data module¶
This module holds MORSE Builder API settings
MORSE_COMPONENTS: Default path to Morse components.
MORSE_RESOURCE_PATH: Path list to Morse components (like the shell PATH variable).
The search path for components. It is a colon-separated list of directories in
which MORSE looks for components. A zero-length (null) directory name in the
value of PATH indicates the current directory. A null directory name may appear
as two adjacent colons, or as an initial or trailing colon. The default path is
MORSE_COMPONENTS
, wich means this list always contains morse components path.
You can export it before to start morse (commonly in ~/.bashrc
) as:
export MORSE_RESOURCE_PATH="/home/user/my_own_components:/home/user/my_own_environments"
MORSE_MODIFIERS: Path to the modifiers modules.
MORSE_DATASTREAM_MODULE: Path to the middleware modules.
MORSE_MODIFIER_DICT: Associate a modifier function to a component.
morse.builder.environment module¶
- class Environment(filename, main_scene=None, fastmode=False, component_renaming=True, auto_tune_time=True)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
Class to configure the general environment of the simulation
It handles the background environment in which your robots are simulated, general properties of the simulation, the default location and orientation of the camera, the Blender Game Engine settings, configure the parameters for the multi-node simulation and also writes the ‘component_config.py’ file.
- add_service(datastream)[source]¶
Override AbstractComponent method
Use it to define which
datastream
expose the simulator internals services (i.e., the services used to remotely control the simulator behaviour):env = Environement('indoors-1/indoor-1', fastmode = True) # Set the simulation management services to be available from ROS: env.add_service('ros')
- configure_multinode(protocol='socket', server_address='localhost', server_port='65000', distribution=None)[source]¶
Provide the information necessary for the node to connect to a multi-node server.
- Parameters
protocol – Either ‘socket’ or ‘hla’
server_address – IP address where the multi-node server can be found
server_port – Used only for ‘socket’ protocol. Currently it should always be 65000
distribution – A Python dictionary. The keys are the names of the nodes, and the values are lists with the names of the robots handled by each node
dala1 = ATRV() dala2 = ATRV() env = Environment('land-1/trees') env.configure_multinode( protocol='socket', server_address='localhost', server_port='65000', distribution={ "nodeA": [dala1.name], "nodeB": [dala2.name], })
- create(name=None)[source]¶
Generate the scene configuration and insert necessary objects
Should always be called at the very end of the Builder script. It will finalise the building process and write the configuration files.
- enable_mist(value=True)[source]¶
Enables or disables mist
See World/Mist on the Blender Manual for more information about this particular setting.
- Parameters
value – indicate whether to enable/disable mist
- fullscreen(fullscreen=True)[source]¶
Run the simulation fullscreen
- Parameters
fullscreen (Boolean, default: True) – Start player in a new fullscreen display
- multinode_distribution = {}¶
- save(filepath=None, check_existing=False, compress=True)[source]¶
Save .blend file
- Parameters
filepath (string, (optional, default: current file)) – File Path
check_existing (boolean, (optional, default: False)) – Check and warn on overwriting existing files
compress (boolean, (optional, default: True)) – Compress, Write compressed .blend file
- select_display_camera(robot_camera)[source]¶
Select the camera that will be displayed on the HUD Screen object
- Parameters
robot_camera – AbstractComponent reference to the camera desired to be displayed
- set_animation_record(record=True)[source]¶
Record the simulation as a Blender animation (F-Curves)
See the tutorial: Recording Game Physics to Keyframes for more information about this particular setting.
- Parameters
record – boolean, default True
- set_background_scene(scene)[source]¶
Set the background scene used by main scene
- Parameters
scene – the name of the scene to use in background
- set_camera_clip(clip_start=0.1, clip_end=100)[source]¶
Set the simulator’s Camera near and far clipping distance
- Parameters
clip_start – Camera near clipping distance, float in meters (default 0.1)
clip_end – Camera far clipping distance, float in meters (default 100)
- set_camera_focal_length(focal_length=20.0)[source]¶
Set the focal length of the default camera
- Parameters
focal_length – focal length im mm (default 20.0)
env.set_camera_focal_length(50.0)
- set_camera_location(location)[source]¶
Set the location of the default camera.
- Parameters
location – list with the new 3D coordinates for the camera.
env.set_camera_location([10.0, -10.0, 3.0])
- set_camera_rotation(rotation)[source]¶
Set the orientation of the default camera
- Parameters
rotation – list with an euler rotation for the camera.
env.set_camera_rotation([1.3300, 0, 0.7854])
- set_camera_speed(speed=2.0)[source]¶
Set the simulator’s Camera speed
- Parameters
speed – desired speed of the camera, in meter by second.
- set_debug(debug=True)[source]¶
Set Blender debug mode
- Parameters
debug (Boolean, default: True) – set when blender is running in debug mode (started with –debug)
- set_gravity(gravity=9.81)[source]¶
Set the gravity for the specific scene
- Parameters
gravity – float, default: 9.81
- set_horizon_color(color=(0.05, 0.22, 0.4))[source]¶
Set the horizon color
See World/Background on the Blender Manual for more information about this particular setting.
- Parameters
color – (0.0, 0.0, 0.0) < (R, B, G) < (1.0, 1.0, 1.0) default: dark azure (0.05, 0.22, 0.4)
- set_log_level(component, level)[source]¶
Set the debug level of the component to the level level.
- Parameters
component – the class name of the component
level – a string representing the level of debug to set
XXX not persistent (if you save the scene and reload it directly from blender, the logger is not set at the right level.
- set_material_mode(material_mode='GLSL')[source]¶
Material mode to use for rendering
SINGLETEXTURE
Singletexture, Singletexture face materials.MULTITEXTURE
Multitexture, Multitexture materials.GLSL
GLSL, OpenGL shading language shaders.
- Parameters
material_mode – enum in [‘SINGLETEXTURE’, ‘MULTITEXTURE’, ‘GLSL’]
- set_mist_settings(**settings)[source]¶
Sets the mist settings for the scene
See World/Mist on the Blender Manual for more information about this particular setting.
Optional arguments need to be specified with identifyer: :param enable: Enables or disables mist :param intensity: Overall minimum intensity of the mist effect in [0,1] :param start: Starting distance of the mist, measured from the camera :param depth: Distance over which the mist effect fades in :param falloff: Type of transition used to fade mist enum in [‘QUADRATIC’, ‘LINEAR’, ‘INVERSE_QUADRATIC’], default ‘QUADRATIC’
- set_physics_step_sub(step_sub)[source]¶
Configure the number of physics sub step per physics step.
Basically, if you increase the step_sub value, your simulation will spent more time in computing physics, but it will be more precise. The default value is 2.
- set_stereo(mode='ANAGLYPH', eye_separation=0.1, stereo='STEREO')[source]¶
Configure to render image in stereo mode
(anaglyphs allows to see in 3d with special red-cyan glasses)
- Parameters
mode – Stereographic techniques. enum in [‘QUADBUFFERED’, ‘ABOVEBELOW’, ‘INTERLACED’, ‘ANAGLYPH’, ‘SIDEBYSIDE’, ‘VINTERLACE’], default ‘ANAGLYPH’
eye_separation – Distance between the eyes. float in [0.01, 5], default 0.1
stereo – enum in [‘NONE’, ‘STEREO’, ‘DOME’], default ‘STEREO’
- set_time_scale(slowdown_by=None, accelerate_by=None)[source]¶
Slow down or accelerate the simulation relative to real-time (default behaviour: real-time simulation) by modifying the time scale of the simulation.
- Parameters
slowndown_by – factor by which the simulation should be
slowed down, relative to real-time :param accelerate_by: factor by which the simulation should be accelerated, relative to real-time You must pass only one of these options
- set_time_strategy(strategy)[source]¶
Choose the time strategy for the current simulation
- Parameters
strategy – the strategy to choose. Must be one of value
of
morse.builder.TimeStrategies
- set_viewport(viewport_shade='WIREFRAME', clip_end=1000)[source]¶
Set the default view mode
- Parameters
viewport_shade – enum in [‘BOUNDBOX’, ‘WIREFRAME’, ‘SOLID’, ‘TEXTURED’], default ‘WIREFRAME’
- show_debug_properties(value=True)[source]¶
Display the value of the game-properties marked as debug
- Parameters
value – indicate whether to show or not this information
- show_framerate(value=True)[source]¶
Display framerate and profile information of the simulation
- Parameters
value – indicate whether to show or not this information
- show_physics(value=True)[source]¶
Display of the bounding boxes of objects during the simulation
- Parameters
value – indicate whether to show or not this information
- simulator_frequency(base_frequency=60, logic_step_max=20, physics_step_max=20)[source]¶
Tune the frequency of the simulation
- Parameters
base_frequency (default 60) – Nominal number of game frames per second (physics fixed timestep = 1/ (base_frequency * time_scale), independently of actual frame rate)
logic_step_max (default value : 20) – Maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics
physics_step_max (default value : 20) – Maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime
usage:
env.simulator_frequency(120, 5, 5)
Note
It is recommended to use the same value for logic_step_max and physics_step_max
morse.builder.morsebuilder module¶
- class Component(category='', filename='', make_morseable=True)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
Append a morse-component to the scene
cf. bpy.ops.wm.link_append and bpy.data.libraries.load
- class PassiveObject(filename='props/objects', prefix=None, keep_pose=False)[source]¶
Bases:
morse.builder.abstractcomponent.AbstractComponent
Allows to import any Blender object to the scene.
- class Robot(filename='', name=None)[source]¶
Bases:
morse.builder.morsebuilder.Component
- add_default_interface(stream)[source]¶
Add a service and stream interface to all components of the robot
Note
If add_stream or add_service is used explicitly for some components and the specified interface is the same it will be added twice.
- make_ghost(alpha=0.3)[source]¶
Make this robot a ghost
The robot is made transparent, with no collision.
Note
A ghost robot has no influence on other simulated robots (no collision, invisible to laser sensors) except for video sensors.
- Parameters
alpha – Transparency alpha coefficient (0 for invisible, 1 for opaque, default is 0.3)
- set_friction(friction=0.0)[source]¶
Set Coulomb friction coefficient
- Parameters
friction (float) – [0, 100], default 0.0
morse.builder.sensors module¶
- class Collision(name=None)[source]¶
Bases:
morse.builder.creator.SensorCreator
- properties(**kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
self.properties(capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
self.properties(my_clock = timer(5.0), my_speed = int(5/2))
- class Hokuyo(name=None)[source]¶
Bases:
morse.builder.sensors.LaserSensorWithArc
A laser scanner configured to mimick the Hokuyo sensor.
See the laser scanners general documentation for details.
- class Infrared(name=None)[source]¶
Bases:
morse.builder.sensors.LaserSensorWithArc
A laser scanner configured to mimick a infra-red proximity sensor.
See the laser scanners general documentation for details.
- class Kinect(name='Kinect')[source]¶
Bases:
morse.builder.sensors.CompoundSensor
Microsoft Kinect RGB-D camera, implemented as a pair of depth camera and video camera.
See the general documentation for video cameras and depth cameras for details.
- add_stream(*args, **kwargs)[source]¶
Add a data stream interface to the component
Do the binding between a component and the method to export/import its data. This must be used in general by sensors and actuators. A single component can make several calls to this function to add bindings with more than one middleware.
- Parameters
datastream – enum in [‘ros’, ‘socket’, ‘yarp’, ‘text’, ‘pocolibs’, ‘moos’]
classpath – if set, force to use the configuration of the given component, instead of our own (default=None).
You can pass other argument to this method, they will be added as a map to the configuration.
component.add_stream('ros', topic='/myrobots/data') component.add_stream('moos', moos_host=127.0.0.1, moos_port=9000, moos_freq=10)
- class LaserSensorWithArc(name=None, action=0, make_morseable=True)[source]¶
- class SearchAndRescue(name=None)[source]¶
Bases:
morse.builder.creator.SensorCreator
- properties(**kwargs)[source]¶
Add/modify the game properties of the Blender object
Usage example:
self.properties(capturing = True, classpath='module.Class', speed = 5.0)
will create and/or set the 3 game properties Component_Tag, classpath, and speed at the value True (boolean), ‘module.Class’ (string), 5.0 (float). In Python the type of numeric value is ‘int’, if you want to force it to float, use the following: float(5) or 5.0 Same if you want to force to integer, use: int(a/b) For the TIMER type, see the class timer(float) defined in this module:
self.properties(my_clock = timer(5.0), my_speed = int(5/2))
- class Sick(name=None)[source]¶
Bases:
morse.builder.sensors.LaserSensorWithArc
A laser scanner configured to mimick the SICK sensor.
See the laser scanners general documentation for details.
- class SickLDMRS(name=None)[source]¶
Bases:
morse.builder.sensors.LaserSensorWithArc
A laser scanner configured to mimick the SICK LD-MRS sensor.
See the laser scanners general documentation for details.
- VelodyneZB¶
alias of
morse.builder.sensors.Velodyne
- class VideoCamera(name=None)[source]¶