new readme created

winterhalderp 2 years ago
parent 2707bc0b42
commit 7d0e7f1786

@ -59,3 +59,7 @@ In order for your code to work and to prevent major problems please read through
## Presentation
The workshop's content is covered in [this presentation](
## Further Documentation:
* `pubsub/pubsub/` [](None): Information on the example files and libraries to create communication interfaces between ROS nodes.
* `custom_interface/` [](None): Instructions on how to create additional custom interfaces using this pre-made ROS package.

@ -0,0 +1,33 @@
# Readme /pubsub
This directory represents a ROS package due to its internal structure and files. The files inside `pubsub/pubsub/` are the Python scripts written by the package developer and can be called using the command line `ros2 run pubsub <entry_point_name>`. The `<entry_point_name>` has to be defined in _setup.py_.
## Files
This section describes the content and purpose of the files inside this directory.
`ros2 run` callable files:
* *topic\* : Example for creating a `MinimumPublisher` and sending topics
* *topic\* : Example for creating a `MinimumSubscriber` and receiving topics
* *service\* : Example for creataing a `MinimumServiceProvider` and hosting a service
* *service\* : Example for creating a `MinimumServiceClient` and calling a service
* *statemachine\_host\* : Example application of State Machine (SM) hosting a service to call for a change of state
* *statemachine\_client\* : Example application of a service client calling for the change of SM state
Library files:
* \[*pubsub\_library* ; *pubsub\_library\_v2*\] : old versions
* *pubsub\_library\_v3* : Library containing
* `MinimalPublisher` class
* `MinimalSubscriber` class
* `MinimalServiceProvider` class
* `MinimalServiceClient` class
## How to use
You can use the `Minimal<X>` classes in three ways:
* Create `Minimal<X>` in your script (eg. [](None) where data is echanged between the script environment and the class environment)
* Implement `Minimal<X>` inside your device class the same way as implementing in your main script (__<-- ToDo !!!__)
* Build device class upon `Minimal<X>` class (eg. [](None) where a device class is built upon the `MinimalServiceProvider` class) by implementing this structure
class Child_Class(Parent_Class):
For example:
class StateMachineCMDServiceProvider(MinimalServiceProvider):

@ -1,14 +1,14 @@
import rclpy
from rclpy.node import Node
import pubsub.pubsub_library_v3 as lib
from pubsub.pubsub_library_v3 import MinimalServiceProvider
# Service Type Files
from custom_interfaces.srv import StateMachineSrv
class StateMachineCMDServiceProvider(lib.MinimalServiceProvider):
# Device Class
class StateMachineCMDServiceProvider(MinimalServiceProvider):
def __init__(self, NODE_NAME, SRV_NAME, SRV_TYPE):