반응형
자신의 pc에 여러 버전의 ros2를 설치하여 사용하는 것이 가능하다. 그 방법에 대하여 알아보자.
1. set locale, setup sources, update 등 기타 작업을 했다는 가정하에 아래 명령어로 설치 가능하다.
sudo apt install ros-foxy-desktop
# ros2 foxy 버전 설치
sudo apt install ros-galactic-desktop
# ros2 galactic 버전 설치
상세 설치방법은 아래 링크를 참조하자. (ubuntu ros2 foxy)
상세 설치방법은 아래 링크를 참조하자. (ubuntu ros2 galactic)
2. 이제 pc에 ros2 foxy, galactic 버전이 동시에 설치되어 있다. 각 버전을 사용하길 원할때는 아래 명령을 실행하자.
# foxy 버전을 사용하길 원할 경우 터미널에서 실행
source /opt/ros/foxy/setup.bash
# galactic 버전을 사용하길 원할 경우 터미널에서 실행
source /opt/ros/galactic/setup.bash
@ 일반적으로 ros2 버전은 1개만 사용하고 터미널 실행할때 마다 상기 명령어를 타이핑 하기 귀찮기 때문에 터미널 실행 시 상기 명령이 자동으로 적용되도록 ~/.bashrc 파일에 추가 해놓는 경우가 많다.
추가 방법은 아래와 같다.
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
728x90
'OMOROBOT > ROS2 일반' 카테고리의 다른 글
[ros2] 괜찮은 사이트 추천 (0) | 2022.08.14 |
---|---|
[ros2] ros2 workspace 폴더 (0) | 2022.08.09 |
[ros2] ros2 기본 명령어_5 (0) | 2022.08.07 |
[ros2] ros2 기본 명령어_4 (0) | 2022.08.06 |
[ros2] ros2 기본 명령어_3 (0) | 2022.08.05 |