Pure tracking algorithm simulation

insert image description here

overview

Use C++ and ros to implement pure tracking simulation in gazebo.

Environmental preparation

sudo apt-get install -y ros-noetic-gazebo-ros-control
sudo apt-get install -y ros-noetic-ros-control ros-noetic-ros-controllers
sudo apt-get install -y ros-noetic-gazebo-ros-control

Create workspace catkin_ws

0. 克隆工程
  git clone https://github.com/NeXTzhao/planning.git

1.创建src文件,放置功能包源码:
  mkdir -p ~/catkin_ws/src

2.进入src文件夹
  cd ~/catkin_ws/src

3.将路径ros/src下的功能包复制粘贴到创建的src目录下

4.初始化文件夹
  catkin_init_workspace

5.编译工作空间catkin_make
  cd ~/catkin_ws/
  catkin_make

PS: Remember to modify the path of the smart.xacro car model, otherwise the car model will not be displayed normally after running the relevant instructions.
insert image description here

Run pure tracking algorithm

Implementation ideas:

  • Use spline interpolation for simple trajectory generation
  • Write pure_pursuit pure path tracking algorithm to track the generated trajectory

Operation steps: (Open a new terminal window)

source devel/setup.sh
roslaunch car_model spawn_car.launch
roslaunch purepursuit splinepath.launch 
roslaunch purepursuit purepursuit.launch
rviz 中add /splinepoints /rvizpath  /smart(在rviz显示中,红色为小车运动轨迹,绿色为规划模块给出的轨迹)

insert image description here

reference

https://blog.csdn.net/qq_37268205/article/details/120992607?ops_request_misc=&request_id=&biz_id=102&utm_term=%E7%BA%AF%E8%B7%9F%E8%B8%AA%20%20ros&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-5-120992607.nonecase&spm=1018.2226.3001.4187

Guess you like

Origin blog.csdn.net/weixin_42990464/article/details/132715630