Here you find the code described in [borges2024caviar] (see below), which allows to generate the results in this paper.
*Currently tested only on Ubuntu 22.04 and Python 3.9.16
sudo apt update
sudo apt install curl
sudo apt install unzip
Go to https://github.com/nats-io/nats-server/tags , download the latest .deb
release and install it.
git clone [email protected]:lasseufpa/caviar.git
git clone https://github.com/lasseufpa/caviar.git
Go to the folder where the 3D executable will be stored:
cd caviar/3d
Download the executable
curl https://nextcloud.lasseufpa.org/s/zdNNfM2YCmfrHsi/download/central_park.zip --output central_park.zip
Unzip the file
unzip central_park.zip
Set it as an executable
chmod +x ./central_park/LinuxNoEditor/central_park/Binaries/Linux/central_park-Linux-DebugGame
Now, go back to the project root
cd ..
We use python 3.9.16*
(Optional): Create and activate a virtual environment with conda
conda create --name caviar python=3.9.16
conda activate caviar
First we should install the package below
pip install msgpack-rpc-python==0.4.1
After this, we install the rest of the requirements
pip install -r requirements.txt
In the project root folder, run:
python3 simulate.py
This will start a simulation of the flights defined in caviar/examples/airsimTools/waypoints/trajectories/
To correctly abort a simulation, in the terminal press:
ctrl+C
The configuration parameters used in the simulation are stored in caviar/caviar_config.py
More documentation on the configuration soon
Sometimes this error can happen due to the download of YOLO weights. For this case, just exit the current simulation with ctrl+c
and try it again.
Got the error: "Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice. This may result in compilation or runtime failures, if the program we try to run uses routines from libdevice."
This is due to not being able to file the CUDA directory. For this you can execute the following, to add it to your environment variables:
echo -e "export CUDA_DIR=\"$(whereis cuda | cut -d ' ' -f 2)\"\nexport XLA_FLAGS=--xla_gpu_cuda_data_dir=\"\${CUDA_DIR}\"" >> ~/.bashrc
echo -e "export CUDA_DIR=\"$(whereis cuda | cut -d ' ' -f 2)\"\nexport XLA_FLAGS=--xla_gpu_cuda_data_dir=\"\${CUDA_DIR}\"" >> ~/.zshrc
If you benefit from this work, please cite on your publications using:
@ARTICLE{borges2024caviar,
author={Borges, João and Bastos, Felipe and Correa, Ilan and Batista, Pedro and Klautau, Aldebaro},
journal={IEEE Internet of Things Journal},
title={{CAVIAR: Co-Simulation of 6G Communications, 3-D Scenarios, and AI for Digital Twins}},
year={2024},
volume={11},
number={19},
pages={31287-31300},
doi={10.1109/JIOT.2024.3418675}}