There are lots of information expressed in Builder script that are not directly translatable in blender model. Here, we describe how the information are passed between the builder script and the simulator.
Some information are passed directly through the game engine property of each component. It includes stuff like classpath (what python class implements the logic of this component) or components properties (passed using the morse.builder.abstractcomponent.AbstractComponent.properties() method).
However, passing information through game engine properties has some limitations: it must be one of basic type (string, int, double, ...), and the range on int and double is limited by Blender. It is not good enough to translate more complex informations.
Information concerning scene configuration (i.e. which datastream handler for which component, which service for which component, ...) are passed through the file component_config.py stored in the blender scene. You can retrieve it using the Text Editor window in Blender.
This file contains a relatively complex python structure, encoding the configuration for the different part mentioned above. The file is automatically generated by the Builder using the method morse.builder.abstractcomponent.Configuration.write_config(). On the simulator side, the file is imported in morse.blender.main, and used to create the different internal structures (see Entry points of the simulation).
More precisely, the file contains four dictionaries:
from morse.builder import *
robot = ATRV()
pose = Pose()
pose.add_stream('socket')
pose.alter('Noise')
robot.append(pose)
odometry = Odometry()
odometry.level("differential")
odometry.add_stream('socket')
robot.append(odometry)
waypoint = Waypoint()
waypoint.add_interface('socket')
robot.append(waypoint)
env = Environment('empty', fastmode=True)
component_datastream = {
"robot.waypoint": [
[
"morse.middleware.socket_datastream.Socket",
"morse.middleware.socket_datastream.SocketReader",
{}
]
],
"robot.odometry": [
[
"morse.middleware.socket_datastream.Socket",
"morse.middleware.socket_datastream.SocketPublisher",
{}
]
],
"robot.pose": [
[
"morse.middleware.socket_datastream.Socket",
"morse.middleware.socket_datastream.SocketPublisher",
{}
]
]
}
component_modifier = {
"robot.pose": [
[
"morse.modifiers.pose_noise.MorsePoseNoiseClass",
"noisify",
{}
]
]
}
component_service = {
"robot.waypoint": [
"morse.middleware.socket_request_manager.SocketRequestManager"
]
}
overlays = {}