Coder Social home page Coder Social logo

utabi / aws-iot-bridge-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-robotics/aws-iot-bridge-example

0.0 0.0 0.0 28 KB

Examples and information about integrating ROS with AWS IoT using the mqtt_bridge package.

License: Apache License 2.0

CMake 100.00%

aws-iot-bridge-example's Introduction

AWS Iot Bridge Example

Overview

The aws_iot_mqtt_bridge package contains configuration and launch files to integrate a robot running ROS with AWS IoT by using the mqtt_bridge package. The mqtt_bridge acts a bridge between ROS systems and servers running the MQTT protocol. For more information please visit the mqtt_bridge repository.

AWS IoT Core Summary: AWS IoT provides secure, bi-directional communication between Internet-connected devices such as sensors, actuators, embedded micro-controllers, or smart appliances and the AWS Cloud. This enables you to collect telemetry data from multiple devices, and store and analyze the data. You can also create applications that enable your users to control these devices from their phones or tablets.

Features in Active Development:

  • Use the built-in X.509 certificate as the unique device identity to authenticate AWS requests using the ROS AWS cloud service integrations, for more information, please visit authorizating direct AWS calls

Keywords: ROS IoT Core, mqtt, ROS bridge, mqtt_bridge

License

The source code is released under an Apache 2.0.

Author: AWS RoboMaker
Affiliation: Amazon Web Services (AWS)
Maintainer: AWS RoboMaker, [email protected]

Supported ROS Distributions

  • Kinetic

Installation

IoT Device Certificate

You will need to create an AWS Account and configure the credentials to be able to communicate with AWS services. You may find [AWS Configuration and Credential Files] helpful. In addition to AWS credentials to communicate with AWS IoT, you will need to generate an X.509 certificate in order to identify your robot to AWS IoT Core. For more information, please visit managing device certificates.

Building from Source

To build from source you'll need to create a new workspace, clone and checkout the latest release branch of this repository, install all the dependencies, and compile. If you need the latest development features you can clone from the master branch instead of the latest release branch. While we guarantee the release branches are stable, the master should be considered to have an unstable build due to ongoing development.

  • Create a ROS workspace and a source directory

      mkdir -p ~/ros-workspace/src
    
  • Clone the package into the source directory .

Note: Replace {MAJOR.VERSION} below with the latest major version number to get the latest release branch.

    cd ~/ros-workspace/src
    git clone https://github.com/aws-robotics/aws-iot-bridge-example.git -b release-v{MAJOR.VERSION}
  • Install dependencies

      cd ~/ros-workspace 
      sudo apt-get update && rosdep update
      rosdep install --from-paths src --ignore-src -r -y
    

Note: If building the master branch instead of a release branch you may need to also checkout and build the master branches of the packages this package depends on.

  • Build the packages

      cd ~/ros-workspace && colcon build
    
  • Configure ROS library Path

      source ~/ros-workspace/install/setup.bash
    

Launch Files

An example launch file called aws_iot_bridge.launch is provided, however the launch file cannot work without proper configuration. Since AWS IoT uses unique endpoints and certificates for each account and device, you must first discover your AWS IoT endpoint and generate a certificate before you can connect.

Usage

Run the node

  • With launch file using parameters in .yaml format (need to be configured first)

    • ROS: roslaunch aws_iot_mqtt_bridge aws_iot_bridge.launch bridge_params:=<path>/config/example_aws_iot_params.yaml
  • Without launch file using default values

    • ROS: rosrun mqtt_bridge mqtt_bridge_node.py

Verify topics are publishing

  • Go to your AWS account
  • Find AWS IoT Core
  • On the upper right corner, change region to Oregon if you launched the node using the launch file, or change to N. Virginia if you launched the node without using the launch file
  • Select Test from the menu on the left side of the screen
  • Type the name of one of the configured topics and click Subscribe to topic
  • You should see messages begin appearing in the bottom half of the screen

Configuration File and Parameters

An example configuration file called example_aws_iot_params.yaml is provided. When the parameters are absent in the ROS parameter server, the mqtt_bridge will use defaults, please refer to the mqtt_bridge package.

Parameter Name Description Type Allowed Values
tls/ca_certs Path to the Root CA obtained from the AWS site std::string Path to valid root CA file
tls/certfile Path to the device certificate std::string Path to valid certificate file in PEM format
tls/keyfile Path to the device private key std::string Path to valid private key in PEM format
tls/tls_version Protocol version to use when connecting to AWS TLS endpoint (5 is TLS1.2) int A valid python TLS protocol
tls/tls_insecure Indicator if certificates validation should be disabled, defaults to false bool bool
connection/host Host name of the AWS endpoint to connect std::string A valid DNS name or IP address
connection/port Port to use when connecting to AWS IoT core (default is 8883) int A valid port number (1-65535)
connection/keepalive TCP connection keep-alive int Number of seconds greater than zero
client/protocol MQTT protocol to use when connecting (default is MQTT311 or 4) int Valid protocol number

Node

mqtt_bridge

Bridges topics between ROS systems and an MQTT server

Subscribed Topics

None by default - mqtt_bridge must be configured to bridge topics to IoT

Published Topics

None by default - mqtt_bridge must be configured to bridge topics to IoT

Services

None

Bugs & Feature Requests

Please contact the team directly if you would like to request a feature.

Please report bugs in Issue Tracker.

aws-iot-bridge-example's People

Contributors

coleray avatar hyandell avatar mm318 avatar nburek avatar ryanewel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.