Creating a Simulation Job - AWS RoboMaker

Creating a Simulation Job

Create a simulation job when you want to run your robot application in a virtual world using Gazebo or using previously recorded ROS messages stored in ROS bags. You select the software suite name when you specify the simulation application. If you choose Gazebo, your robot application will interact with the objects, terrain, and other physical aspects modelled in the simulation application. If you choose RosbagPlay, your robot application will consume ROS messages published from the ROS bags you provide as data sources.

For more information about configuring your ROS launch file to play back ROS bag messages, see Using ROS Bags for Play Back.

Note

After 90 days, simulation jobs expire and will be deleted. They will no longer be accessible.

Create a Simulation Job using Gazebo

You will create a simulation job using Gazebo when you want to run your robot application in the simulation you created. Once running, you can interact with the simulation. For example, you can use rviz to see images from visual sensors on your robot.

To create a simulation job using Gazebo

Follow the steps under one of the following tabs:

Note

If you are using an existing Amazon S3 bucket or creating a new bucket, it must be located in the same region as AWS RoboMaker.

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 below, it will contain 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 will use 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 a Amazon S3 folder name where simulation job output will be 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. Optional: To connect to your simulation application or robot application remotely, select Enable connectivity to simulation, then specify port mappings for the robot application and simulation application.

    Warning

    You are responsible for configuring a secure remote connection to the simulation job. We recommend you implement a strong authentication method and encryption in transit for the ports you are opening. For more information about remote connectivity, see Connecting to a Simulation Job.

  11. 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.

  12. Choose Next.

  13. 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.

  14. Type a name for the robot application.

  15. Under Sources, specify the Amazon S3 location for the X86_64 robot application source. AWS RoboMaker simulation jobs require an X86_64 source to run the simulation.

    Optionally, if you plan on deploying the robot application to robots in a fleet, you can provide ARMHF and ARM64 robot application source files. You can also update the robot application to include additional source files. For more information, see Updating a Robot Application.

    Using $LATEST doesn’t protect you from changes in Amazon S3. When AWS RoboMaker access the file, it will set to read only. For more informatiom about versioning in AWS RoboMaker, see Application Versioning.

  16. In Robot application configuration, provide the roslaunch Launch package name for your robot application.

  17. Specify the roslaunch Launch file. A launch file contains configuration information about which nodes to start up as well as other initialization parameters for roslaunch.

    To learn more about roslaunch, see roslaunch.

  18. 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 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 will fail 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 will be available in CloudWatch. Output is not sent to CloudWatch by default.

    Custom tools will start only after the main ROS launch process has started. For more information about custom tools, see Configuring Custom Simulation Tools.

  19. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker will configure 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.

  20. 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.

  21. 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.

  22. 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.

    Default upload configurations maintain backwards compatibility with past simulation job output configurations. The default configurations will be added to additional upload configurations you create.

    For more information about custom uploads, see Configuring Custom Uploads.

  23. Choose Next.

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

  25. Type a name for the simulation application.

  26. Select the Simulation software suite and Simulation rendering version used by your simulation application.

  27. Under Sources, specify the Amazon S3 location for the X86_64 simulation application source. AWS RoboMaker simulation jobs require an X86_64 source to run the simulation.

    Using $LATEST doesn’t protect you from changes in Amazon S3. When AWS RoboMaker access the file, it will set to read only. For more informatiom about versioning in AWS RoboMaker, see Application Versioning.

  28. In Simulation application configuration, provide the roslaunch Launch package name and the roslaunch Launch file for your simulation application.

  29. 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 will fail 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 will be available in CloudWatch. Output is not sent to CloudWatch by default.

    Custom tools will start only after the main ROS launch process has started. For more information about custom tools, see Configuring Custom Simulation Tools.

  30. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker will configure 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.

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

  32. Optional: If you want to import a world generated with Simulation WorldForge, select Browse worlds and then select the world you want to import.

    You must configure your simulation application launch file to include the world. For more information about using imported worlds, see Using an imported world in a simulation job.

  33. 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.

  34. 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 configurations will be added to additional upload configurations you create.

    For more information about custom uploads, see Configuring Custom Uploads.

  35. Choose Next.

  36. 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.

  37. Select Create to create the simulation job.

Using the AWS CLI

Here's 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="{packageName=hello_world_robot,launchFile=rotate.launch}" --simulation-applications application=arn:aws:robomaker:us-west-2:111111111111:simulation-application/MySimulationApplication/1551203427605,launchConfig="{packageName=hello_world_simulation,launchFile=empty_world.launch}" --tags Region=North

Create a Simulation Job using ROS bags

You must configure your ROS launch file to play back the ROS bag files you use as data sources. For more information about configuring your ROS launch file to play back ROS bag messages, see Using ROS Bags for Play Back.

To create a simulation job using RosbagPlay

Follow the steps below:

Note

If you are using an existing Amazon S3 bucket or creating a new bucket, it must be located in the same region as AWS RoboMaker.

  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 below, it will contain 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 will use 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 a Amazon S3 folder name where simulation job output will be 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 access resources on an Amazon VPC, select the VPC, subnets and security groups. 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 Tagging Your AWS RoboMaker Resources.

  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 Sources, specify the Amazon S3 location for the X86_64 robot application source. AWS RoboMaker simulation jobs require an X86_64 source to run the simulation.

    Optionally, if you plan on deploying the robot application to robots in a fleet, you can provide ARMHF and ARM64 robot application source files. You can also update the robot application to include additional source files. For more information, see Updating a Robot Application.

    Using $LATEST doesn’t protect you from changes in Amazon S3. When AWS RoboMaker access the file, it will set to read only. For more informatiom about versioning in AWS RoboMaker, see Application Versioning.

  15. In Robot application configuration, provide the roslaunch Launch package name for your robot application.

  16. Specify the roslaunch Launch file. A launch file contains configuration information about which nodes to start up as well as other initialization parameters for roslaunch.

    To learn more about roslaunch, see roslaunch.

  17. 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 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 will fail 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 will be available in CloudWatch. Output is not sent to CloudWatch by default.

    Custom tools will start only after the main ROS launch process has started. For more information about custom tools, see Configuring Custom Simulation Tools.

  18. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker will configure 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.

  19. 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.

  20. 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.

  21. 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.

    Default upload configurations maintain backwards compatibility with past simulation job output configurations. The default configurations will be added to additional upload configurations you create.

    For more information about custom uploads, see Configuring Custom Uploads.

  22. Choose Next.

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

  24. Type a name for the simulation application.

  25. For Software suite name, select RosbagPlay. Melodic will automatically be selected as the Software suite version.

  26. Select the Browse S3, and then specify the path to your simulation application.

    Using $LATEST doesn’t protect you from changes in Amazon S3. When AWS RoboMaker access the file, it will set to read only. For more informatiom about versioning in AWS RoboMaker, see Application Versioning.

  27. In Simulation application configuration, provide the roslaunch Launch package name and the roslaunch Launch file for your simulation application.

  28. Optional: To configure simulation 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 will fail 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 will be available in CloudWatch. Output is not sent to CloudWatch by default.

    Custom tools will start only after the main ROS launch process has started. For more information about custom tools, see Configuring Custom Simulation Tools.

  29. Optional: If your application includes a graphical user interface, select Run with streaming session. AWS RoboMaker will configure 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.

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

  31. In Data source configuration, provide a ROS bag group name, then choose Browse S3 to select ROS bag files. The files should contain ROS messages in the same format used by rosbag record. Choose Add group to add additional groups of data files.

    Note

    You can select up 100 files with a combined size less than 25 GB across all groups. Performance may be impacted as the combined size of the data files increase.

  32. Optional: If you want to import a world generated with Simulation WorldForge, select Browse worlds and then select the world you want to import.

    You must configure your simulation application launch file to include the world. For more information about using imported worlds, see Using an imported world in a simulation job.

  33. 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.

  34. 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 configurations will be added to additional upload configurations you create.

    For more information about custom uploads, see Configuring Custom Uploads.

  35. Choose Next.

  36. Select Create to create the simulation job.