5.2.1.1. node_action_server_ros_iot_bridge¶
This node is responsible for running an Action Server which serves as a bridge between Ros and IoT.
Any task like getting data from a MQTT topic to pushing data on spreadsheets is achieved by this Action Server. All the necessary parameters are first loaded from the parameter server. Then whenever a client sends a goal to this Action Server, a new thread is started to process the goal asynchronously. New thread is an essential requirement to process multiple goals at once.
-
class
node_action_server_ros_iot_bridge.
RosIotBridgeActionServer
[source]¶ Initialize the Action Server and load all necessary parameters from the parameter server.
This class can subscribe and publish to any MQTT topic. If a MQTT topic is subscribed, then any data published in that topic is published to another ROS topic “/ros_iot_bridge/mqtt/sub” so that other ROS nodes can access that data for their use. It can also get and post using HTTP protocol to update google spreadsheets.
-
mqtt_sub_callback
(_client, _userdata, message)[source]¶ This function is called whenever something is published to the subscribed MQTT topic and publish the same data to a ROS topic so that other ROS nodes can access it
Parameters: - _client – Client
- _userdata – User Data
- message (msgMqttSub) – Message published on the MQTT topic
Returns: None
-
on_cancel
(goal_handle)[source]¶ This function will be called when Goal Cancel request is send to the Action Server.
Parameters: goal_handle – Unique ID of the goal Returns: None
-