gazebo

gazebo path planning 시뮬레이션 해보기 정리...

정지홍 2025. 3. 28. 15:41

nav2.yaml
0.01MB

 

my_map.yaml
0.00MB

 

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