1. 다음의 쉘 파일로 우선 시뮬레이터와 다른 노드들 활성화 시킨다.
test.sh
0.00MB
test2.sh
0.00MB
2. 첫번째 라이프사이클 활성화 시킬것들... map server와 amcl
ros2 lifecycle set /map_server configure
ros2 lifecycle set /map_server activate
ros2 lifecycle set /amcl configure
ros2 lifecycle set /amcl activate
3. initial pose 설정
ros2 topic pub -1 /initialpose geometry_msgs/msg/PoseWithCovarianceStamped '
header:
frame_id: "map"
pose:
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]'
4. 두번째 라이프 사이클 활성화
ros2 lifecycle set /behavior_server configure
ros2 lifecycle set /behavior_server activate
ros2 lifecycle set /controller_server configure
ros2 lifecycle set /controller_server activate
ros2 lifecycle set /planner_server configure
ros2 lifecycle set /planner_server activate
ros2 lifecycle set /smoother_server configure
ros2 lifecycle set /smoother_server activate
ros2 lifecycle set /bt_navigator configure
ros2 lifecycle set /bt_navigator activate
5. 다음 링크에서 rviz2에서 particlecloud 추가 및 /plan추가를 참고해서 똑같이 하자. https://jihong.tistory.com/583
gazebo turtlebot path planning
/opt/ros/jazzy/share/turtlebot4_navigation/config 1. 시뮬레이터 실행ros2 launch turtlebot4_gz_bringup turtlebot4_gz.launch.py slam:=false nav2:=false rviz:=false use_sim_time:=true 2. map server를 활성화 해보자. (https://jihong.
jihong.tistory.com
6. 확인해보기
ros2 lifecycle get /map_server
ros2 lifecycle get /amcl
ros2 lifecycle get /planner_server
ros2 lifecycle get /controller_server
ros2 lifecycle get /behavior_server
ros2 lifecycle get /bt_navigator
6. planner pkg 실행
ros2 run my_planner_pkg my_planner
7. goal pose 지정
ros2 topic pub -1 /goal_pose geometry_msgs/msg/PoseStamped '
header:
frame_id: "map"
pose:
position:
x: 5.0
y: 5.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0'
8. rviz2에서 goal_pose도 추가
ros2 param get /planner_server planner_plugins
'gazebo' 카테고리의 다른 글
| 터틀봇을 다른 맵에 spawn해보기 - (터틀봇 spawn위치 설정) (0) | 2025.04.17 |
|---|---|
| gazebo path planning 다시해보기.... 3주차 (0) | 2025.04.04 |
| forklift model 만들기 ( gz sim ) (0) | 2025.03.26 |
| gazebo turtlebot path planning (0) | 2025.03.21 |
| gz sim과 turtlebot에서 slam으로 작성한 맵 불러오기 (0) | 2025.03.20 |