-
Notifications
You must be signed in to change notification settings - Fork 0
2. 주행 환경 시뮬레이션
Jinsun-Lee edited this page Dec 27, 2024
·
4 revisions
✅ Success: 트랙 + 주행 차량 확인 가능 |
---|
![]() |
⭐ 환경 설정 적용
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
source install/local_setup.bash
ROS2를 사용하기 위해 터미널을 열 때마다 매번 위의 명령어 실행 필요
sudo killall -9 gazebo gzserver gzclient; ros2 launch simulation_pkg driving_sim.launch.py
시뮬레이션을 종료하고 싶으면 터미널에서 ctrl + c 입력
sudo killall -9 gazebo gzserver gzclient; qqq
위 명령어로 시뮬레이터를 확실히 종료
MOVE # 모터를 구동
STOP # 차량을 정지
launch 명령어를 실행해도 차량은 동작하지 않음
다른 터미널을 열어서 MOVE
를 입력하면 동작하기 시작함(⭐ 환경 설정 적용 필요)
rqt
gazebo
load_ego_car_node
sim_yolov8_node
sim_debug_node
⭐ sim_lane_info_extractor_node
⭐ sim_motion_planner_node
sim_simulation_sender_node
launch 시 위 node들이 동작함
그 중 아래 두 노드만 수정하면 됨
- ~/ros2_ws/src/simulation_pkg/simulation_pkg/
lane_info_extractor_node.py
- ~/ros2_ws/src/simulation_pkg/simulation_pkg/
motion_planner_node.py
코드 수정 후 저장한 다음에, 2.1 주행 launch 실행 명령어
를 실행하면 동작 확인 가능(빌드 안 해도 됨)
단, 시뮬레이터를 제대로 종료한 후 실행할 것