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

Set up ROS Bridge #4

Open
shineyruan opened this issue Dec 26, 2020 · 2 comments
Open

Set up ROS Bridge #4

shineyruan opened this issue Dec 26, 2020 · 2 comments
Assignees
Milestone

Comments

@shineyruan
Copy link
Contributor

Set up ROS Bridge; write a demo from ROS to talk with CARLA.

@shineyruan shineyruan added this to the Basic Set-up milestone Dec 26, 2020
@shineyruan
Copy link
Contributor Author

shineyruan commented Dec 27, 2020

ROS bridge demo runs successfully. @voyager1998 @LejunJiang

For all users running CUDA 11 and above: By default, ROS Bridge on Noetic depends on OpenCV 4.2 and CUDA 10 (details see python3-opencv and libopencv-dev). One using CUDA 11 who would like to run ROS Bridge should compile OpenCV with CUDA 11 from source. As a reference, I downloaded OpenCV 4.4.0, OpenCV_Contrib 4.4.0 and compiled it with the following arguments:

cd ~/opencv-4.4.0
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
              -DWITH_QT=ON \
              -DWITH_CUDA=ON \
              -DOPENCV_EXTRA_MODULES_PATH=/home/ryan/opencv_contrib-4.4.0/modules/ \
              -DBUILD_opencv_python=ON \
              -DWITH_PYTHON=ON \
              -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.1
make -j
sudo make install

Building OpenCV would possibly take 30min to 1 hr. Note that sudo make install would replace python3-opencv with OpenCV 4.4.0 under the system root directory.

Building OpenCV with Qt is optional but recommended. One can always install a stable version of Qt 5 with the following command:

sudo apt-get install qt5-default

After installing OpenCV successfully, one can then rebuild Catkin workspace according to this tutorial and run ROS bridge with the following:

# Add CARLA Python API egg file to PYTHONPATH
# Replace ${CARLA_ROOT} with your own path to CARLA root dir
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.10-py3.8-linux-x86_64.egg:${CARLA_ROOT}/PythonAPI/carla/

# Option 1: start the ros bridge
roslaunch carla_ros_bridge carla_ros_bridge.launch

# Option 2: start the ros bridge together with RVIZ
roslaunch carla_ros_bridge carla_ros_bridge_with_rviz.launch

# Option 3: start the ros bridge together with an example ego vehicle
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch

@shineyruan
Copy link
Contributor Author

@voyager1998 @LejunJiang Please review and close this issue

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