Skip to content

Commit 42df93f

Browse files
Added Storage Tools documentation from PR #49 (#248)
Co-authored-by: openhands <[email protected]>
1 parent bfe6e3e commit 42df93f

File tree

1 file changed

+199
-0
lines changed

1 file changed

+199
-0
lines changed

docs/user_guide/getting_started.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# Getting Started
2+
3+
Welcome to the AirLab Autonomy Stack. By the end of this guide, you will have the autonomy stack running on your machine.
4+
5+
## Requirements
6+
7+
You need at least 25GB free to install the Docker image.
8+
9+
Have an NVIDIA GPU >= RTX 3070 to run Isaac Sim locally.
10+
11+
## Setup
12+
13+
### Clone
14+
15+
```bash
16+
git clone --recursive -j8 [email protected]:castacks/AirStack.git
17+
```
18+
19+
### Omniverse
20+
21+
Install the Omniverse launcher download from this link:
22+
23+
```bash
24+
25+
wget https://install.launcher.omniverse.nvidia.com/installers/omniverse-launcher-linux.AppImage
26+
```
27+
28+
Follow these instructions to setup Nucleus : [https://airlab.slite.com/app/docs/X8dZ8w5S3GP9tw](https://airlab.slite.com/app/docs/X8dZ8w5S3GP9tw)
29+
30+
### SITL
31+
32+
If you are using the Ascent Spirit drone download the SITL software packages from this link:
33+
[https://drive.google.com/file/d/1UxgezaTrHe4WJ28zsVeRhv1VYfOU5VK8/view?usp=drive_link](https://drive.google.com/file/d/1UxgezaTrHe4WJ28zsVeRhv1VYfOU5VK8/view?usp=drive_link)
34+
35+
Then unzip the file AscentAeroSystemsSITLPackage.zip in this folder:
36+
37+
```bash
38+
cd AirStack/simulation/AscentAeroSystems
39+
unzip ~/Downloads/AscentAeroSystemsSITLPackage.zip -d .
40+
```
41+
42+
### Docker
43+
44+
- Install [Docker Desktop](https://docs.docker.com/desktop/install/ubuntu/). This should come installed with docker compose.
45+
- Gain access to NVIDIA NGC Containers by following [these instructions](https://docs.nvidia.com/launchpad/ai/base-command-coe/latest/bc-coe-docker-basics-step-02.html)
46+
47+
## Build and run the Docker image
48+
49+
```bash
50+
cd AirStack/docker/
51+
## build the image, it is named airlab-autonomy-dev:latest
52+
docker compose --profile build build
53+
## start docker compose service/container
54+
docker compose up -d
55+
```
56+
57+
## Launch
58+
59+
Launch autonomy stack controls package:
60+
61+
```bash
62+
# start a new terminal in docker container
63+
docker compose exec airstack_dev bash
64+
65+
# in docker
66+
bws && sws ## build workspace and source workspace. these are aliases in ~/.bashrc
67+
ros2 launch robot_bringup launch_robot.yaml
68+
```
69+
70+
Launch simulator (Isaac Sim and Ascent SITL):
71+
72+
```bash
73+
xhost + ## allow Docker access to Linux X-Server
74+
# start another terminal in docker container
75+
docker compose exec airstack_dev bash
76+
77+
# in docker
78+
ISAACSIM_PYTHON simulation/launch_sim.py
79+
```
80+
81+
## Move Robot
82+
83+
```bash
84+
# start another terminal in docker container
85+
docker compose exec airstack_dev bash
86+
87+
# in docker
88+
# set drone mode to GUIDED
89+
ros2 service call /robot1/controls/mavros/set_mode mavros_msgs/SetMode "custom_mode: 'GUIDED'"
90+
# ARM
91+
ros2 service call /robot1/controls/mavros/cmd/arming mavros_msgs/srv/CommandBool "{value: True}"
92+
# TAKEOFF
93+
ros2 service call /robot1/controls/mavros/cmd/takeoff mavros_msgs/srv/CommandTOL "{altitude: 5}"
94+
# FLY TO POSITION. Put whatever position you want
95+
ros2 topic pub /controls/mavros/setpoint_position/local geometry_msgs/PoseStamped \
96+
"{ header: { stamp: { sec: 0, nanosec: 0 }, frame_id: 'base_link' }, \
97+
pose: { position: { x: 10.0, y: 0.0, z: 20.0 }, orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } } }" -1
98+
```
99+
100+
## Setup Storage Tools Server Locally
101+
102+
### Clone and install
103+
104+
``` bash
105+
git clone https://github.com/castacks/storage_tools_server
106+
cd storage_tools_server
107+
python -m venv venv
108+
. venv/bin/activate
109+
pip install -r requirements.txt
110+
```
111+
112+
### Configure
113+
114+
Edit the `config/config.yaml` file to match your configuration.
115+
116+
### REQUIRED UPDATES
117+
118+
- `upload_dir` is the location for uploads. This must be readable and writeable by the user running the Server.
119+
- `volume_root` sets the prefix for all entries in the `volume_map`. This must be readable and writeable by the user running the Server.
120+
121+
### Set Environment and Run
122+
123+
- `CONFIG` is the full path to the `config.yaml` in use. By default, the app will use `$PWD/config/config.yaml`
124+
- `PORT` is the same port as define in the optional setup. The default is 8091.
125+
126+
``` bash
127+
export CONFIG=$PWD/config/config.yaml
128+
export PORT=8091
129+
130+
gunicorn -k gevent -w 1 -b "0.0.0.0:${PORT}" --timeout 120 "server.app:app"
131+
```
132+
133+
Open a web browser to [http://localhost:8091](http://localhost:8091) (or the PORT you set). The default user is `admin` and the default password is `NodeNodeDevices`.
134+
135+
### Create an API Key for your robot
136+
137+
- Log into the Server
138+
- Go to Configure -> Keys
139+
- Enter a name for the device key in the "Add a new key name" field.
140+
- Click "Generate Key"
141+
142+
## Set up Storage Tools Device on your Robot
143+
144+
### Install Requirements
145+
146+
- [Docker Compose](https://docs.docker.com/compose/install/standalone/)
147+
148+
### Clone Device Repo
149+
150+
```bash
151+
cd /opt
152+
git clone https://github.com/castacks/storage_tools_device
153+
cd stroage_tools_device
154+
```
155+
156+
### Update the config.env
157+
158+
Update the `config.env` to match your system.
159+
160+
- Required
161+
- `DATA_DIR`. This is the top level data directory that all of the `watch` dirs share. For example, if you `watch` directories are `/mnt/data/processor_1` and `/mnt/data/processor_2`, set the `DATA_DIR` to `/mnt/data`.
162+
- Optional
163+
- `CONFIG_PORT`. The HTTP port to edit the configuration. Navigate to http://YOUR_DEVICE_IP:CONFIG_PORT to edit the configurations and view online status. The default port is 8811.
164+
165+
### Build and Run
166+
167+
This sets up the environment and configures the image to start on boot.
168+
169+
``` bash
170+
cd /opt/storage_tools_device
171+
172+
# run in foreground
173+
docker compose --env-file config.env up --build --remove-orphans
174+
175+
# run in background
176+
docker compose --env-file config.env up --build --remove-orphans -d
177+
```
178+
179+
### Configure the Device
180+
181+
Navigate to http://YOUR_DEVICE_IP:CONFIG_PORT to edit the configurations and view online status. The default port is 8811.
182+
183+
### Device Configuration
184+
185+
You must update all *Required* fields.
186+
187+
- **Project Name**: Name of the project. If this is empty, the server will ask you to fill in the name.
188+
- **Robot Name**: (Required) Name of this robot. This should be unique within the project.
189+
- **API Key Token**: (Required) The API_KEY_TOKEN for this robot. Your admin can provide this to you. If you are running your own upload server, it is set in the Config->Keys page.
190+
- **Watch**: (Required) The list of directories to be watched. Any file with a matching suffix (see Include Suffix) will be uploaded. These all must be in the same subdirectory as `DATA_DIR` from the `config.env` file.
191+
- **Servers**: List of potential servers. If this is empty, the Device will search for servers using ZeroConf.
192+
- **Local Time Zone**: The time zone that the logs were recorded in.
193+
- **Threads**: The number of threads used for uploading from this device to the server.
194+
- **Include Suffix**: The list of included suffixes. Any file in the Watch directory (see above) that matches one of these suffixes will be uploaded to the server.
195+
- **Watch Interval**: How long to wait in seconds before attempting to connect to server again.
196+
197+
Press [Save] to commit the changes to the device.
198+
199+
Press [Refresh] to refesh the page with the on device settings.

0 commit comments

Comments
 (0)