Swarmathon Team Code for the NASA Space Challenge 2 Competition
NVidia Graphics Card
- 2.6 Ghz I-7 Processor
- 8 Gb Ram (more is better)
- Operating System: Ubuntu 18.04
- Docker Nvidia Support (see below for specific instructions) Docker General Instructions
- Robot Operating System ROS
- Getting Started with ROS in C Guide
Setup Ubuntu 18.04 as the operating system. It is not recommended to install within a virtual machine.
sudo apt-get update
sudo apt-get upgrade
- Left click Activities in the upper left from the desktop
- Search for Software & Updates and select the file
- Left click the Additional Drivers Tab, it will take a moment to search for the drivers
- Select the option for the Nvidia driver metapackage (proprietary, tested)
- Apply Changes
- Note, if you are experiences Ubuntu locking up, do this first.
If installing docker for the first time (if not, you made need to upgrade or remove and install, see general docker instructions above).
Make sure the Team Leader has added you to the Docker Hub
sudo apt install docker.io
Install Curl
sudo apt install curl
Add repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
Install Nvidia Docker support packages
sudo apt update
sudo apt install nvidia-container-toolkit
Restart Docker daemon with Nvidia support
sudo systemctl restart docker
sudo usermod -aG docker ${USER}
- If you are asked for a password here, this is your sudo password
- Open a new terminal window and type
docker login -u swarmathon
- Use the SC2 swarmathon team password
We will use ssh keys to access the gitlab submodule. Follow these instructions: https://docs.gitlab.com/ee/ssh/
git clone [email protected]:BCLab-UNM/SC2.git #ssh
#or
git clone https://github.com/BCLab-UNM/SC2.git #https
cd SC2 # enter the repo directory
git submodule update --init --recursive #After cloning this repository you need to initialize and update the submodule(s)
- In terminal move to the srcp2-competitors folder (default command below, if you put it somewhere else, go there)
cd srcp2-competitors
- Download and simulation
./docker/scripts/launch/roslaunch_docker --run-round 1
- Download may take a while, to watch, start a new terminal window and type
tail -f /tmp/srcp2/simulation/docker.log
- When completed a Gazebo window will open with base and robots loaded.
- Press the single arrow on the bottom of the Gazebo screen (most left arrow) to start running
Make sure ROS (Melodic) is installed, if not see Software Requirements, ROS section
Note: There are a lot of topics
ROS_MASTER_URI=http://localhost:11311
source ./docker/scripts/srcp2_setup.bash
rostopic list
We can access it in an ipython frame with a eval rollback to controll the rover
pull, clean, build source, then run the launch file this will start up the fakeOdom and Driver service
git pull #just do this out of habit
source ./srcp2-competitors/ros_workspace/install/setup.bash #build will fail if you don't
catkin clean -y
catkin build
source ./devel/setup.bash
roslaunch ./launch/scoot.launch "name:=small_scout_1"
source ./devel/setup.bash
rosrun scoot Scoot.py __ns:=small_scout_1
scoot.turn(math.pi/4)
scoot.drive(1)
roslaunch ./launch/scoot.launch "name:=small_scout_1" "search:=searchRandomWalk"
or
roslaunch ./launch/scoot.launch "name:=small_scout_1" "search:=DDSA"
To build a submission docker image run the buildSubmission.sh
script in the docker directory.
This script will build the swarmathon:submission docker image using this project and build the srcp2 submission using the supplied build-submission-image.bash
script.
To test the submission docker image, run the testSubmission.sh
script with a running srcp2 gazebo simulation.