|
| 1 | +Design |
| 2 | +====== |
| 3 | + |
| 4 | + |
| 5 | +The integration between ROS and TypeDB is implemented with 2 classes, |
| 6 | +`TypeDBInterface <TypeDBInterfaceLink>`_ and |
| 7 | +`ROSTypeDBInterface <ROSTypeDBInterfaceLink>`_. |
| 8 | + |
| 9 | +The `TypeDBInterface <TypeDBInterfaceLink>`_ class interacts with the typeDB |
| 10 | +database using the `typedb python api <PythonAPILink>`_, and it contains basic |
| 11 | +functionalities that are common for all applications, |
| 12 | +such as `insert_database <InsertDatabaseLink>`_ and |
| 13 | +`match_database <MatchDatabaseLink>`_. |
| 14 | + |
| 15 | +The `ROSTypeDBInterface <ROSTypeDBInterfaceLink>`_ class is a ROS 2 |
| 16 | +`LifeCycle <LifeCycleLink>`_ Node, and it implements 2 ROS interfaces. |
| 17 | +A ROS service server :code:`ros_typedb_interface/query` that is used to query |
| 18 | +the database, which uses the `Query.srv <QuerySrvLink>`_ service type. And the |
| 19 | +ROS topic :code:`ros_typedb_interface/events`, where it publishes insert and |
| 20 | +delete events when data is inserted or deleted from the database with the query |
| 21 | +service. |
| 22 | + |
| 23 | +Class diagram: |
| 24 | + |
| 25 | +.. raw:: html |
| 26 | + |
| 27 | + <embed> |
| 28 | + <p align="center"> |
| 29 | + <img src="https://github.com/Rezenders/ros_typedb/assets/20564040/4cf4f799-3dab-40c4-a323-8d1e8e376e62" width="500"> |
| 30 | + </p> |
| 31 | + </embed> |
| 32 | + |
| 33 | +Overview: |
| 34 | + |
| 35 | +.. raw:: html |
| 36 | + |
| 37 | + <embed> |
| 38 | + <p align="center"> |
| 39 | + <img src="https://github.com/Rezenders/ros_typedb/assets/20564040/53793f23-0cb2-42c8-8c3b-fbfa5764ab5b" width="500"> |
| 40 | + </p> |
| 41 | + </embed> |
| 42 | + |
| 43 | +.. TypeDBInterfaceLink: https://github.com/Rezenders/ros_typedb/blob/main/ros_typedb/ros_typedb/typedb_interface.py |
| 44 | +.. ROSTypeDBInterfaceLink: https://github.com/Rezenders/ros_typedb/blob/main/ros_typedb/ros_typedb/ros_typedb_interface.py |
| 45 | +.. PythonAPILink: https://typedb.com/docs/clients/2.x/python/python-tutorial.html |
| 46 | +.. InsertDatabaseLink: https://github.com/Rezenders/ros_typedb/blob/c16e3f8f1958f4ac2333c7b7d0612c8c79d698a0/ros_typedb/ros_typedb/typedb_interface.py#L153 |
| 47 | +.. MatchDatabaseLink: https://github.com/Rezenders/ros_typedb/blob/c16e3f8f1958f4ac2333c7b7d0612c8c79d698a0/ros_typedb/ros_typedb/typedb_interface.py#L175 |
| 48 | +.. LifeCycleLink: https://design.ros2.org/articles/node_lifecycle.html |
| 49 | +.. QuerySrvLink: https://github.com/Rezenders/ros_typedb/blob/main/ros_typedb_msgs/srv/Query.srv |
0 commit comments