Managing a simulation - AWS RoboMaker

Managing a simulation

The following sections describe how to create, view, cancel, clone, and restart simulation jobs.

Creating a simulation job

Create a simulation job when you want to run your robot application in a virtual world using any simulation platform. You select the software suite name when you specify the simulation application. We currently support General and SimulationRuntime software suites.

To create a simulation job

Follow the steps under one of the following tabs:

Using the console
  1. Sign in to the AWS RoboMaker console at https://console.aws.amazon.com/robomaker/.

  2. In the left navigation pane, choose Simulation run, and then choose Simulation jobs.

  3. Choose Create simulation job.

  4. On the Simulation configuration page, select a simulation job duration. Select any value between 5 minutes and 14 days.

    Important

    To learn more about how you are charged for AWS RoboMaker see AWS RoboMaker Pricing.

  5. Select a Failure behavior. Choose Fail to terminate the host instance if the simulation job fails. Choose Continue to keep the host instance so you can connect and investigate.

    If you specify an optional S3 folder in a following step, it contains simulation data. It is available independent of the selected failure behavior.

  6. For IAM Role, select a role or select Create new role to create one. AWS RoboMaker uses this role to access resources on your behalf. It is also used by your application to access AWS resources like Amazon Rekognition or Amazon Lex.

  7. Optional: In Compute, select a simulation unit limit. Your simulation is allocated CPU and memory proportional to the supplied simulation unit limit. A simulation unit is 1 vcpu and 2GB of memory. The default is 15.

  8. Optional: In Output destination, type in an Amazon S3 folder name where simulation job output is stored. Optionally, select Create new S3 folder to create a new Amazon S3 folder.

  9. Optional: In Networking, if your robot application or simulation application accesses resources on an Amazon VPC, select the VPC, subnets and security groups. Select all available subnets to ensure all of your resource limits are available. For more information, see VPCs and Subnets.

    If you want to access the simulation job from outside of the VPC, select Assign public IP.

  10. Optionally, under Tags, specify one or more tags for the simulation job. Tags are words or phrases that act as metadata for identifying and organizing your AWS resources. Each tag consists of a key and a value. You can manage tags for your simulation job on the Simulation Job details page.

    For more about tagging, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

  11. Choose Next.

  12. On the Specify robot application page, under Robot application, select Create new application. Optionally, you can select Choose existing application to use a robot application that you have already created.

  13. Type a name for the robot application.

  14. Under Container image, specify the Amazon ECR repository location for the robot application container. For more information, see Requirements for AWS RoboMaker compatible containers.

    Note

    Using $LATEST doesn't protect you from changes in Amazon ECR. When AWS RoboMaker accesses the repository, it sets it to read-only.

    For more information about versioning, see Versioning applications.

  15. In Robot application configuration, provide the Launch Command for your robot application.

  16. Optional: To configure robot application tools, expand Robot application tools. Select Use default tools to use preconfigured tools. Select Customize tools to add, remove, or edit custom tools to use with the application.

    To add a new custom tool:

    1. Select Add tool.

    2. On the Add application tool, specify a Tool name.

    3. Specify the command-line arguments for the tool. You must include the tool executable name.

    4. Choose an Exit behavior. If you select Fail, the simulation job fails if the tool exits. Select Restart to restart the tool. The default is Restart.

    5. Choose to enable or disable UI streaming. UI streaming is disabled by default.

    6. Select Send output to CloudWatch to record logs for the tool. The logs are available in CloudWatch. Output is not sent to CloudWatch by default. Custom tools start only after the main ROS launch process has started.

  17. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker configures a connection so you can interact with your application as it is running in the simulation. You can connect by selecting Robot Application under Simulation tools on the simulation job detail page.

  18. Optional: If your robot application uses environment variables, specify the Name and Value pairs. Environment variable names must start with A-Z or underscore and consist of A-Z, 0-9 and underscore. Names beginning with AWS are reserved.

    Select Add environment variable to add additional variables.

    You can read environment variables in a launch file using roslaunch substituion args.

  19. Optional: Configure traffic forwarding from the simulation job port to the application port. Simulation job networking must be configured in order to specify port mapping for your robot and simulation applications.

  20. Optional: Specify one or more Robot application upload configurations. A simulation job output destination must be configured in order to specify upload configurations. Each configuration specifies an upload behavior, a Unix glob file matching rule, and a location to place matching files. For more information about custom uploads, see Adding a custom upload configuration.

  21. Choose Next.

  22. On the Specify simulation application page, select Create new application. Optionally, you can select Choose existing application to use a simulation application that you have already created.

  23. Type a name for the simulation application.

  24. Under Container image, specify the Amazon ECR repository location for the robot application container. For more information. see . Using $LATEST doesn't protect you from changes in Amazon ECR. When AWS RoboMaker accesses the repository, it sets the repository to read-only.

    For more information about versioning, see Versioning applications.

  25. In Simulation application configuration, provide the Launch Command for your robot application.

  26. Optional: To configure robot application tools, expand Simulation application tools. Select Use default tools to use preconfigured tools. Select Customize tools to add, remove, or edit custom tools to use with application.

    To add a new custom tool:

    1. Select Add tool.

    2. On the Add application tool, specify a Tool name.

    3. Specify the command-line arguments for the tool. You must include the tool executable name.

    4. Choose an Exit behavior. If you select Fail, the simulation job fails if the tool exits. Select Restart to restart the tool. The default is Restart.

    5. Choose to enable or disable UI streaming. UI streaming is disabled by default.

    6. Select Send output to CloudWatch to record logs for the tool. The logs are available in CloudWatch. Output is not sent to CloudWatch by default.

    Custom tools start only after the main launch process has started.

  27. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker configures a connection so you can interact with your application as it is running in the simulation. You can connect by selecting Simulation Application under Simulation tools on the simulation job detail page.

  28. Optional: If your simulation application uses environment variables, specify the Name and Value pairs. Select Add environment variable to add additional variables.

  29. Optional: Configure traffic forwarding from the simulation job port to the application port. Simulation job networking must be configured in order to specify port mapping for your robot and simulation applications.

  30. Optional: Specify one or more Simulation application upload configurations. A simulation job output destination must be configured in order to specify upload configurations. Each configuration specifies an upload behavior, a Unix glob file matching rule, and a location to place matching files.

    Default upload configurations maintain backwards compatibility with past simulation job output configurations. The default configuration is added to additional upload configurations you create. For more information about custom uploads, see Adding a custom upload configuration.

  31. Choose Next.

  32. Select Create to create the simulation job.

Using the AWS CLI

The following is an example AWS CLI command that performs the equivalent of the console-based simulation job creation on the other tab.

aws robomaker create-simulation-job --max-job-duration-in-seconds 3600 --iam-role arn:aws:iam::111111111111:role/MyRole --robot-applications application=arn:aws:robomaker:us-west-2:111111111111:robot-application/MyRobotApplication/1551203485821,launchConfig="{command=["roslaunch", "hello_world_robot", "rotate.launch"]}" --simulation-applications application=arn:aws:robomaker:us-west-2:111111111111:simulation-application/MySimulationApplication/1551203427605,launchConfig="{command=["roslaunch", "hello_world_simulation", "empty_world.launch"]}" --tags Region=North

Viewing a simulation job

You can view information about a simulation job and, if the job is running, launch graphical tools and a terminal to interact with the simulation. You can also view details about the simulation job and manage tags.

To view a simulation job

Follow the steps under one of the following tabs:

Using the console
  1. Sign in to the AWS RoboMaker console at https://console.aws.amazon.com/robomaker/.

  2. In the left navigation pane, choose Simulations, then choose Simulation jobs.

  3. Select the Id of a simulation job to view its details including the time it was created and launch commands for the robot application and simulation application.

Using the AWS CLI

Following is an example AWS CLI command that performs the equivalent of the console-based view simulation job on the other tab.

aws robomaker list-simulation-jobs aws robomaker describe-simulation-job --job my-simulation-job-arn

Cancelling a simulation job

A simulation job can be cancelled if it is running and no longer needed.

To cancel a simulation job

Follow the steps under one of the following tabs:

Using the console
  1. Sign in to the AWS RoboMaker console at https://console.aws.amazon.com/robomaker/.

  2. In the left navigation pane, choose Simulations, then choose Simulation jobs.

  3. Select the Id of the simulation job you want to cancel.

  4. In the Simulation job detail page, under Actions, choose Cancel.

  5. In the Cancel simulation job page, select Yes, cancel.

Using the AWS CLI

Here's an example AWS CLI command that performs the equivalent of the console-based cancel simulation job on the other tab.

aws robomaker list-simulation-jobs aws robomaker cancel-simulation-job --job my-simulation-job-arn

For information about cancelling from within a simulation job, see the ROS container FAQs.

Cloning a simulation job

You can create a new simulation job from an existing simulation job by cloning it from the Simulation job detail page on the AWS Management Console.

Note

Simulation jobs with ROS and Gazebo software suite are not available for cloning. For more information, see Support policy.

  1. Sign in to the AWS RoboMaker console at https://console.aws.amazon.com/robomaker/.

  2. In the left navigation pane, choose Simulations, then choose Simulation jobs.

  3. Select the Id of a running simulation job you would like to restart.

  4. In the Simulation job detail page, under Actions, choose Clone.

  5. In the Review and create simulation job, select Edit to make changes.

  6. Select Create to create the simulation job.

Restarting a simulation job

Running simulation jobs can be restarted. When restarted, the simulation job uses the robot application and simulation application source files in the Amazon S3 location and all other configuration settings specified when the simulation job was created.

To restart a simulation job

Follow the steps under one of the following tabs:

Using the console
  1. Sign in to the AWS RoboMaker console at https://console.aws.amazon.com/robomaker/.

  2. In the left navigation pane, choose Simulations, then choose Simulation jobs.

  3. Select the Id of a running simulation job you would like to restart.

  4. In the Simulation job detail page, under Actions, choose Restart.

  5. In the Restart simulation job page, select Yes, restart.

Using the AWS CLI

The following is an example AWS CLI command that performs the equivalent of the console-based restart simulation job on the other tab. The simulation job must be running.

aws robomaker restart-simulation-job --job my-simulation-job-arn