직관적인느낌

[자율주행][Simulation-Gazebo] leecar - 1.Create a Workspace (환경설정) 본문

프로젝트

[자율주행][Simulation-Gazebo] leecar - 1.Create a Workspace (환경설정)

범슐랭 2023. 8. 25. 16:29
728x90

Env

H.W OS
Laptop
- CPU : AMD Ryzen 9 5900HS with Radeon Graphics 3.30 GHz
- RAM : 16GB
- GPU : 3050Ti
Windows 11 & WSL2
ROS2 foxy

1. Create a Workspace

mkdir -p ~/leecar_ws/src

2. Resolve Package Dependencies

cd leecar_ws

sudo apt upate

sudo apt update 진행중

sudo apt install python3-colcon-common-extensions

colcon build

colcon build 실행

3. Source the Workspace

# sudo apt-get install gedit
gedit ~/.bashrc

# 아래의 경로를 추가, Add
source ~/leecar_ws/install/setup.bash
source /opt/ros/foxy/setup.bash

# 경로 추가 후, 업데이트
source ~/.bashrc

 

 


작업 공간 생성

ros2 pkg create --build-type ament_cmake leecar_ws

ros2 pkg create --build-type ament_python leecar_ws
ros2 pkg create --build-type ament_python leecar_ws --dependencies rclpy image_transport cv_bridge sensor_msgs std_msgs opencv2


- 빌드

cd ~/dev_ws/
colcon build

# 또는
colcon build --packages-select leecar_ws

ROS 2 Navigation

 

- Install & Build Nav2

sudo apt install ros-foxy-navigation2
sudo apt install ros-foxy-nav2-bringup
sudo apt install ros-foxy-turtlebot3*
sudo apt install ros-foxy-nav2-simple-commander

Build and Install — Navigation 2 1.0.0 documentation


mkdir -p ~/nav2_ws/src
cd ~/nav2_ws/src
git clone <https://github.com/ros-planning/navigation2.git> --branch foxy-devel
cd ~/nav2_ws
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro foxy
cd ~/nav2_ws
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro foxy
colcon build --symlink-install
# 시간좀 오래 걸림
gedit ~/.bashrc
# 이걸 맨 아래에 붙여 넣기
source ~/nav2_ws/install/setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/foxy/share/turtlebot3_gazebo/models
source /usr/share/gazebo/setup.sh
cd ~/nav2_ws
colcon build

 

 

- Test Your Installation

cd ~/nav2_ws
ros2 launch nav2_bringup tb3_simulation_launch.py

 

- Install the SLAM Toolbox

sudo apt install ros-foxy-slam-toolbox
cd ~/nav2_ws

- 실행

ros2 launch nav2_bringup slam_launch.py

- 실행

ros2 launch nav2_bringup tb3_simulation_launch.py

# or

ros2 launch nav2_bringup tb3_simulation_launch.py slam:=True

 

728x90
반응형