middleware Package
middleware Package
abstract_datastream Module
-
class AbstractDatastream(component_instance, kwargs)[source]
Bases: builtins.object
The class is inherited by all serializers/deserializers.
Concrete classes need to implement default().
-
component_name[source]
-
data[source]
-
default(ci='unused')[source]
default method called by MORSE logic
Sensor: must read local_data, format and publish them.
Actuator: must read a new incoming command and update local_data.
-
finalize()[source]
finalize the specific datastream
Can be overriden if needed
-
initialize()[source]
initialize the specific datastream
Can be overriden if needed
pocolibs_request_manager Module
-
class PocolibsRequestManager[source]
Bases: morse.core.request_manager.RequestManager
Implements Pocolibs requests to control the MORSE simulator.
This is done by re-implementing (parts of) the TCLserv protocol.
-
HOST = ''
-
PORT = 9473
-
finalization()[source]
Terminate the ports used to accept requests
-
initialization()[source]
-
main()[source]
-
on_service_completion(intern_rqst_id, result)[source]
-
post_registration(component, service, is_async)[source]
ros_request_manager Module
socket_datastream Module
-
class MorseEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]
Bases: json.encoder.JSONEncoder
-
default(obj)[source]
-
class Socket[source]
Bases: morse.core.datastream.Datastream
External communication using sockets.
-
get_all_stream_ports()[source]
Get stream ports for all streams.
-
get_stream_port(name)[source]
Get stream port for stream name.
-
list_streams()[source]
List all publish streams.
-
register_component(component_name, component_instance, mw_data)[source]
Open the port used to communicate by the specified component.
-
class SocketPublisher(component_instance, kwargs)[source]
Bases: morse.middleware.socket_datastream.SocketServ
-
default(ci='unused')[source]
-
encode()[source]
-
class SocketReader(component_instance, kwargs)[source]
Bases: morse.middleware.socket_datastream.SocketServ
-
decode(msg)[source]
-
default(ci='unused')[source]
-
class SocketServ(component_instance, kwargs)[source]
Bases: morse.middleware.abstract_datastream.AbstractDatastream
-
close_socket(sock)[source]
-
finalize()[source]
Terminate the ports used to accept requests
-
initialize()[source]
socket_request_manager Module
-
class SocketRequestManager[source]
Bases: morse.core.request_manager.RequestManager
Implements services to control the MORSE simulator over
raw ASCII sockets.
The syntax of requests is:
>>> id component_name service [params with Python syntax]
id is an identifier set by the client to conveniently identify
the request. It must be less that 80 chars in [a-zA-Z0-9].
The server answers:
>>> id status result_in_python|error_msg
status is one of the constants defined in morse.core.status.
-
finalization()[source]
Terminate the ports used to accept requests
-
initialization()[source]
-
main()[source]
-
on_service_completion(request_id, results)[source]
-
post_registration(component, service, is_async)[source]
text_datastream Module
-
class BasePublisher(component_instance, kwargs)[source]
Bases: morse.middleware.abstract_datastream.AbstractDatastream
-
default(ci)[source]
-
encode_data()[source]
-
finalize()[source]
-
initialize()[source]
-
class CSVPublisher(component_instance, kwargs)[source]
Bases: morse.middleware.text_datastream.BasePublisher
-
encode_data()[source]
-
class Publisher(component_instance, kwargs)[source]
Bases: morse.middleware.text_datastream.BasePublisher
-
encode_data()[source]
-
class Text[source]
Bases: morse.core.datastream.Datastream
Produce text files as output for the components
yarp_json_request_manager Module
-
class YarpRequestManager[source]
Bases: morse.core.request_manager.RequestManager
Implements services to control the MORSE simulator over YARP
The syntax of requests is:
>>> id component_name service [params with Python syntax]
‘id’ is an identifier set by the client to conveniently identify
the request. It must be less that 80 chars in [a-zA-Z0-9].
The server answers:
>>> id OK|FAIL result_in_python|error_msg
-
finalization()[source]
-
initialization()[source]
-
main()[source]
Read commands from the ports, and prepare the response
-
on_service_completion(request_id, results)[source]
-
post_registration(component_name, service, is_async)[source]
Register a connection of a service with YARP
yarp_request_manager Module
-
class YarpRequestManager[source]
Bases: morse.core.request_manager.RequestManager
Implements services to control the MORSE simulator over YARP
The syntax of requests is:
>>> id component_name service [params with Python syntax]
‘id’ is an identifier set by the client to conveniently identify
the request. It must be less that 80 chars in [a-zA-Z0-9].
The server answers:
>>> id OK|FAIL result_in_python|error_msg
-
finalization()[source]
-
initialization()[source]
-
main()[source]
Read commands from the ports, and prepare the response
-
on_service_completion(request_id, results)[source]
-
post_registration(component_name, service, is_async)[source]
Register a connection of a service with YARP