This ros package acts as a bridge between FIWARE and ROS through MQTT.
This ROS node receives a command from FIWARE orion context broker through MQTT.
When receiving a command, this node publish a ROS message to a ROS topic.
This ROS node subscribes a ROS topic.
When receiving a ROS message from the topic, this node publishes the received messae to FIWARE orion context broker through MQTT.
ROS kinetic
$ cd ~/ros_ws/src
$ git clone https://github.com/RoboticBase/fiware_ros_bridge.git
$ pip install -r fiware_ros_bridge/requirements/common.txt
If your MQTT Broker has TLS encryption, you have to set the root certification file.
$ scp /path/to/your/cert_file.crt ${user}@${robot}:${ROS_WS}/src/fiware_ros_bridge/secrets/ca.crt
$ cp src/fiware_ros_bridge/config/mqtt.yaml.template src/fiware_ros_bridge/config/mqtt.yaml
$ vi src/fiware_ros_bridge/config/mqtt.yaml
$ cp src/fiware_ros_bridge/config/robot_attrs.yaml.template src/fiware_ros_bridge/config/robot_attrs.yaml
$ vi src/fiware_ros_bridge/config/robot_attrs.yaml
$ cp src/fiware_ros_bridge/config/robot_cmd.yaml.template src/fiware_ros_bridge/config/robot_cmd.yaml
$ vi src/fiware_ros_bridge/config/robot_cmd.yaml
$ roslaunch fiware_ros_bridge fiware_ros_bridge.launch
Confirm that the log messages like below are shown.
[INFO] [1531975302.196302]: [fiware_ros_bridge.base:CmdBridge._on_connect] connected to mqtt broker, status=0
[INFO] [1531975302.204255]: [fiware_ros_bridge.base:AttrsBridge._on_connect] connected to mqtt broker, status=0
If status
is not 0, mqtt.yaml and/or ca.crt is invalid.
Copyright (c) 2018 TIS Inc.