In the first activity, you will get familiar with ROS and learn how to build and bundle an application that you can use in an AWS RoboMaker simulation. Then, you will launch a simulation job with that application. Effectively testing ROS applications through simulations is hard. Robotics developers do not always have access to physical equipment (cost, size etc.) and would not be able to reproduce all of the real-world environments their robots may encounter. You can also do interesting things like train a machine learning model in simulation.
AWS RoboMaker makes it easy to run your ROS application in a cloud-based simulation. When you run an AWS RoboMaker simulation job, you have access to 4 core tools to interact with your running application:
Finally, you have a terminal to run commands in the simulation job. First, let’s setup our development environment
Open a new tab to the AWS RoboMaker console (Services->RoboMaker->right-click->new tab)
Create a development environment (Development->Development environments->Create environment) and complete the following:
workshopor something descriptive
ROS Melodicas the pre-installed ROS distribution.
This opens the environment’s detail page, click Open environment, which will open a new browser tab with the Cloud9 IDE.
This may take a few minutes to complete, but when the creation process has completed, you will see something similar to this:
The Welcome page provides helpful information to get started, but for now we are not going to use it, so click the X on the tab to close. Take a look at the
roboMakerSettings.json file. This contains the configurations (such as which S3 buckets and IAM roles) to use with AWS RoboMaker. The IDE is broken down into four sections:
roboMakerSettings.jsonis modified later in this task.
The first step is to open the AWS RoboMaker IDE and clone the AWS-enabled JetBot ROS application.
Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation/
In CloudFormation console and write down the CloudFormation name that looks similar to mod-xxxxxxx36e49dc. You will need this to run an automation script later to set up RoboMaker IDE enviornment.
Open the RoboMaker IDE and navigate to the terminal and clone this Git repo to the development machine:
# change to the environment directory $ cd ~/environment $ git clone https://github.com/codingphun/aws_robomaker_jetbot_reinvent_workshop.git jetbot
jetbot/assetsdirectory and run the install script.
# Run install_dep.sh to install prerequisite $ cd ~/environment/jetbot/assets/scripts $ chmod +x compile_arm64.sh install_deps.sh configure_docker.sh $ sudo ./install_deps.sh <your CloudFormation name>
In RoboMaker IDE menu, click Run, Workflow, select JetBot Simulation - Build and Bundle (this process takes about 10 minutes). As the name suggests, it will compile/build the ROS application and bundle it into a tar file for simulation.
colcon bundle) that the IDE will run when you use the dropdown menus. A preconfigured workflow is included with the sample application in the roboMakerSettings.json file.
Make sure the Colcon Bundle tab displays “Process exited with code: 0”. This indicates the build and bundle process has completed.
Click Run, Launch Simulation, JetBot Circle Simulation. This will launch the application in simulation enviornment with the Jetbot rotating in circles.
When simulation status displays (running), explore the enviornment in Gazebo by clicking on the Simulation menu, Applications, Gazebo. Use your mouse scroll wheel to zoom in and out of the enviornment. This simple application demonstrates that you have all the components configured and installed correctly. Now you can move on to the next simulation, teleop, which allows you to remote control the JetBot.
Stop the simulation from Simulation (Running) menu
In RoboMaker IDE menu, click Run, Launch Simulation, JetBot Teleop Simulation - This will launch the application in simulation enviornment where you can drive the Jetbot with the teleop client app. When simulation status displays (running), explore the enviornment in Gazebo by clicking on the Simulation menu, Applications, Gazebo. Use your mouse scroll wheel to zoom in and out of the enviornment. Be sure to continue with the following steps to download the joy stick client application to remote control the JetBot.
Locate the teleop.zip file in jetbot/assets/teleop folder
Note for those running in their own AWS accounts and are not using a workshop code:
In this activity, you created a some resources (Development environment, CloudWatch logs, and S3 objects) that incure cost. If you are not continuing on with the next sections of the workshop, remember to go to the clean-up steps and remove these resources to stop any potential costs for occurring.