services Package

communication_services Module

distance_and_view(robot1, robot2)[source]

Return the distance between the two robots, and a boolean which described if one can view the other.

supervision_services Module

activate(component_name)[source]

Enable the functionality of the component specified

deactivate(component_name)[source]

Stop the specified component from calling its default_action method

details()[source]

Returns a structure containing all possible details about the simulation currently running, including the list of robots, the list of services and datastreams, the list of middleware in use, etc.

get_obj_by_name(name)[source]

Return object in the scene associated to :param name: If it does not exists, throw a MorseRPCInvokationError

get_scene_objects()[source]

Returns a hierarchial dictonary structure of all objects in the scene along with their positions and orientations, formated as a Python string representation. The structure: {object_name: [dict_of_children, position_tuple, quaternion_tuple], object_name: [dict_of_children, position_tuple, quaternion_tuple], ...}

get_structured_children_of(blender_object)[source]

Returns a nested dictionary of the given objects children, recursively. The retun format is as follows:

{blender_object.name: [children_dictionary, position, orientation]}

where children_dictionary is another of the same format, but with the keys being the children of blender_object. This continues down the entire tree structure.

Parameters:blender_object (KX_GameObject) – The Blender object to return children

for.

list_robots()[source]

Return a list of the robots in the current scenario

Uses the list generated during the initialisation of the scenario

quit()[source]

Cleanly quit the simulation

reset_objects()[source]

Restore all simulation objects to their original position

Upon receiving the request using sockets, call the ‘reset_objects’ function located in morse/blender/main.py

restore_dynamics()[source]

Resumes physics for all object in the scene.

set_log_level(component, level)[source]

Allow to change the logger level of a specific component

Parameters:
  • component (string) – the name of the logger you want to modify
  • level (string) – the desired level of logging
set_object_dynamics(object_name, state)[source]

Enable or disable the dynamics for an individual object.

Note: When turning on dynamics, the object will continue with the velocities it had when it was turned off.

Parameters:
  • object_name (string) – The name of the object to change.
  • boolean (state) – Turn on dynamics(True), or off (False)
set_object_visibility(object_name, visible, do_children)[source]

Set the visibility of an object in the simulation.

Note: The object will still have physics and dynamics despite being invisible.

Parameters:
  • object_name (string) – The name of the object to change visibility of.
  • boolean (do_children) – Make the object visible(True) or invisible(False)
  • boolean – If True then the visibility of all children of

object_name is also set.

suspend_dynamics()[source]

Suspends physics for all object in the scene.

terminate()[source]

Terminate the simulation (no finalization done!)

Table Of Contents

Previous topic

sensors Package

Next topic

testing Package

This Page