Skip to content
Use AWS RoboMaker and demonstrate monitoring robot health and operational metrics with AWS CloudWatch.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Creating initial file from template Nov 17, 2018
docs/images Initial release of AWS RoboMaker Robot Monitoring sample application Nov 26, 2018
robot_ws
scripts Add Makefile Dec 11, 2018
simulation_ws update turtlebot3 dependency (#25) Jun 20, 2019
.gitignore Use separate repository for the simulation world Bookstore Mar 15, 2019
.travis.yml
CODE_OF_CONDUCT.md Creating initial file from template Nov 17, 2018
CONTRIBUTING.md
LICENSE
Makefile Add Makefile Dec 11, 2018
NOTICE.txt Initial release of AWS RoboMaker Robot Monitoring sample application Nov 26, 2018
README.md Update README.md Apr 4, 2019
github_deploy.pem.enc
roboMakerSettings.json Update roboMakerSettings.json Apr 4, 2019

README.md

AWS RoboMaker Sample Application - CloudWatch Monitoring

Monitor health and operational metrics for a fleet of robots in a simulated home using AWS CloudWatch Metrics and AWS CloudWatch Logs. Streamed metrics include speed, distance to nearest obstacle, distance to current goal, robot CPU utilization, and RAM usage.

It demonstrates how to emit metrics and logs to AWS CloudWatch to monitor your robots.

RoboMaker sample applications include third-party software licensed under open-source licenses and is provided for demonstration purposes only. Incorporation or use of RoboMaker sample applications in connection with your production workloads or a commercial products or devices may affect your legal rights or obligations under the applicable open-source licenses. Source code information can be found here.

Requirements

  • ROS Kinetic - Other versions may work, however they have not been tested
  • Colcon - Used for building and bundling the application.

AWS Setup

AWS Credentials

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.

AWS Permissions

To run this application you will need an IAM user with the following permissions:

   logs:PutLogEvents
   logs:DescribeLogStreams 
   logs:CreateLogStream 
   logs:CreateLogGroup

You can find instructions for creating a new IAM Policy here. In the JSON tab paste the following policy document:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CloudWatchRobotRole",
      "Effect": "Allow",
      "Action": [
        "cloudwatch:PutMetricData",
        "logs:PutLogEvents",
        "logs:DescribeLogStreams",
        "logs:CreateLogStream",
        "logs:CreateLogGroup"
      ],
      "Resource": "*"
    }
  ]
}

Build

Pre-build commands

sudo apt-get update
rosdep update

Robot

sudo apt-get update
rosdep update
cd robot_ws
rosws update
rosdep install --from-paths src --ignore-src -r -y
colcon build

Simulation

cd simulation_ws
rosws update
rosdep install --from-paths src --ignore-src -r -y
colcon build

Run

The TURTLEBOT3_MODEL environment variable must be set when running the simulation application (not needed for robot application). Valid values are burger, waffle, and waffle_pi.

Launch the application with the following commands:

  • Running Robot Application on a Robot

    source robot_ws/install/local_setup.sh
    roslaunch cloudwatch_robot deploy_rotate.launch
  • Running Robot Application Elsewhere

    source robot_ws/install/local_setup.sh
    roslaunch cloudwatch_robot [command]

    There are two robot launch commands:

    • rotate.launch - The robot starts rotating
    • await_commands.launch - The robot is idle waiting movement commands, use this for teleop and navigation
  • Running Simulation Application

    export TURTLEBOT3_MODEL=waffle_pi
    source simulation_ws/install/local_setup.sh
    roslaunch cloudwatch_simulation [command]

    There are three simulation launch commands for three different worlds:

    • empty_world.launch - Empty world with some balls surrounding the turtlebot at (0,0)
    • bookstore_turtlebot_navigation.launch - A retail space where the robot navigates to random goals

CloudWatchMetrics01.png

Monitoring with CloudWatch Logs

Robot logs from ROS nodes are streamed into CloudWatch Logs to Log Group robomaker_cloudwatch_monitoring_example. See cloudwatch_robot/config/cloudwatch_logs_config.yaml.

Monitoring with CloudWatch Metrics

Robot metrics from ROS nodes are reported into CloudWatch Metrics robomaker_cloudwatch_monitoring_example. Metric resolution is configured at 10 seconds. See cloudwatch_robot/config/cloudwatch_metrics_config.yaml.

Operational metrics include:

  • linear speed
  • angular speed
  • distance to nearest obstacle (closest lidar scan return)
  • distance to planned goal (bookstore only, requires its navigation system)

Health metrics include CPU and RAM usage.

CloudWatchMetrics01.png

Using this sample with RoboMaker

You first need to install colcon-ros-bundle. Python 3.5 or above is required.

pip3 install colcon-ros-bundle

After colcon-ros-bundle is installed you need to build your robot or simulation, then you can bundle with:

# Bundling Robot Application
cd robot_ws
source install/local_setup.sh
colcon bundle

# Bundling Simulation Application
cd simulation_ws
source install/local_setup.sh
colcon bundle

This produces the artifacts robot_ws/bundle/output.tar and simulation_ws/bundle/output.tar respectively.

You'll need to upload these to an s3 bucket, then you can use these files to create a robot application,
create a simulation application, and create a simulation job in RoboMaker.

AWS ROS Packages used by this Sample

  • RoboMakerUtils-Common
  • RoboMakerUtils-ROS1
  • CloudWatch-Common
  • CloudWatchLogs-ROS1
  • CloudWatchMetrics-ROS1
  • HealthMetricsCollector-ROS1
  • MonitoringMessages-ROS1

License

MIT-0 - See LICENSE.txt for further information

How to Contribute

Create issues and pull requests against this Repository on Github

You can’t perform that action at this time.