환경 구성 요소 설치
sudo apt install ros-$ROS_DISTRO-navigation2 ros-$ROS_DISTRO-nav2-*
워크스페이스 내에 필요한 Neobotix의 리소스 가져오기
mkdir ~/nav2_ws/src/neobotix
cd ~/nav2_ws/src/neobotix
git clone <https://github.com/neobotix/neo_msgs2.git>
git clone --branch $ROS_DISTRO <https://github.com/neobotix/neo_local_planner2.git>
git clone --branch $ROS_DISTRO <https://github.com/neobotix/neo_localization2.git>
git clone --branch $ROS_DISTRO <https://github.com/neobotix/neo_nav2_bringup.git>
git clone --branch $ROS_DISTRO <https://github.com/neobotix/neo_simulation2.git>
워크스페이스 내 패키지 빌드
cd ~/nav2_ws/
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
source ~/nav2_ws/install/local_setup.bash # 또는 새 터미널 열기
~/nav2_ws/src/neobotix/neo_simulation2/configs/mpo_700/navigation.yaml
파일의 잘못된 AMCL 설정 수정
101번 째 줄 수정
robot_model_type: "omnidirectional”
robot_model_type: "nav2_amcl::OmniMotionModel”
amcl:
ros__parameters:
...
**robot_model_type: "nav2_amcl::OmniMotionModel"**
...
mpo_700
은 (1) 자체 Localization 알고리즘과 (2) AMCL 중 선택
~/nav2_ws/src/neobotix/neo_simulation2/launch/simulation.launch.py
파일에서 aws.world
가 강제로 켜지도록 수정
60번 째 줄 수정
# Get the required paths for the world and robot robot_description_urdf
if (my_neo_environment == "neo_workshop" or my_neo_environment == "neo_track1"):
world_path = os.path.join(
get_package_share_directory('neo_simulation2'),
'worlds',
**'aws.world') # 수정 !!**
~/nav2_ws/src/neobotix/neo_simulation2/launch/simulation.launch.py
파일에서 지도 메타 파일인 aws.yaml
를 강제로 불러오도록 수정
63번 째 줄 수정
# Only set path for the neobotix supported maps
if (my_neo_environment == "neo_workshop" or my_neo_environment == "neo_track1"):
map_dir = os.path.join(
get_package_share_directory('neo_simulation2'),
'maps',
**'aws.yaml') # 수정 !!**
새 터미널을 열고 시뮬레이션 환경이 잘 열리는지 확인
export MY_ROBOT=mpo_700
ros2 launch neo_simulation2 simulation.launch.py
사용가능한 로봇 및 시뮬레이션 환경
MY_ROBOT |
mpo_700, mpo_500, mp_400, mp_500 |
---|---|
MAP_NAME |
aws, neo_track1, neo_workshop |
아래 명령어를 통해 로봇 제어
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Shift
버튼) : 조향 없이 이동 가능nav2를 사용하기 위해 아래 런치파일 실행
ros2 launch neo_simulation2 navigation.launch.py
ros2 launch neo_simulation2 navigation.launch.py use_amcl:=True
Rviz2 실행을 위해 아래 런치파일 실행
ros2 launch neo_nav2_bringup rviz_launch.py
2D Pose Estimate
버튼을 통해 초기위치 설정, Nav2 Goal
버튼으로 목적지 설정해 테스트 진행