name = 'multinode_config.py' cfg = bpymorse. physics_type = 'STATIC' """ Write the 'multinode_config.py' script """ node_config = # Create the config file if it does not exist if not 'multinode_config.py' in bpymorse. name = 'External_Robot_Tag' # Make external robots static # This should stop them from drifting downwards obj. name ) # Here, we make external other robots if 'Robot_Tag' in p : if not obj.
" Will not be published by this MORSE node." ) else : logger. multinode_distribution : if not 'Robot_Tag' in p : logger. properties # Here we check that all objects declared for this node are robots if obj. multinode_distribution = for obj in bpymorse. warning ( "Node " + node_name + " is not defined in the " + \ _multinode_configured : return if not node_name in self. multinode_distribution def _write_multinode ( self, node_name ): """ Configure this node according to its name and the multinode_distribution dictionnary. def is_internal_camera ( self, camera ): return not self. _physics_step_sub = 2 # Add empty object holdings MORSE Environment's properties # for UTM modifier configutation ( uses env.properties(.) ) bpymorse. _handle_default_interface () # Rename the components according to their variable names if component_renaming : self. remove ( self ) # remove myself from the list of components to ensure my destructor is called self. set_active_scene ( base_scene ) else : self. make_links_scene ( scene = base_scene ) bpymorse. set_active_scene ( main_scene ) for obj in scene. _init_ ( self, category = 'environments', filename = filename ) if main_scene : base_scene = bpymorse. Note that it is an experimental feature, so disable it if you see problem with your simulation, and report it to the Morse project. The feature is automatically disabled if you make an explicit call to some time-related method, such as simulator_frequency. Only set to False if you notice trouble with it, and report the issue to the Morse project :param auto_tune_time: (default: True): If True, Morse will try to compute a good setting for your simulation, on the basis on the described scene. It is the recommanded settings, and is mandatory if you use pymorse. Useful for unit-tests for instance, or in simulations where realistic environment texturing is not required (*e.g.*, no video camera) :param component_renaming: (default: True): if True, automatically rename Blender object on the base of builder python object. """ multinode_distribution = dict () def _init_ ( self, filename, main_scene = None, fastmode = False, component_renaming = True, auto_tune_time = True ): """ :param fastmode: (default: False) if True, disable most visual effects (like lights.) to get the fastest running simulation.
Class Environment ( 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.