apt update
apt install xvfb libosmesa6-dev libgl1-mesa-glx libglfw3 libglx-mesa0 libgl1-mesa-dri
mkdir -p /usr/lib/dri
SWRAST_PATH=$(find /usr -name 'swrast_dri.so' 2>/dev/null)
ln -sf "$SWRAST_PATH" /usr/lib/dri/swrast_dri.sonvcc --versionIf not installed, install cuda 12.1
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
chmod +x cuda_12.1.0_530.30.02_linux.run
./cuda_12.1.0_530.30.02_linux.run --overrideconda create -n safepo python=3.8
conda activate safepo
conda install -c conda-forge gcc
pip install -e ./isaac-gym/python
pip install -e ./safe-policy-optimization
pip install -e ./safety-gymnasium
pip install -e ./datagenModify the train_scripts/marl_cfg/YOUR_ALGO/config.yaml file to tune the hyperparameters.
Or, add --PARAM_NAME PARAM_VALUE to the command line arguments following the train_scripts/marl_cfg/YOUR_ALGO/config.yaml file.
Run the following command to train the agent using the specified algorithm.
cd data-generation
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib
python datagen/train_scripts/macpo.py --task FreightFrankaCloseDrawer --experiment benchmarkSync the results to the visualization server.
rsync -avz -e "ssh -p PORT" root@TRAINER_IP:path/to/safepo/runs path/to/safepo/runsPreview the trained agent with GUI
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib
python3 data-generation/datagen/data_collect/close_drawer_viewer.py --benchmark-dir /data-generation/runs/benchmark