Skip to content

qual_cloudsim

Nate Koenig edited this page Apr 9, 2020 · 2 revisions

Overview

This tutorial describes how to submit a Docker image to the Portal for the Tunnel Qualification (Virtual STIX) and Tunnel Circuit.

Docker images are required, and teams will be provided a private Docker repository. Alternatively, a team is more than welcome to use other Docker repositories, such as Dockerhub.

Instructions

  1. Make sure you have registered on the Portal.

  2. Create and test your Docker image. This docker image should contain your solution. There are numerous resources online that describe how to install, setup, and use Docker. If you want a good starting point, please look at this tutorial.

  3. Upload your Docker image to a repository. The following instructions assume you are using the provided AWS ERC based repository.

    Make sure you have installed the AWS CLI tool, and configured it with your team's credentials. These credentials will be provided to you. If you don't have credentials, then please contact us at nate@osrfoundation.org.

    Use the provided subt_docker.bash script to tag and upload your docker image. Usage of this script is

     $ ./install/share/subt_ign/scripts/subt_docker.bash <team_name> <local_docker_image> <local_tag> <upstream_tag>
    
     team_name: This is the name of your team. This is also the name of your Docker repository.
    
     local_tag: This is the tag associated with your docker image. A common tag is 'latest'.
    
     upstream_tag: This is the tag you want associated with your image when uploaded to the repository. This will let you version your docker images.
    

    For example, if your team name is foo, you have a docker image called solution_bar:latest, and you want to version this image with the name virtual_stix:

    subt_docker.bash foo solution_bar latest virtual_stix
    

    This script will log you into docker, tag your image, and push the image to your repository. The final output of the script is the URL of your Docker image. Use this URL when "Uploading a Simulation" on the Portal.

  4. Log into the Portal.

  5. Click on the "Upload a Simulation" button.

  6. Give your submission a name. This name is just for bookkeeping, and must contain only alpha-numeric characters.

  7. Choose the event for your submission using the dropdown box.

  8. Add robots to your team.

    1. Each robot must have a unique name. The name must have only alpha-numeric characters.

    2. Specify the URL of your Docker image for the robot. This can the URL provided from the subt_docker.bash script, or from another source such as DockerHub.

    3. Choose the robot type from the dropdown box.

    4. Click the Add button, and continue adding more robots until you have built your entire team.

  9. Click Submit

  10. You should now see a new entry in the "Simulations" card. This entry will receive status updates as the simulation instance runs.

  11. Once the simulation instance completes, download the log files using the download button located at the far right of the simulation entry.

  12. Review these log files. If you like the results, then upload these log files using the "Upload a log file" button.

Troubleshooting

  1. The cloudsim bridge instance runs the ROS_MASTER, refer to the cloudsim architecture. While you can create a multi-master setup, chances are you should not run your own ROS master.

  2. The /subt/start and /subt/finish ROS service calls are optional, refer to the API documentation.

  3. Use the docker compose guide to re-create the cloudsim setup on your local computer.

  4. Your docker images must run forever (not exit).

  5. Gazebo state information and server console messages are logged on the Ignition Gazebo instance. ROS console messages are captured in the Bridge Container on each Robot instance. Additionally, a rosbag of the /rosout_agg topic is captured in the Bridge Container in a file called rosout_agg.bag. All of these log files are available for download following a successful simulation run.

Helper Scripts

If you are using the provided Docker repository, then you can make use of the following scripts.

List available images

To list all the images that you have uploaded to your repository:

$ ./install/share/subt_ign/scripts/subt_docker_list.bash <team_name>

Pay attention to the imageTag field, which should be used when submitting a cloud simulation solution. Use the subt_docker_uri.bash script to convert an imageTag to a full URI.

Construct Image URI

To convert an image tag to a full URI, which can be used when submitting a cloud simulation solution:

$ ./install/share/subt_ign/scripts/subt_docker_list.bash <team_name> <image_tag>

The <image_tag> can be acquired from the subt_docker_list.bash script.