source /opt/ros/humble/setup.bash
node index.js
This agent uses the rclnodejs library combined with the Fiware iotagent-node-lib. The agent creates the following
- Subscriptions and Publishers for ROS Machines
- ROS2 Client
- GPIO Action Client for Legacy CNC Machines
The function "initROSDevice" was created to initialize or create new subscribers or publishers. When the agent starts, it locates the already registered/created devices and initializes the existing ROS2 publishers and subscribers for each device. Additionally the agent handles new registrations/creations of publishers and subscribers when a new device is created.
You can send your commands and be redirected to your ROS2 device with the rclnodejs Client/Server. The server runs on the actual hardware device and the agent handles in the function called "updateContextHandler" the creation of the ROS2 Client and sends the message to the device.
You can send your commands and be redirected to your ROS2 device with the rclnodejs Action Client/Server. The action server runs on the actual hardware device and the agent handles in the function called "updateContextHandler" the creation of the ROS2 Action Client (class called "GPIOActionClient") and sends the message to the device.