ROSTypeDBInterface
- class ros_typedb.ros_typedb_interface.ROSTypeDBInterface(node_name, **kwargs)
ROS lifecycle node to interact with typedb.
Initialize the lifecycle node and declare runtime parameters.
- Parameters:
node_name (
str) – ROS node name.kwargs – Extra keyword arguments passed to
Node.
Methods
__init__(node_name, **kwargs)Initialize the lifecycle node and declare runtime parameters.
Publish a delete event in the
/eventtopic.delete_db_cb(_req, response)Handle callback for ~/delete_database service.
init_typedb_interface(address, database_name)Initialize self.typedb_interface.
Publish an insert event in the
/eventtopic.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)
Initialize the lifecycle node and declare runtime parameters.
- Parameters:
node_name (
str) – ROS node name.kwargs – Extra keyword arguments passed to
Node.
- delete_db_cb(_req, response)
Handle callback for ~/delete_database service.
- Parameters:
_req (
Empty_Request) – Empty request payload (unused).response (
Empty_Response) – Empty service response.
- Return type:
Empty_Response- Returns:
Response after deleting the configured database.
- init_typedb_interface(address, database_name, schema_path=None, data_path=None, force_database=False, force_data=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 (
bool) – if database should override an existing databaseforce_data (
bool) – if the database data should be overridden.
- Return type:
- Returns:
None.
- on_cleanup(_state)
Cleanup ROSTypeDBInterface when the cleanup transition is called.
- Parameters:
_state (
LifecycleState) – Lifecycle transition state (unused).- Return type:
TransitionCallbackReturnType- Returns:
Transition callback status.
- on_configure(_state)
Configure ROSTypeDBInterface when the configure transition is called.
- Parameters:
_state (
LifecycleState) – Lifecycle transition state (unused).- Return type:
TransitionCallbackReturnType- Returns:
Transition callback status.
- publish_data_event(event_type)
Publish message in the /event topic.
- query_service_cb(req, response)
Handle callback for ~/query service.
Perform the query requested with the ~/query service.
- Parameters:
req (
Query_Request) – Incoming service request with query type and TypeQL text.response (
Query_Response) – Pre-allocated ROS service response.
- Return type:
Query_Response- Returns:
Filled response with success flag and optional payload.