ROSTypeDBInterface

class ros_typedb.ros_typedb_interface.ROSTypeDBInterface(node_name, **kwargs)

ROS lifecycle node to interact with typedb.

Create ROSTypeDBInterface node, inherits from lifecycle node.

Methods

__init__(node_name, **kwargs)

Create ROSTypeDBInterface node, inherits from lifecycle node.

delete_data_event()

Publish 'delete' in the /event topic.

init_typedb_interface(address, database_name)

Initialize self.typedb_interface.

insert_data_event()

Publish 'insert' in the /event topic.

on_cleanup(state)

Cleanup ROSTypeDBInterface when the cleanup transition is called.

on_configure(state)

Configure ROSTypeDBInterface when the configure transition is called.

publish_data_event(event_type)

Publish message in the /event topic.

query_service_cb(req, response)

Handle callback for ~/query service.

Attributes

__init__(node_name, **kwargs)

Create ROSTypeDBInterface node, inherits from lifecycle node.

delete_data_event()

Publish ‘delete’ in the /event topic.

Return type:

None

init_typedb_interface(address, database_name, schema_path=None, data_path=None, force_database=False, force_data=False, infer=False)

Initialize self.typedb_interface.

Parameters:
  • address (str) – TypeDB server address.

  • database_name (str) – database name.

  • schema_path (Union[list[str], str, None]) – list with paths to schema files (.tql).

  • data_path (Union[list[str], str, None]) – list with paths to data files (.tql).

  • force_database (Optional[bool]) – if database should override an existing database

  • force_data (Optional[bool]) – if the database data should be overriden.

  • infer (Optional[bool]) – if inference engine should be used.

Return type:

None

insert_data_event()

Publish ‘insert’ in the /event topic.

Return type:

None

on_cleanup(state)

Cleanup ROSTypeDBInterface when the cleanup transition is called.

Return type:

TransitionCallbackReturnType

Returns:

transition result

on_configure(state)

Configure ROSTypeDBInterface when the configure transition is called.

Return type:

TransitionCallbackReturnType

Returns:

transition result

publish_data_event(event_type)

Publish message in the /event topic.

Parameters:

event_type (str) – event to be published, e.g., ‘insert’ or ‘delete’.

Return type:

None

query_service_cb(req, response)

Handle callback for ~/query service.

Perform the query requested with the ~/query service.

Parameters:
  • req (Query_Request) – query to be performed

  • response (Query_Response) – query result

Return type:

Query_Response

Returns:

query result