Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCDA installation problem #20

Open
eyabesbes opened this issue Feb 21, 2024 · 1 comment
Open

OpenCDA installation problem #20

eyabesbes opened this issue Feb 21, 2024 · 1 comment

Comments

@eyabesbes
Copy link

eyabesbes commented Feb 21, 2024

Hello,
I have been following OpenCDA's documentation for installation.
To be specific, I have followed the following instructions:
Screenshot 2024-02-21 125831
and I had a problem while running the setup.sh file
As a matter of fact, I'm trying to install OpenCDA on windows 10, thus, I won't be able to run this command on windows " . setup.sh". To solve this issue, I have used WSL2 to do so but I got this error it seems like there is something wrong with the bash file:
image
this is the setup file ( I have modified the name of the egg file in order match the egg file that I already have within the Carla folder)

#!/bin/bash

set -e

if [ -z "$CARLA_HOME" ]; then
    echo "Error: Please set \$CARLA_HOME before running this script"
    return 0
fi

if [ -z "$CARLA_VERSION" ]; then
   CARLA_VERSION="0.9.11"
fi

CARLA_EGG_FILE=${CARLA_HOME}/PythonAPI/carla/dist/carla-"${CARLA_VERSION}"-py3.7-win-amd64.egg
if [ ! -f "$CARLA_EGG_FILE" ]; then
    echo "Error: $CARLA_EGG_FILE can not be found. Please make sure you are using python3.7 and carla 0.9.11. "
    return 0
fi

CACHE=${PWD}/cache
if [ ! -d "$CACHE" ]; then
  echo "creating cache folder for carla PythonAPI egg file"
  mkdir -p "$CACHE"
fi

echo "copying egg file to cache folder"
cp  $CARLA_EGG_FILE $CACHE

echo "unzip egg file"
unzip "${CACHE}"/carla-"${CARLA_VERSION}"-py3.7-win-amd64.egg -d "${CACHE}"/carla-"${CARLA_VERSION}"-py3.7-win-amd64

echo "copy setup file to egg folder"
SETUP_PY=${PWD}/scripts/setup.py
cp "$SETUP_PY"  "${CACHE}"/carla-"${CARLA_VERSION}"-py3.7-win-amd64/

echo "Successful! Run 'pip install -e ${CACHE}/carla-${CARLA_VERSION}-py3.7-win-amd64' to install carla into your python package "
conda activate opencda
pip install -e ${CACHE}/carla-"${CARLA_VERSION}"-py3.7-win-amd64

echo "Sucessful Setup!"

as for the environment variables these are the commands that I have used (using wsl2):
export CARLA_HOME=c/carla
export CARLA_VERSION=0.9.15
image
image

@carlosrisma
Copy link
Collaborator

Hello,
although OpenCDA should be able to run on Windows, ns-3 and hence ms-van3t does not. Nevertheless ms-van3t does run on WSL2 but we have not yet tested in co-simulation with CARLA as it implies several challenges like the ones you're facing now.
The error you get when running your edited setup.sh is because you most likely edited the file in windows, refer to this link to solve the problem (https://stackoverflow.com/questions/6366530/bash-syntax-error-unexpected-end-of-file).
I would recommend in any case, if possible, to install CARLA 0.9.12 to avoid any potential issues with the API calls.

Best regards,
Carlos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants