Carla 0.9.10.1 설치하기 (다른 버전은 python 실행 에러나서 이거로 함)
https://github.com/carla-simulator/carla/releases/tag/0.9.10.1
(다운, 압축풀고 서버 실행 확인)
cd ~/CARLA_0.9.10.1
./CarlaUE4.sh
(서버 실행)
서버에 파이썬 파일 잘 적용되나 확인하기
cd ~/CARLA_0.9.10.1/PythonAPI/carla/dist
sudo python -m easy_install carla-0.9.10-py2.7-linux-x86_64.egg
(뭔지 모르지만 carla 버전에 맞는 파이썬 2.7 필요해서 설치)
(나중에 ROS bridge와 호환성 문제로 python3말고 python2 사용)
cd ~/CARLA_0.9.10.1/PythonAPI/examples
python spawn_npc.py
(npc 생성)
python manual_control.py
(수동 조작 생성)
Carla 버전에 맞는 ROS Bridge 설치하기
mkdir -p ~/carla-ros-bridge/catkin_ws/src
cd ~/carla-ros-bridge/catkin_ws/src
git clone -b '0.9.10.1' --recurse-submodules https://github.com/carla-simulator/ros-bridge.git
cd ros-bridge
git submodule update --init
그리고 catkin_make
서버에 ROS 연동된 차량 생성하기
source ~/carla-ros-bridge/catkin_ws/devel/setup.bash
후에
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch
(아까 2번에 manual_control.py 랑 같은 역할)
(H 누르면 조작키 설명)
(오토파일럿 키려면 수동조작으로 가는 중에 p 누르면됌)
다른 터미널에서 topic 확인
rostopic list 로 topic 확인가능
rviz 켜서 add topic 해서 이미지로 센서 정보 확인가능
... 더 공부해서 추가
참고사이트)
https://carla.readthedocs.io/en/0.9.10/start_quickstart/
https://carla.readthedocs.io/en/0.9.10/ros_installation/
https://dreamofadd.tistory.com/83?category=1190453
https://dreamofadd.tistory.com/90?category=1190863
bashrc 등록된것들)
source /opt/ros/melodic/setup.bash
source ~/carla-ros-bridge/catkin_ws/devel/setup.bash
export CARLA_ROOT=~/Downloads/CARLA_0.9.10.1
export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.10-py2.7-linux-x86_64.egg:$CARLA_ROOT/PythonAPI/carla
과정 중간중간에 에러날수도.. 인터넷 찾으면서 해결 필요..