In this module, you learn to create an AWS Cloud9 IDE in AWS RoboMaker, download the example source code, and create a simulation bundle that you can use with AWS RoboMaker. The bundle contains the following.

  • The simulation world
  • TurtleBot models
  • The logic used to run your robot
  • All the dependencies the application needs to run

Time to complete module: 25 minutes

Services used: AWS Cloud9, AWS RoboMaker


  • Step 1. Create a development environment

    In this step, you'll create a development environment in the AWS RoboMaker console.


    a. In the AWS RoboMaker console, select “Development environments” in the left panel and choose “Create environment”.

    Create environment

    (Click to enlarge)

    Create environment
    b. Give the environment a name, for example, RoboMaker-ObjectTracker, select “m4.xlarge” as Instance type and choose “Create”. Any instance type can be used, however for this tutorial we recommend using an m4.xlarge instance. You can use the default VPC and subnets for this tutorial. If it’s deleted, you can follow instructions from VPC with Single Public Subnet, then add a secondary public subnet to the VPC.
    Name

    (Click to enlarge)

    Name
    c. Choose “Open environment”. It may take a few minutes for your environment to start the first time.
     
    If this is the first time you're using AWS Cloud9, then you may receive a message stating your account must be verified. This can take two hours. If you're still having trouble after verification, try creating a new environment.
    Open Environment

    (Click to enlarge)

    Open Environment
    d. On the AWS Cloud9 menu bar, select “RoboMaker Resources”, “Download Samples” then “5. Object Following using Reinforcement Learning”.
     
    Menu

    (Click to enlarge)

    Menu
  • Step 2. Set up AWS RoboMaker application workflow

    Workflows are a powerful tool that let you build, bundle, or run an AWS RoboMaker simulation job in AWS Cloud9 through the click of a button.


    a. In the ObjectTracker folder, open the “roboMakerSettings.json” file. This file allows you to create and configure workflow to automate build, bundle and create AWS RoboMaker simulation jobs for the application. Go through the file and replace the following place holders with correct values.
     
    • <IAM Role ARN for RoboMaker>, use the role created in Module 1.
    • <bucket name for your trained model>, use bucket created in Module 1. 
    • <bucket name for your simulation bundle>, use the bucket created in Module 1.
    • <bucket name for job outputs>, use the bucket created in Module 1.
    • <the AWS Region of your S3 model bucket>, use the same Region as the bucket.
    • <security group id>, use default security group or new security group with unrestricted outbound traffic. For example, [ "sg-d89572df3" ].*
    *You can find this by going to AWS Cloud 9 > Environments > RoboMaker-ObjectTracker > "View Details"
    • <subnet id>, use default VPC or a VPC with two public subnet ids. For example, [ "subnet-30c1598", "subnet-30c1fd38"].*
    *You can find subnets by going to the VPC Dashboard > Subnets
    Code

    (Click to enlarge)

    Code

    b. On the AWS Cloud9 menu bar, select “File” and select “Save” to save the changes to “roboMakerSetting.json” file.

    c. To ensure the AWS Cloud9 environment is using the object tracker’s “roboMakerSettings.json” configuration file, go to the AWS Cloud9 menu bar, select “RoboMaker Run”, select “Add or edit configuration”.

    Add or edit

    (Click to enlarge)

    Add or edit

    d. In the dialog, choose “Switch config”.

    Switch config

    (Click to enlarge)

    Switch config

    e. Select the “roboMakerSettings.json” file that you made changes to and choose “Ok”.

    JSON

    (Click to enlarge)

    JSON

    f. Choose "Save".

    Save

    (Click to enlarge)

    Save

    g. On the AWS Cloud9 Menu bar, select “RoboMaker Run”, “Workflow”, then choose “ObjectTracker - Build and Bundle Simulation”. This process builds the ROS workspace, bundle the workspace and its dependencies into the “output.tar.gz” file.

    Run

    (Click to enlarge)

    Run

    h. This process takes about 20 minutes. When the build and bundle process is complete, you see the message “Process exited with code: 0”.

    Step2_StepH

    (Click to enlarge)

    Step2_StepH

    i. The bundle is named “output.tar.gz” and it is located in “simulation_ws\bundle” folder. In the next module you learn how to use this bundle to create a simulation job in AWS RoboMaker.

    Output

    (Click to enlarge)

    Output