Skip to content

Commit

Permalink
Revert to v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinker Twins committed Jun 20, 2022
1 parent e1bc10d commit 0804412
Show file tree
Hide file tree
Showing 170 changed files with 1,506 additions and 4,326 deletions.
52 changes: 12 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# SINGABOAT-VRX | Virtual RobotX (VRX) Competition

<img src="https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/PNG/Team.png" width="1080">
<a href="https://youtu.be/jI0Y9ovG-Dg"><img src="https://i.ytimg.com/vi/jI0Y9ovG-Dg/maxresdefault.jpg" width="1080" ></a>

**COMPETITION:** Virtual RobotX (VRX) Competition 2022

**TEAM NAME:** SINGABOAT-VRX

**INSTITUTE:** Nanyang Technological University, Singapore

**MEMBERS:** Tanmay Vilas Samak, Chinmay Vilas Samak and Chern Peng Lee
**MEMBERS:** Tanmay Samak, Chinmay Samak and Chern Peng Lee

**ADVISOR:** Dr. Ming Xie

## DEPENDENCIES

1. Robot Operating System (ROS) - Tested with [ROS Noetic Ninjemys](http://wiki.ros.org/noetic) on [Ubuntu 20.04.4 LTS (Focal Fossa)](https://releases.ubuntu.com/20.04/).
2. [Virtual RobotX (VRX)](https://github.com/osrf/vrx) Simulation Environment - Included as `vrx` directory with this `SINGABOAT-VRX` repository.
3. Python3 Dependencies - Listed in `requirements.txt` file of `singaboat_vrx` ROS package. These can be simply installed using the following command:
3. Python3 Dependencies - Listed in `requirements.txt` file of this `SINGABOAT-VRX` repository. These can be simply installed using the following command:
```bash
$ pip3 install -r requirements.txt
```
Expand Down Expand Up @@ -48,46 +48,18 @@

## USAGE

1. Launch any VRX task simulation instance.
Launch SINGABOAT-VRX solution(s) for VRX Competition.
```bash
$ roslaunch vrx_gazebo <TASK_NAME>.launch
$ roslaunch vrx_gazebo station_keeping.launch
$ roslaunch vrx_gazebo wayfinding.launch
$ roslaunch vrx_gazebo perception_task.launch
$ roslaunch vrx_gazebo wildlife.launch
$ roslaunch vrx_gazebo gymkhana.launch
$ roslaunch vrx_gazebo scan_dock_deliver.launch
```

2. Launch `singaboat_task_manager` to automatically identify the VRX task and execute the corresponding SINGABOAT-VRX solution algorithm.
```bash
$ roslaunch singaboat_vrx singaboat_vrx.launch
$ roslaunch singaboat_vrx <TASK_NAME>.launch
$ roslaunch singaboat_vrx singaboat_station_keeping.launch
$ roslaunch singaboat_vrx singaboat_wayfinding.launch
$ roslaunch singaboat_vrx singaboat_scene_perception.launch
$ roslaunch singaboat_vrx singaboat_semantic_navigation.launch
$ roslaunch singaboat_vrx singaboat_gymkhana_challenge.launch
$ roslaunch singaboat_vrx singaboat_scan_dock_deliver.launch
```

## DOCKER

The docker container image(s) containing all the source code as well as dependencies is available on [Docker Hub](https://hub.docker.com/repository/docker/tinkertwins/singaboat-vrx).

## VIDEOS

Demonstration videos are available on [YouTube](https://youtube.com/playlist?list=PLY45pkzWzH982DTT3n9avu5bGrd0cAcfZ).

| <a href="https://youtu.be/jI0Y9ovG-Dg"><img src="https://i.ytimg.com/vi/jI0Y9ovG-Dg/maxresdefault.jpg" width="500"></a> | <a href="https://youtu.be/x7_Z7U9vJPY"><img src="https://i.ytimg.com/vi/x7_Z7U9vJPY/maxresdefault.jpg" width="500"></a> |
|:-------------------------------------------------------------------------:|:-------------------------------------------------------------------------:|
| [Task Descriptions](https://youtu.be/jI0Y9ovG-Dg) | [Task Solutions](https://youtu.be/x7_Z7U9vJPY) |

## VRX COMPETITION 2022

[Our team worked meticulously](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/PNG/Team%20Working%20on%20Tasks.png) to complete all the [6 tasks of VRX Competition 2022](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/PNG/Tasks.png) and ultimately emerged as one of the winners of the challange, while also bagging several other special awards.

| ![Station-Keeping](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%201%20-%20Station-Keeping.gif) | ![Wayfinding](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%202%20-%20Wayfinding.gif) | ![Scene Perception](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%203%20-%20Scene%20Perception.gif) |
|:-----------------------------------------------:|:-------------------------------------------------:|:-----------------------------------------------:|
| [Station-Keeping Task](https://github.com/osrf/vrx/wiki/vrx_2022-station_keeping_task) | [Wayfinding Task](https://github.com/osrf/vrx/wiki/vrx_2022-wayfinding_task) | [Scene Perception Task](https://github.com/osrf/vrx/wiki/vrx_2022-perception_task) |
| ![Semantic Navigation](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%204%20-%20Semantic%20Navigation.gif) | ![Gymkhana Challenge](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%205%20-%20Gymkhana%20Challenge.gif) | ![Scan-Dock-Deliver](https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/GIF/Task%206%20-%20Scan-Dock-Deliver.gif) |
| [Semantic Navigation Task](https://github.com/osrf/vrx/wiki/vrx_2022-wildlife_task) | [Gymkhana Challenge Task](https://github.com/osrf/vrx/wiki/vrx_2022-gymkhana_task) | [Scan-Dock-Deliver Task](https://github.com/osrf/vrx/wiki/vrx_2022-scan_dock_deliver_task) |

The detailed scores and ranks of all the teams that qualified for finals of VRX Competition 2022 are available on [VRX GitHub Wiki](https://github.com/osrf/vrx/wiki/vrx_2022-phase3_results), and a summary of results and awards declared during the [VRX 2022 Award Ceremony](https://youtu.be/aVPmrvTCjpg) are available on [VRX Website](https://robotx.org/2022/05/04/vrx-2022-awards-and-final-standings/).

<img src="https://github.com/Tinker-Twins/SINGABOAT-VRX/blob/main/media/PNG/Awards.png" width="1080">
19 changes: 6 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Pull ROS Noetic base image
# Pull ROS Noetic base image.
FROM ros:noetic-ros-base

# Insall package dependencies
# Insall package dependencies.
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt update \
&& apt install -y \
Expand All @@ -16,7 +16,6 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
ros-noetic-key-teleop \
ros-noetic-robot-localization \
ros-noetic-robot-state-publisher \
ros-noetic-joint-state-publisher \
ros-noetic-rviz \
ros-noetic-teleop-tools \
ros-noetic-teleop-twist-keyboard \
Expand All @@ -27,21 +26,15 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
&& pip3 install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir numpy==1.22.3 scipy==1.8.0 pymap3d==2.7.2 open3d==0.13.0 dubins==1.0.1

# Set working directory
# Set working directory.
WORKDIR /home/$USER

# Install VRX packages
# Install VRX packages.
RUN mkdir -p VRX_Workspace/src/
COPY ./ VRX_Workspace/src/
RUN /bin/bash -c 'source /opt/ros/noetic/setup.bash && cd VRX_Workspace && catkin_make' \
&& /bin/bash -c 'echo "source /home/$USER/VRX_Workspace/devel/setup.bash" >> ~/.bashrc' \
&& /bin/bash -c 'source ~/.bashrc'

# Install VNC server and GUI tools
RUN apt update --fix-missing \
&& apt install -y x11vnc xvfb \
&& mkdir ~/.vnc \
&& x11vnc -storepasswd singaboat-vrx ~/.vnc/passwd

# Set entrypoint
ENTRYPOINT ["VRX_Workspace/src/SINGABOAT-VRX/singaboat_vrx/scripts/entrypoint.sh"]
# Set entrypoint.
ENTRYPOINT ["VRX_Workspace/src/SINGABOAT-VRX/singaboat_vrx/scripts/singaboat_vrx.sh"]
20 changes: 0 additions & 20 deletions docker/Gazebo_Docker_Config.md

This file was deleted.

88 changes: 18 additions & 70 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,58 @@
# SINGABOAT-VRX Docker Instructions

#### Building Docker Image from the Dockerfile:

1. Change directory to `$HOME/VRX_Workspace/src` (catkin workspace for VRX Competition):
```bash
$ cd <PATH/TO/DIRECTORY> .
$ cd $HOME/VRX_Workspace/src
```

2. Build the docker image from the dockerfile:
1. Change directory to `$HOME/VRX_Workspace/src` (catkin workspace for VRX Competition) and build the docker image:
```bash
$ docker build --tag <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG> -f <PATH/TO/DOCKERFILE> .
$ docker build --tag tinkertwins/singaboat-vrx:v2022.3 -f SINGABOAT-VRX/docker/Dockerfile .
$ docker build --tag tinkertwins/singaboat-vrx:v2022.2 -f SINGABOAT-VRX/docker/Dockerfile .
```

#### Contaninerization and Pushing the Container to Docker Hub:

1. Run the image you created in the previous step inside a container:
2. Create a container with the image you created in the previous step:
```bash
$ docker run <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker run tinkertwins/singaboat-vrx:v2022.3
$ docker run tinkertwins/singaboat-vrx:v2022.2
```

2. In a new terminal window, list all containers and make a note of the desired CONTAINER ID:
3. In a different terminal window, list all containers and take a note of desired CONTAINER ID:
```bash
$ docker ps -a
```

3. Commit changes to Docker Hub:
4. Commit changes to Docker Hub:
```bash
$ docker commit -m "<COMMIT MESSAGE>" -a "<FULL NAME>" <CONTAINER ID> <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker commit -m "SINGABOAT-VRX" -a "Tinker Twins" 35b286bf2b9b tinkertwins/singaboat-vrx:v2022.3
$ docker commit -m "SINGABOAT-VRX" -a "Tinker Twins" 35b286bf2b9b tinkertwins/singaboat-vrx:v2022.2
```

4. Login to Docker Hub:
5. Login to Docker Hub:
```bash
$ docker login
```

5. Push the container to Docker Hub, once done, you should be able to see your repository on Docker Hub:
6. Push container image to Docker Hub, once done, you should be able to see your repository on Docker Hub:
```bash
$ docker push <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker push tinkertwins/singaboat-vrx:v2022.3
$ docker push tinkertwins/singaboat-vrx:v2022.2
```

#### Running the Containerized Image:

1. Run the containerized image (follow either step 1.1 or 1.2):

1.1. Run the containerized image in **headless mode** with a name (`--name`) and interactive tty (`-it`), and remove the container upon exiting (`--rm`):
```bash
$ docker run --rm -it --name <CONTAINER_NAME> <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker run --rm -it --name singaboat_vrx tinkertwins/singaboat-vrx:v2022.3
```

1.2. Run the containerized image in **GUI mode** (requires a VNC viewer) with a name (`--name`) and interactive tty (`-it`), bind TCP port of host to port of the conatainer and publish it to the host system’s interfaces (`-p`), and remove the container upon exiting (`--rm`):
```bash
$ docker run --rm -it -p <HOST_PORT:CONTAINER_PORT> --name <CONTAINER_NAME> <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker run --rm -it -p 5900:5900 --name singaboat_vrx tinkertwins/singaboat-vrx:v2022.3
```

Launch the VNC viewer (tested with [RealVNC Viewer](https://www.realvnc.com/en/connect/download/viewer/)) and configure the connection parameters (the password for establishing secure connection is `singaboat-vrx`):

For running VNC viewer on the host machine:
```bash
$ vncviewer localhost:5900
```

For running VNC viewer on a remote machine:
```bash
$ vncviewer ip.address.of.host:5900
```

You can also configure the connection parameters via GUI of the VNC viewer application.
7. Run the container to test it in interactive tty (i.e., `-it`) mode:
```bash
$ docker run -it --name <GIVE A CONTAINER NAME> <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
$ docker run -it --name singaboat_vrx tinkertwins/singaboat-vrx:v2022.2
```

2. [Optional] Start additional bash session(s) within the container (each in a new terminal window):
8. In a different terminal window, execute a bash from within the container to access it:
```bash
$ docker exec -it <CONTAINER NAME> bash
$ docker exec -it singaboat_vrx bash
```

3. Once you are done with the intended job, exit the bash session(s):
9. Exit the bash:
```bash
$ exit
```

4. Kill the running container (required only if the containerized image is still running):
10. Kill the container:
```bash
$ docker kill <CONTAINER NAME>
$ docker kill singaboat_vrx
```

5. Remove the container (required only if the containerized image is not run with the `--rm` option):
```bash
$ docker rm <CONTAINER NAME>
$ docker rm singaboat_vrx
```

#### Cleaning Up Docker Resources:

Running or caching multiple docker images or containers can quickly eat up a lot of disk space. Hence, it is always a good idea to frequently check docker disk utilization:
```bash
$ docker system df
```

In order to avoid utilizing a lot of disk space, it is a good idea to frequently purge docker resources such as images, containers, volumes and networks that are unused or dangling (i.e. not tagged or associated with a container). There are a number of ways with a lot of options to achieve this, please refer appropriate documentation. The easiest way (but a potentially dangerous one) is to use a single command to clean up all the docker resources (dangling or otherwise):
```bash
$ docker system prune -a
```
19 changes: 0 additions & 19 deletions docker/RViz_Docker_Config.md

This file was deleted.

Binary file removed media/GIF/Task 1 - Station-Keeping.gif
Binary file not shown.
Binary file removed media/GIF/Task 2 - Wayfinding.gif
Binary file not shown.
Binary file removed media/GIF/Task 3 - Scene Perception.gif
Binary file not shown.
Binary file removed media/GIF/Task 4 - Semantic Navigation.gif
Binary file not shown.
Binary file removed media/GIF/Task 5 - Gymkhana Challenge.gif
Binary file not shown.
Binary file removed media/GIF/Task 6 - Scan-Dock-Deliver.gif
Binary file not shown.
Binary file removed media/PNG/Awards.png
Binary file not shown.
Binary file removed media/PNG/Tasks.png
Binary file not shown.
Binary file removed media/PNG/Team Working on Tasks.png
Binary file not shown.
Binary file removed media/PNG/Team.png
Binary file not shown.
14 changes: 8 additions & 6 deletions singaboat_vrx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ catkin_python_setup()
# Dynamic reconfigure options
generate_dynamic_reconfigure_options(
cfg/teleoperation_config.cfg
cfg/inverse_kinematics_config.cfg
cfg/pose_processor_config.cfg
cfg/ik_solver_config.cfg
cfg/task_manager_config.cfg
cfg/mission_manager_config.cfg
cfg/station_keeping_config.cfg
Expand Down Expand Up @@ -91,7 +92,8 @@ catkin_package(CATKIN_DEPENDS
# Install all the script files
catkin_install_python(PROGRAMS
src/singaboat_teleoperation.py
src/singaboat_inverse_kinematics.py
src/singaboat_pose_processor.py
src/singaboat_ik_solver.py
src/singaboat_mission_manager.py
src/singaboat_task_manager.py
src/singaboat_station_keeping.py
Expand All @@ -102,13 +104,13 @@ catkin_install_python(PROGRAMS
src/singaboat_scan_dock_deliver.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

# Install all the script config files
# Install all the cfg files
install(DIRECTORY cfg/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cfg)

# Install all the WAM-V config files
install(DIRECTORY wamv/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/wamv)
# Install all the config files
install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config)

# Install all the world files
install(DIRECTORY worlds/
Expand Down
Loading

0 comments on commit 0804412

Please sign in to comment.