-
Notifications
You must be signed in to change notification settings - Fork 0
1. 초기 설정
Jinsun-Lee edited this page Dec 27, 2024
·
4 revisions
cd
git clone https://github.com/SKKUAutoLab/simulation_ws ros2_ws
cd ~/ros2_ws
cd ~/ros2_ws
sh install.sh
source ~/.bashrc
레포의 가장 상위 경로에 있는 install.sh 파일 실행
해당 스크립트로 종속 패키지 설치,모델 파일 복사, bashrc에 설정 추가 등 수행
인터페이스 패키지 빌드
cd ~/ros2_ws
export AMENT_PREFIX_PATH=''
export CMAKE_PREFIX_PATH=''
source /opt/ros/humble/setup.bash
rosdep install -i --from-path src --rosdistro humble -y
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --packages-select interfaces_pkg --allow-overriding interfaces_pkg
source install/local_setup.bash
colcon build --symlink-install --packages-select camera_perception_pkg --allow-overriding camera_perception_pkg
source install/local_setup.bash
colcon build --symlink-install --packages-select lidar_perception_pkg --allow-overriding lidar_perception_pkg
source install/local_setup.bash
colcon build --symlink-install --packages-select decision_making_pkg --allow-overriding decision_making_pkg
source install/local_setup.bash
colcon build --symlink-install --packages-select serial_communication_pkg --allow-overriding serial_communication_pkg
source install/local_setup.bash
시뮬레이션 패키지 빌드
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install --packages-select simulation_pkg --allow-overriding simulation_pkg
source install/local_setup.bash
gazebo --verbose
위와 같은 화면이 뜨는지 확인 후, Insert 탭 클릭
.gazebo/models 경로에 있는 모든 모델들을 확인하기 위해 클릭
첫 실행에는 위와 같이 로딩 표시가 뜨며 모델이 바로 보이지 않음
로딩 표시가 사라진 후에도 일부 모델이 표시되지 않을 경우, 화면에 커서를 대면 확인 가능
이때 화면을 클릭하지 않아도 됨
prius hybrid 모델은 특히 오래 걸림
확인이 끝나면 x를 눌러 종료
rqt
위와 같은 화면이 뜨는지 확인
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
source install/local_setup.bash
ROS2를 사용하기 위해 터미널을 열 때마다 매번 위의 명령어 실행 필요