Git Product home page Git Product logo

hybrid_a_star's Introduction

Hybrid A Star

1. Introduce

Hybrid A Star achieved very good results in the DARPA Urban Challenge. And after years of development, the algorithm has been verified to perform very well in parking and some autonomous driving environments without driving rules.

Since the author did not open source the algorithm, it took me weeks to reproduce the algorithm. The final result is close to the speed and effect in the paper.

Video 0: bilibili | YouTube

Video 1: bilibili | YouTube

Case 1

img0

Case 2

img3

Case 3

img1

Case 4

img2

2. Prerequisites

(1). C++11 or C++0x Compiler

(2). ROS Melodic: I'm developing on the melodic version. Using other versions of ROS 1, it should also work normally

sudo apt-get install ros-melodic-costmap-*
sudo apt-get install ros-melodic-map-server
sudo apt-get install ros-melodic-tf

(3). Eigen 3

sudo apt-get install libeigen3-dev

(4). glog

sudo apt-get install libgoogle-glog-dev

3. Build Hybrid A Star

# new folder
mkdir hybrid_a_star_ws/src -p
cd hybrid_a_star_ws/src

# Clone the repository
git clone https://github.com/zm0612/Hybrid_A_Star.git

# Build
cd hybrid_a_star_ws
catkin_make

4. Run Hybrid A Star

source devel/setup.bash
roslaunch hybrid_a_star run_hybrid_a_star.launch

The starting point is selected by the 2D Pose Estimate in rviz, and the end point is selected by the 2D Nav Goal.

I provide multiple maps, you just need to modify the variable image in hybrid_a_star/maps/map.yaml file.

If your start and end points are too close to obstacles, the collision detection mechanism may be triggered and no feasible paths will be searched and displayed

5. References

(1). Practical Search Techniques in Path Planning for Autonomous Driving

(2). The Bresenham Line-Drawing Algorithm

(3). A simple car

hybrid_a_star's People

Contributors

zm0612 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hybrid_a_star's Issues

About the direction of published target path

Your source code for the Hybrid A* algorithm is really great. I'm grateful that you shared the source code. I have one question though. When I define the initial pose and goal pose, the goal path is generated using the HA algorithm, but it seems that the direction of the path (Forward, Backward) is not being published. To apply the generated goal path to vehicle control, I need the direction of the goal path. How can I obtain it from the source code? I know you're busy, but I would appreciate a response whenever you have time. Thank you in advance.

有时规划会进入死循环

规划rs曲线成功之后,在while循环中从goal_node_ptr指向parent_node会偶尔出现指向同一地址导致死循环是因为什么

Current implementation only starts planning a new path once old path is complete

Hi,

The current implementation only starts planning the next path once the previous path is complete. In my implementation, I want to make sure that if I give a start and goal; it should plan from that start to the goal. Then, if in between I give another start and goal, the car should jump to the new start and then start planning to the new goal and so on. It should not do it from the start position and only when the previous path is complete. Is it possible with the current implementation? Please reply.

Thank you.

参数调教

Hi, 非常感谢您的工作!

我注意到在launch文件下有很多的参数, 请问这些参数所代表的含义以及如何进行调教, 是否有相关的文档呢?

非常感谢~~

倒车路径

请问倒车的path是怎么和前进的区分开的呢

Modify the value of resolution under file map.yaml

An error is reported after modifying the variable value of resolution under file map.yaml.
When I modify the variable resolution value to a decimal less than 1, an error will be reported. The specific error information is as follows:
[run_hybrid_astar-6] process has died [pid 21446, exit code -11, cmd /home/klxxxx/Documents/src715/devel/lib/hybrid_a_star/run_hybrid_astar __name:=run_hybrid_astar __log:=/home/klxxxx/.ros/log/c3eeeb6c-fe94-11ec-a59d-1c1b0da6edc7/run_hybrid_astar-6.log].
log file: /home/klxxxx/.ros/log/c3eeeb6c-fe94-11ec-a59d-1c1b0da6edc7/run_hybrid_astar-6*.log

confusion between map_grid_resolution vs state_grid_resolution

Hi dear,

First, you made an amazing job here ! your code is really clean and understandable at some point.

Now, i'm trying to integrate your implementation as a global planner into the pipeline of the navigation stack in ROS. I'm almost done but there is few things that did not work well specially with obstacle collision setup ! i'm thinking in the initialization of the costmap ( occupancy grid) because i did some changes there as i was having some troubles with segmentation fault.

for example : i have a map with a resolution of 0.025 m/p and i setup the map_resolution parameter to 1 because i want to use the same resolution for the map grid and state grid. However i think that i did not manage to understand well the subtlety between the map_grid_resolution and state_grid_resolution.

Last thing, why you are using this to iterate over the map to set the obstacle :

for (unsigned int w = 0; w < map_w; ++w) {
            for (unsigned int h = 0; h < map_h; ++h) {
                auto x = static_cast<unsigned int> ((w + 0.5) * map_resolution
                                                    / current_costmap_ptr_->info.resolution);
                auto y = static_cast<unsigned int> ((h + 0.5) * map_resolution
                                                    / current_costmap_ptr_->info.resolution);
               if (current_costmap_ptr_->data[y * current_costmap_ptr_->info.width + x]) {
                    kinodynamic_astar_searcher_ptr_->SetObstacle(w, h);
                }
} 

Instead of just iterating over the map directly like this :

for (unsigned int w = 0; w < map_w; ++w) {
            for (unsigned int h = 0; h < map_h; ++h) {
               
               if (current_costmap_ptr_->data[h * current_costmap_ptr_->info.width + w]) {
                    kinodynamic_astar_searcher_ptr_->SetObstacle(w, h);
                }
}

For sure that there is an obvious reason here but i can't catch it.

If this is not relevant, please feel free to close the issue.

Thank you !

Ask for help!

您好,十分感谢您查看我的留言。我今年是一名研一自动化专业的学生,学习方向也是路径规划,由于直接的代码能力十分有限。想请教一下您是如何将算法实现并且在ros上进行可视化的呢?此外,还想向你请教一下,路径规划学习有没有什么建议。感谢您的阅读,期待你的回信。

use a map with resolution other than 1.0 will raise errors

If I use a custom map (resolution: 0.5), run run_hybrid_a_star.launch will raise following errors:

Stack trace (most recent call last):
#4    Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#3    Object "/home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar", at 0x55f7fd649d4d, in 
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff9423c0082, in __libc_start_main
#1    Object "/home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar", at 0x55f7fd649bd7, in 
#0    Object "/home/ashley/catkin_ws/devel/lib/libPATH_SEARCHER_LIB.so", at 0x7ff942a10910, in HybridAStarFlow::Run()
Segmentation fault (Invalid permissions for mapped object [0x7ff930021980])
[run_hybrid_astar-7] process has died [pid 74874, exit code -11, cmd /home/ashley/catkin_ws/devel/lib/hybrid_a_star/run_hybrid_astar __name:=run_hybrid_astar __log:=/home/ashley/.ros/log/c1b9ff38-d1f8-11ee-829d-63b789bf8946/run_hybrid_astar-7.log].
log file: /home/ashley/.ros/log/c1b9ff38-d1f8-11ee-829d-63b789bf8946/run_hybrid_astar-7*.log

I think there is a bug in src/hybrid_a_star_flow.cpp

void HybridAStarFlow::Run() {
 // #95
  unsigned int map_w = std::floor(current_costmap_ptr_->info.width / map_resolution);
  unsigned int map_h = std::floor(current_costmap_ptr_->info.height / map_resolution);
}

add * current_costmap_ptr_->info.resolution can fix it.

ERROR: cannot launch node of type

Hi,
Thanks for your code. I compile this pkg successfully, however I met a issue when running the pkg using your launch file.

ERROR: cannot launch node of type [hybrid_a_star/run_hybrid_astar]: Cannot locate node of type [run_hybrid_astar] in package [hybrid_a_star]. Make sure file exists in package path and permission is set to executable (chmod +x)

Can you help me sovle this issue please? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.