racecar 开源项目,修改使用仿真测试
Go to file
2025-04-12 10:42:56 +08:00
src first commit 2025-04-12 10:42:56 +08:00
.gitignore first commit 2025-04-12 10:42:56 +08:00
README.md first commit 2025-04-12 10:42:56 +08:00

racecar_ws explain

Gazebo 3D simulator example of ROS tutorials (version: melodic)

Tested on Ubuntu 18.04

Getting Started

Save the world map

  1. git clone
git clone https://git.toluckykoi.com/ROS_Robot/racecar_ws.git
  1. Dependencies and build
cd racecar_ws
./src/racecar_gazebo/scripts/install_for_env.sh

catkin_make
  1. Start the gazebo map
roslaunch racecar_gazebo racecar_runway.launch

1

You should download the gazebo models or the map won't work.

git clone https://git.toluckykoi.com/ROS_Robot/gazebo_models.git ~/.gazebo/models
  1. Open a new terminal and start rviz
roslaunch racecar_gazebo slam_gmapping.launch 

Control the car with WASD keys and draw the whole map.

2

  1. Save the map
rosrun map_server map_saver -f ~/racecar_ws/src/racecar/racecar_gazebo/map/map_runway

Path planning and automatic navigation

  1. Start navigation and the gazebo map
roslaunch racecar_gazebo racecar_runway_navigation.launch
  1. Start rviz
roslaunch racecar_gazebo racecar_rviz.launch

3

  1. Click 2D Nav Goal then click the goal on the rviz map (hold down the cursor to set the goal pose)

  2. Start the navigation script

rosrun racecar_gazebo path_pursuit.py

4

FAQ

Error: opencv not found

  1. find OpenCVConfig.cmake
sudo apt install locate
sudo updatedb
locate OpenCVConfig.cmake
  1. edit CMakeLists.txt and replace OpenCV_DIR with the correct OpenCV path replace this line
set(OpenCV_DIR /opt/ros/kinetic/share/OpenCV-3.3.1-dev/)

with the correct OpenCV path