GithubHelp home page GithubHelp logo

hkust-aerial-robotics / fast-planner Goto Github PK

View Code? Open in Web Editor NEW
2.4K 54.0 663.0 147.92 MB

A Robust and Efficient Trajectory Planner for Quadrotors

License: GNU General Public License v3.0

CMake 9.18% C++ 51.70% Python 9.79% Makefile 19.38% C 2.48% Shell 1.52% Common Lisp 4.42% CSS 0.35% Cuda 1.12% HTML 0.02% Fortran 0.04%
autonomous-navigation uav motion-planning aerial-robotics

fast-planner's Introduction

Fast-Planner

Fast-Planner is developed aiming to enable quadrotor fast flight in complex unknown environments. It contains a rich set of carefully designed planning algorithms. It also provides a foundational code framework and algorithms that support several popular open-source drone projects, including ego-planner, FUEL and RACER, etc.

News:

  • Mar 13, 2021: Code for fast autonomous exploration is available now! Check this repo for more details.

  • Oct 20, 2020: Fast-Planner is extended and applied to fast autonomous exploration. Check this repo for more details.

Authors: Boyu Zhou and Shaojie Shen from the HUKST Aerial Robotics Group, Fei Gao from ZJU FAST Lab.

Complete videos: video1, video2, video3. Demonstrations about this work have been reported on the IEEE Spectrum: page1, page2, page3 (search for HKUST in the pages).

To run this project in minutes, check Quick Start. Check other sections for more detailed information.

Please kindly star ⭐ this project if it helps you. We take great efforts to develope and maintain it 😁😁.

Table of Contents

1. Quick Start

The project has been tested on Ubuntu 16.04(ROS Kinetic) and 18.04(ROS Melodic). Take Ubuntu 18.04 as an example, run the following commands to setup:

  sudo apt-get install libarmadillo-dev ros-melodic-nlopt
  cd ${YOUR_WORKSPACE_PATH}/src
  git clone https://github.com/HKUST-Aerial-Robotics/Fast-Planner.git
  cd ../ 
  catkin_make

You may check the detailed instruction to setup the project. After compilation you can start the visualization by:

  source devel/setup.bash && roslaunch plan_manage rviz.launch

and start a simulation (run in a new terminals):

  source devel/setup.bash && roslaunch plan_manage kino_replan.launch

You will find the random map and the drone in Rviz. You can select goals for the drone to reach using the 2D Nav Goal tool. A sample simulation is showed here.

2. Algorithms and Papers

The project contains a collection of robust and computationally efficient algorithms for quadrotor fast flight:

  • Kinodynamic path searching
  • B-spline-based trajectory optimization
  • Topological path searching and path-guided optimization
  • Perception-aware planning strategy (to appear)

These methods are detailed in our papers listed below.

Please cite at least one of our papers if you use this project in your research: Bibtex.

All planning algorithms along with other key modules, such as mapping, are implemented in fast_planner:

  • plan_env: The online mapping algorithms. It takes in depth image (or point cloud) and camera pose (odometry) pairs as input, do raycasting to update a probabilistic volumetric map, and build an Euclidean signed distance filed (ESDF) for the planning system.
  • path_searching: Front-end path searching algorithms. Currently it includes a kinodynamic path searching that respects the dynamics of quadrotors. It also contains a sampling-based topological path searching algorithm to generate multiple topologically distinctive paths that capture the structure of the 3D environments.
  • bspline: A implementation of the B-spline-based trajectory representation.
  • bspline_opt: The gradient-based trajectory optimization using B-spline trajectory.
  • active_perception: Perception-aware planning strategy, which enable to quadrotor to actively observe and avoid unknown obstacles, to appear in the future.
  • plan_manage: High-level modules that schedule and call the mapping and planning algorithms. Interfaces for launching the whole system, as well as the configuration files are contained here.

Besides the folder fast_planner, a lightweight uav_simulator is used for testing.

3. Setup and Config

Prerequisites

  1. Our software is developed and tested in Ubuntu 16.04(ROS Kinetic) and 18.04(ROS Melodic). Follow the documents to install Kinetic or Melodic according to your Ubuntu version.

  2. We use NLopt to solve the non-linear optimization problem. The uav_simulator depends on the C++ linear algebra library Armadillo. The two dependencies can be installed by the following command, in which ${ROS_VERSION_NAME} is the name of your ROS release.

sudo apt-get install libarmadillo-dev ros_${ROS_VERSION_NAME}_nlopt

Build on ROS

After the prerequisites are satisfied, you can clone this repository to your catkin workspace and catkin_make. A new workspace is recommended:

  cd ${YOUR_WORKSPACE_PATH}/src
  git clone https://github.com/HKUST-Aerial-Robotics/Fast-Planner.git
  cd ../
  catkin_make

If you encounter problems in this step, please first refer to existing issues, pull requests and Google before raising a new issue.

Now you are ready to run a simulation.

Use GPU Depth Rendering (can be skipped optionally)

This step is not mandatory for running the simulations. However, if you want to run the more realistic depth camera in uav_simulator, installation of CUDA Toolkit is needed. Otherwise, a less realistic depth sensor model will be used.

The local_sensing package in uav_simulator has the option of using GPU or CPU to render the depth sensor measurement. By default, it is set to CPU version in CMakeLists:

set(ENABLE_CUDA false)
# set(ENABLE_CUDA true)

However, we STRONGLY recommend the GPU version, because it generates depth images more like a real depth camera. To enable the GPU depth rendering, set ENABLE_CUDA to true, and also remember to change the 'arch' and 'code' flags according to your graphics card devices. You can check the right code here.

    set(CUDA_NVCC_FLAGS 
      -gencode arch=compute_61,code=sm_61;
    ) 

For installation of CUDA, please go to CUDA ToolKit

4. Run Simulations

Run Rviz with our configuration firstly:

  <!-- go to your workspace and run: -->
  source devel/setup.bash
  roslaunch plan_manage rviz.launch

Then run the quadrotor simulator and Fast-Planner. Several examples are provided below:

Kinodynamic Path Searching & B-spline Optimization

In this method, a kinodynamic path searching finds a safe, dynamically feasible, and minimum-time initial trajectory in the discretized control space. Then the smoothness and clearance of the trajectory are improved by a B-spline optimization. To test this method, run:

  <!-- open a new terminal, go to your workspace and run: -->
  source devel/setup.bash
  roslaunch plan_manage kino_replan.launch

Normally, you will find the randomly generated map and the drone model in Rviz. At this time, you can trigger the planner using the 2D Nav Goal tool. When a point is clicked in Rviz, a new trajectory will be generated immediately and executed by the drone. A sample is displayed below:

Related algorithms are detailed in this paper.

Topological Path Searching & Path-guided Optimization

This method features searching for multiple trajectories in distinctive topological classes. Thanks to the strategy, the solution space is explored more thoroughly, avoiding local minima and yielding better solutions. Similarly, run:

  <!-- open a new terminal, go to your workspace and run: -->
  source devel/setup.bash
  roslaunch plan_manage topo_replan.launch

then you will find the random map generated and can use the 2D Nav Goal to trigger the planner:

Related algorithms are detailed in this paper.

Perception-aware Replanning

The code will be released after the publication of associated paper.

5. Use in Your Application

If you have successfully run the simulation and want to use Fast-Planner in your project, please explore the files kino_replan.launch or topo_replan.launch. Important parameters that may be changed in your usage are contained and documented.

Note that in our configuration, the size of depth image is 640x480. For higher map fusion efficiency we do downsampling (in kino_algorithm.xml, skip_pixel = 2). If you use depth images with lower resolution (like 256x144), you might disable the downsampling by setting skip_pixel = 1. Also, the depth_scaling_factor is set to 1000, which may need to be changed according to your device.

Finally, for setup problem, like compilation error caused by different versions of ROS/Eigen, please first refer to existing issues, pull request, and Google before raising a new issue. Insignificant issue will receive no reply.

6. Updates

  • Oct 20, 2020: Fast-Planner is extended and applied to fast autonomous exploration. Check this repo for more details.

  • July 5, 2020: We will release the implementation of paper: RAPTOR: Robust and Perception-aware Trajectory Replanning for Quadrotor Fast Flight (submitted to TRO, under review) in the future.

  • April 12, 2020: The implementation of the ICRA2020 paper: Robust Real-time UAV Replanning Using Guided Gradient-based Optimization and Topological Paths is available.

  • Jan 30, 2020: The volumetric mapping is integrated with our planner. It takes in depth image and camera pose pairs as input, do raycasting to fuse the measurements, and build a Euclidean signed distance field (ESDF) for the planning module.

Known issues

Compilation issue

When running this project on Ubuntu 20.04, C++14 is required. Please add the following line in all CMakelists.txt files:

set(CMAKE_CXX_STANDARD 14)

Unexpected crash

If the planner dies after triggering a 2D Nav Goal, it is possibly caused by the ros-nlopt library. In this case, we recommend to uninstall it and install nlopt following the official document. Then in the CMakeLists.txt of bspline_opt package, change the associated lines to link the nlopt library:

find_package(NLopt REQUIRED)
set(NLopt_INCLUDE_DIRS ${NLOPT_INCLUDE_DIR})

...

include_directories( 
    SYSTEM 
    include 
    ${catkin_INCLUDE_DIRS}
    ${Eigen3_INCLUDE_DIRS} 
    ${PCL_INCLUDE_DIRS}
    ${NLOPT_INCLUDE_DIR}
)

...

add_library( bspline_opt 
    src/bspline_optimizer.cpp 
    )
target_link_libraries( bspline_opt
    ${catkin_LIBRARIES} 
    ${NLOPT_LIBRARIES}
    # /usr/local/lib/libnlopt.so
    )  

Acknowledgements

We use NLopt for non-linear optimization.

Licence

The source code is released under GPLv3 license.

Disclaimer

This is research code, it is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of merchantability or fitness for a particular purpose.

fast-planner's People

Contributors

bharat787 avatar zbylgsc 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  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

fast-planner's Issues

Ubuntu 18.04

Guys, any pointers on how to install it in Ubuntu 18.04?

Topo planner crash when planning short distance.

Please see log below.
When you set goal near by start point, planner is crashed as below.
Why this crash happen?

Screenshot from 2020-04-17 12-41-47

process[fast_planner_node-1]: started with pid [15354]
process[traj_server-2]: started with pid [15355]
process[waypoint_generator-3]: started with pid [15356]
process[random_forest-4]: started with pid [15357]
process[quadrotor_simulator_so3-5]: started with pid [15367]
hit: 0.619039
miss: -0.619039
min log: -1.99243
max: 2.19722
thresh log: 1.38629
process[so3_control-6]: started with pid [15410]
process[so3_disturbance_generator-7]: started with pid [15411]
type is so3_control/SO3ControlNodelet
process[odom_visualization-8]: started with pid [15435]
process[pcl_render_node-9]: started with pid [15437]
[ WARN] [1587094882.514303067]: Finished generate random map 
[ WARN] [1587094882.747413023]: Global Pointcloud received..
global map has points: 123474.
[ WARN] [1587094882.984987842]: [Traj server]: ready.
state: INIT
no trigger_.
state: INIT
no trigger_.
state: INIT
no trigger_.
state: INIT
no trigger_.
Triggered!
manual: -18.6728 0.603114        1
[FSM]: from INIT to WAIT_TARGET
[FSM]: from WAIT_TARGET to GEN_NEW_TRAJ
fast_planner_node: /usr/local/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:367: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(Eigen::Index, Eigen::Index) [with Derived = Eigen::Matrix<double, -1, -1>; Eigen::DenseCoeffsBase<Derived, 1>::Scalar = double; Eigen::Index = long int]: Assertion `row >= 0 && row < rows() && col >= 0 && col < cols()' failed.
Stack trace (most recent call last):
#17   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#16   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555570c49, in _start
#15   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7d1b96, in __libc_start_main
#14   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x56555556e320, in main
#13   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6fb87a, in ros::spin()
#12   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe712fe8, in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)
#11   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6baf7a, in ros::CallbackQueue::callAvailable(ros::WallDuration)
#10   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6b9b8b, in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*)
#9    Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe694a86, in ros::TimerManager<ros::Time, ros::Duration, ros::TimerEvent>::TimerQueueCallback::call()
#8    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555588695, in fast_planner::TopoReplanFSM::execFSMCallback(ros::TimerEvent const&)
#7    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x56555558813b, in fast_planner::TopoReplanFSM::callTopologicalTraj(int)
#6    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555591e13, in fast_planner::FastPlannerManager::planGlobalTraj(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)
#5    Object "/home/sjo/ws_fast/devel/lib/libpoly_traj.so", at 0x7efbfe3a5bbd, in minSnapTraj(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&)
#4    Object "/home/sjo/ws_fast/devel/lib/libpoly_traj.so", at 0x7efbfe3a8d9a, in Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1>::operator()(long, long)
#3    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7e0411, in __assert_fail
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7e0399, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7f0800, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7eee97, in gsignal
Aborted (Signal sent by tkill() 15354 1000)
[fast_planner_node-1] process has died [pid 15354, exit code -6, cmd /home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node /odom_world:=/state_ukf/odom /sdf_map/odom:=/state_ukf/odom /sdf_map/cloud:=/pcl_render_node/cloud /sdf_map/pose:=/pcl_render_node/camera_pose /sdf_map/depth:=/pcl_render_node/depth __name:=fast_planner_node __log:=/home/sjo/.ros/log/4bd5985e-805d-11ea-a7eb-00d8617c19f3/fast_planner_node-1.log].
log file: /home/sjo/.ros/log/4bd5985e-805d-11ea-a7eb-00d8617c19f3/fast_planner_node-1*.log

Few questions regarding the kino_replan demo

First of all, thank you for sharing this great piece of work!

I am testing the kino dynamic part and I have few questions for you:

  • I do not have cuda available so I use CPU only and I saw in this case that this is the pcl_render_node.cpp which is used to create point clouds.

In kino_replan.launch you mentioned that we need to choose between depth image or point cloud but actually in sdf_map.cpp, the /sdf_map/cloud topic is subscribed anyway so comment <arg name="cloud_topic" value="/pcl_render_node/cloud"/> in the kino_replan.launch file leads to an error at start.

  • When I run the demo, one thing I observe is that very often the target / traj to be track by the drone is really far ahead, see for instance the pic below:

Capture du 2020-09-04 10-39-53

and sometimes the drone is flying thru obstacles:
Capture du 2020-09-03 17-50-38

Do you know how can I handle these issues (or is it because my computer is too slow)? How to provide a new traj which is within a known small range from the current drone pose? fsm/thresh_replan is a parameter to tell when to replan and has no effect on the trajectory tracking.

  • the parameter traj_server/time_forward (kino_replan.launch) is not used in the code so far, do you plan to use it later on?

  • in the demo it is not possible to provide different z values unless we change the planning mode (2) and provide fixed waypoints?
    Thanks again for the great work

Question in topo_prm.cpp -> function <<needConnection>>

In the function "needConnection", if the checking for a shorter path is true, should the neighbor for both Graph node g1 and g2 need to be changed.
[OLD]
if (pathLength(path1) < pathLength(path2)) {
g1->neighbors_[i]->pos_ = pt;
// ROS_WARN("shorter!");
}
---->
[NEW]
if (pathLength(path1) < pathLength(path2)) {
g1->neighbors_[i]->pos_ = pt;
g2->neighbors_[j]->pos_ = pt;
// ROS_WARN("shorter!");
}
Or maybe I miss understanding some parts of code.

Where is heading_planner?

I see there is a series of parameters named "heading_planner" in topo_algorithm.xml. But I can not change them to reduce the yaw rate and find where they are in codes. Could you tell me what these parameters mean ?

two head files can not be found

image
swarmtal_msgs/drone_onboard_command.h and traj_generator/polynomial_traj.hpp can not be found in the project.
while the traj_generator.cpp does not be compiled in CMakeLists.txt
So the traj_generator.cpp is useless and should be deleted?

Can't install libarmadillo-dev

I'm sorry to bother you but I can't solve this issue by myself.I can't install libarmadillo-dev but I have installed libarmadillo6.I try sudo apt install -f but it failed.

[sudo] wbzhang233 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
没有可用的软件包 libarmadillo-dev,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到

E: 软件包 libarmadillo-dev 没有可安装候选

Code for RAPTOR

Hi,

Great work with the repo and papers, very impressive!
Huge thanks for making the code public, not only it's the best solution I've seen but it's also probably the only usable open code in this field.
Just wanted to ask if you are going to publish the code for RAPTOR paper as well (which you've added to readme), and if so do you have a time estimate?

Thanks!

some question about how to push node into open set in kinodynamic_astar.cpp

In file kinodynamic_astar.cpp, the code to judge whether a node has been in the closed set is:
Eigen::Vector3i pro_id = posToIndex(pro_state.head(3));
PathNodePtr pro_node = expanded_nodes_.find(pro_id);
The code only consider about the positon of the node while ignore the vecility.
Is it possible that, a node in the most optimal path can not be push into the open set because there has been another node with same position and different vecility?

Changing target pose on the way

Hi @ZbyLGsc
When I try to publish a new goal waypoint to /move_base_simple/goal while the drone is already on its way to a previous one, it does not change its trajectory to the new one and just continues to complete flying to the current goal. Is there a way to make the drone abort the current goal and change to the new one?

Eigen problem by running the demo topo_replan.launch

When I run: roslaunch plan_manage topo_replan.launch, and give a target point, it appears an error that:

Stack trace (most recent call last):
#13   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#12   Object "/home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x41c148, in _start
#11   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fb24fd2083f, in __libc_start_main
#10   Object "/home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x4197db, in main
#9    Object "/opt/ros/kinetic/lib/libroscpp.so", at 0x7fb252688e9a, in ros::spin()
#8    Object "/opt/ros/kinetic/lib/libroscpp.so", at 0x7fb2526a3e38, in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)
#7    Object "/opt/ros/kinetic/lib/libroscpp.so", at 0x7fb25264723a, in ros::CallbackQueue::callAvailable(ros::WallDuration)
#6    Object "/opt/ros/kinetic/lib/libroscpp.so", at 0x7fb252645837, in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*)
#5    Object "/opt/ros/kinetic/lib/libroscpp.so", at 0x7fb25261f2dc, in ros::TimerManager<ros::Time, ros::Duration, ros::TimerEvent>::TimerQueueCallback::call()
#4    Object "/home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x433927, in fast_planner::TopoReplanFSM::execFSMCallback(ros::TimerEvent const&)
#3    Object "/home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x43343e, in fast_planner::TopoReplanFSM::callTopologicalTraj(int)
#2    Object "/home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x43bdff, in fast_planner::FastPlannerManager::planGlobalTraj(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)
#1    Object "/home/daihn666/catkin_ws/devel/lib/libpoly_traj.so", at 0x7fb25233349e, in minSnapTraj(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&)
#0    Object "/home/daihn666/catkin_ws/devel/lib/libpath_searching.so", at 0x7fb253036dd0, in void Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >, Eigen::internal::assign_op<double> >(Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::internal::assign_op<double> const&)
Segmentation fault (Signal sent by the kernel [(nil)])
[fast_planner_node-1] process has died [pid 21125, exit code -11, cmd /home/daihn666/catkin_ws/devel/lib/plan_manage/fast_planner_node /odom_world:=/state_ukf/odom /sdf_map/odom:=/state_ukf/odom /sdf_map/cloud:=/pcl_render_node/cloud /sdf_map/pose:=/pcl_render_node/camera_pose /sdf_map/depth:=/pcl_render_node/depth __name:=fast_planner_node __log:=/home/daihn666/.ros/log/2003cfbe-d645-11ea-8617-485f9981cbdb/fast_planner_node-1.log].
log file: /home/daihn666/.ros/log/2003cfbe-d645-11ea-8617-485f9981cbdb/fast_planner_node-1*.log

I am not sure whether it is an Eigen problem or a stack problem. My Eigen version is 3.2.92. My college has also this version Eigen, but he can run this demo without problem.

Avoiding large obstacles

Hi @ZbyLGsc
I am trying to use topo_replan in Gazebo simulation setup where I have some large obstacles like building and warehouses. With the default parameters of topo_replan, the drone doesn't find a good path around, e.g. large building (see attached picture) and ends up crashing into it. I would like to know what parameters can be tuned to be able to avoid such large obstacles (not necessarily flat objects).

Thanks
gazebo

[Topo] Unable to plan through wall object

First of all, Fast planner's kino & topo both algorithms are works exceptionally.

However, I found topo planner cannot plan through the flat wall-shaped object,
I think the planner wouldn't have much problem finding a bypass path through wall.
I don't know problem maybe a simple issue behind or limitation of local map strategy.

  1. Problem in sdf map couldn't update depth properly as picture below,

Screenshot from 2020-04-22 15-32-25

  1. Another problem is path twists then vehicle moves like uncontrolled then program crashes as follows

Peek Program Dies

crash log

[ INFO] [1587540352.802406181]: iter num: 82
plan heading: 0.00013925
[FSM]: from REPLAN_TRAJ to EXEC_TRAJ
[FSM]: from EXEC_TRAJ to REPLAN_TRAJ
[ERROR] [1587540353.298135604]: max vel: 18.056680, max acc: 134.117603.
ratio: 11.5809
[ INFO] [1587540353.298351864]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.303459633]: iter num: 118
[ WARN] [1587540353.303508063]: [Refine]: cost 0.00540908 seconds, time change is: 49.9948
[ INFO] [1587540353.303544483]: plan yaw
[ INFO] [1587540353.303825133]: cost func: smooth | waypt |
[ INFO] [1587540353.304844822]: iter num: 96
plan heading: 0.00134053
[FSM]: from REPLAN_TRAJ to EXEC_TRAJ
state: EXEC_TRAJ
[ WARN] [1587540353.411409102]: current traj 2.786250 m to collision
[SAFETY]: from EXEC_TRAJ to REPLAN_TRAJ
[ INFO] [1587540353.419981248]: [Topo]: ---------
[Topo]: sample num: 384, raw path num: 1, 1, pruned path num: 1, select path num: 1, pruned path num: 1
[Topo]: total time: 0.00546091, graph: 0.00504886, search: 4.75e-06, short: 0.00019535, prune: 1.1e-06, select: 0.00021085
[ INFO] [1587540353.425513227]: [Optimize]: ---------
[ INFO] [1587540353.425726917]: cost func: smooth | guide |
[ INFO] [1587540353.425825637]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.430891275]: iter num: 155
[ INFO] [1587540353.430929115]: optimization 0 cost 0.000125, 0.000126, 0.005095 seconds.
[planner]: optimization time: 0.00544329
ratio: 0.82771
[ INFO] [1587540353.431084045]: cost func: smooth | dist  | feasi |
[ WARN] [1587540353.433768794]: [Optimization]: nlopt exception
nlopt failure
[ INFO] [1587540353.433793784]: iter num: 196
[ WARN] [1587540353.433808124]: [Refine]: cost 0.0028037 seconds, time change is: -7.62869
[ INFO] [1587540353.433830364]: plan yaw
[ INFO] [1587540353.433959994]: cost func: smooth | waypt |
[ INFO] [1587540353.434395264]: iter num: 90
plan heading: 0.00057517
[FSM]: from REPLAN_TRAJ to EXEC_TRAJ
[ WARN] [1587540353.461693427]: current traj 4.518979 m to collision
[SAFETY]: from EXEC_TRAJ to REPLAN_TRAJ
[ INFO] [1587540353.464955076]: [Topo]: ---------
[Topo]: sample num: 377, raw path num: 4, 4, pruned path num: 1, select path num: 1, pruned path num: 1
[Topo]: total time: 0.00562946, graph: 0.00506682, search: 8.01e-06, short: 0.00024741, prune: 6.357e-05, select: 0.00024365
[ INFO] [1587540353.470637283]: [Optimize]: ---------
[ INFO] [1587540353.470903393]: cost func: smooth | guide |
[ INFO] [1587540353.471002653]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.475683792]: iter num: 230
[ INFO] [1587540353.475716072]: optimization 0 cost 0.000167, 0.000127, 0.004708 seconds.
[planner]: optimization time: 0.00510211
ratio: 1.24659
[ INFO] [1587540353.475899912]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.476831152]: iter num: 65
[ WARN] [1587540353.476859862]: [Refine]: cost 0.00108291 seconds, time change is: 1.33538
[ INFO] [1587540353.476894742]: plan yaw
[ INFO] [1587540353.476950172]: cost func: smooth | waypt |
[ INFO] [1587540353.477057692]: iter num: 70
plan heading: 0.00016601
[FSM]: from REPLAN_TRAJ to EXEC_TRAJ
[ WARN] [1587540353.511636152]: current traj 5.667316 m to collision
[SAFETY]: from EXEC_TRAJ to REPLAN_TRAJ
[ INFO] [1587540353.514968071]: [Topo]: ---------
[Topo]: sample num: 402, raw path num: 2, 2, pruned path num: 1, select path num: 1, pruned path num: 1
[Topo]: total time: 0.00539363, graph: 0.00505092, search: 5.5e-06, short: 0.00018369, prune: 1.691e-05, select: 0.00013661
[ INFO] [1587540353.520402800]: [Optimize]: ---------
[ INFO] [1587540353.520609510]: cost func: smooth | guide |
[ INFO] [1587540353.520718130]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.523657598]: iter num: 184
[ INFO] [1587540353.523692988]: optimization 0 cost 0.000151, 0.000116, 0.002974 seconds.
[planner]: optimization time: 0.00331785
ratio: 1.19515
[ INFO] [1587540353.523854558]: cost func: smooth | dist  | feasi |
[ INFO] [1587540353.526090387]: iter num: 190
[ WARN] [1587540353.526111657]: [Refine]: cost 0.00236315 seconds, time change is: 1.24586
[ INFO] [1587540353.526134047]: plan yaw
[ INFO] [1587540353.526183077]: cost func: smooth | waypt |
[ INFO] [1587540353.526313267]: iter num: 82
plan heading: 0.00018699
[FSM]: from REPLAN_TRAJ to EXEC_TRAJ
[ WARN] [1587540353.563552466]: current traj 5.646009 m to collision
[SAFETY]: from EXEC_TRAJ to REPLAN_TRAJ
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Stack trace (most recent call last):
#21   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#20   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555570d19, in _start
#19   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc7f7b96, in __libc_start_main
#18   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x56555556e3f0, in main
#17   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe72187a, in ros::spin()
#16   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe738fe8, in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)
#15   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6e0f7a, in ros::CallbackQueue::callAvailable(ros::WallDuration)
#14   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6dfb8b, in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*)
#13   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7efbfe6baa86, in ros::TimerManager<ros::Time, ros::Duration, ros::TimerEvent>::TimerQueueCallback::call()
#12   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555588955, in fast_planner::TopoReplanFSM::execFSMCallback(ros::TimerEvent const&)
#11   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555587ab4, in fast_planner::TopoReplanFSM::callTopologicalTraj(int)
#10   Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x5655555931f7, in fast_planner::FastPlannerManager::topoReplan(bool)
#9    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555591342, in fast_planner::FastPlannerManager::reparamLocalTraj(double, double&, double&)
#8    Object "/home/sjo/ws_fast/devel/lib/libbspline.so", at 0x7efbfee6ee48, in fast_planner::NonUniformBspline::parameterizeToBspline(double const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&)
#7    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x565555597c0f, in Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::resize(long, long)
#6    Object "/home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node", at 0x56555559459d, in Eigen::internal::throw_std_bad_alloc()
#5    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7efbfd20fd53, in __cxa_throw
#4    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7efbfd20fb20, in std::terminate()
#3    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7efbfd20fae5, in
#2    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7efbfd209956, in
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc816800, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7efbfc814e97, in gsignal
Aborted (Signal sent by tkill() 23295 1000)
[fast_planner_node-2] process has died [pid 23295, exit code -6, cmd /home/sjo/ws_fast/devel/lib/plan_manage/fast_planner_node /odom_world:=/state_ukf/odom /sdf_map/odom:=/state_ukf/odom /sdf_map/cloud:=/map_generator/global_cloud_no_use /sdf_map/pose:=/pcl_render_node/camera_pose /sdf_map/depth:=/pcl_render_node/depth __name:=fast_planner_node __log:=/home/sjo/.ros/log/735868d2-846a-11ea-99e5-00d8617c19f3/fast_planner_node-2.log].
log file: /home/sjo/.ros/log/735868d2-846a-11ea-99e5-00d8617c19f3/fast_planner_node-2*.log

To Reproduce

I made wall object with tiny modification on polar object generation code in map_generator package as follow

original

for (int r = -widNum / 2.0; r < widNum / 2.0; r++)

modifed for wall object

    for (int r = -5; r < 5; r++)

For reproduction, use launch files attached.
topo-wall.zip

Frequent aggresive wrong motion of quadrotor

Hi.
First of all thank you for sharing great work!

I found an issue during the simulation.
That it is often observed that quadrotor model follows trajectory undesirable way
that the vehicle flip towards wrong direction then return & starts to follow trajectory (See GIF below)

This easily can be observed especially when transitioning from stopped state(WAIT_TARGET) to executing new trajectory(EXEC_TRAJ) or rarely seen while following trajectory.

I'd like to know why and is this can easily be solved?

Thanks in advance.

P.S. Launch file & parameters are left untouched.
Peek 2020-01-15 19-53

About flying height

This is absolute great work!
But Is it possible to limit or fix the flying height? because it plans to fly over a wall.
Screenshot from 2019-11-22 19-36-20

Screenshot from 2019-11-22 19-37-40

segmentation fault error

The change in the pr #4 has been done to build it under Ubuntu 18.04. The segmentation fault error occurs when I set the 2D nav goal in rviz:

Stack trace (most recent call last):
#4 Object "[0x7ffe7d4eb93f]", at 0x7ffe7d4eb93f, in
#3 Object "/home/colin/Repos/catkin_fast_planner/devel/lib/libpath_searching.so", at 0x7ff6fd00cf82, in
#2 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7ff6fab22d06, in _Unwind_Resume
#1 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7ff6fab223e5, in
#0 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7ff6fab21f34, in
Segmentation fault (Signal sent by the kernel [(nil)])
[fast_planner_node-1] process has died [pid 19276, exit code -11, cmd /home/colin/Repos/catkin_fast_planner/devel/lib/plan_manage/fast_planner_node /odom_world:=/state_ukf/odom /sdf_map/odom:=/state_ukf/odom /sdf_map/cloud:=/pcl_render_node/cloud /sdf_map/pose:=/pcl_render_node/camera_pose /sdf_map/depth:=/pcl_render_node/depth __name:=fast_planner_node __log:=/home/colin/.ros/log/5440e0a2-c9e1-11ea-980d-802bf9e83091/fast_planner_node-1.log].
log file: /home/colin/.ros/log/5440e0a2-c9e1-11ea-980d-802bf9e83091/fast_planner_node-1*.log

Does anyone has this problem? Thanks a lot

Fast planner crahes when trying to change altitude only

Hi @ZbyLGsc

When I try to send a goal point to just fly up ( from (0,0,0) to (0,0,1) ) and similarly fly down, the fast planner node crashes and I get the following output

Triggered!
manual: 0 0 1
[TRIG]: from WAIT_TARGET to GEN_NEW_TRAJ
[B-spline]:point set have only 1 points.
fast_planner_node: /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:285: void Eigen::PlainObjectBase<Derived>::resize(Eigen::Index, Eigen::Index) [with Derived = Eigen::Matrix<double, -1, -1>; Eigen::Index = long int]: Assertion `(!(RowsAtCompileTime!=Dynamic) || (rows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (cols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (rows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (cols<=MaxColsAtCompileTime)) && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."' failed.
Stack trace (most recent call last):
#17   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#16   Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f199690b69, in _start
#15   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2d3dce6b96, in __libc_start_main
#14   Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f19968e240, in main
#13   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f2d3fc0c88a, in ros::spin()
#12   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f2d3fc23ff8, in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)
#11   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f2d3fbcbf8a, in ros::CallbackQueue::callAvailable(ros::WallDuration)
#10   Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f2d3fbcab9b, in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*)
#9    Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f2d3fba5a96, in ros::TimerManager<ros::Time, ros::Duration, ros::TimerEvent>::TimerQueueCallback::call()
#8    Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f1996a8605, in fast_planner::TopoReplanFSM::execFSMCallback(ros::TimerEvent const&)
#7    Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f1996a80ab, in fast_planner::TopoReplanFSM::callTopologicalTraj(int)
#6    Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f1996b1f33, in fast_planner::FastPlannerManager::planGlobalTraj(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)
#5    Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f1996b7065, in fast_planner::GlobalTrajData::setLocalTraj(fast_planner::NonUniformBspline, double, double, double)
#4    Object "/home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node", at 0x55f1996b4b31, in fast_planner::NonUniformBspline::operator=(fast_planner::NonUniformBspline const&)
#3    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2d3dcf5411, in __assert_fail
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2d3dcf5399, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2d3dd05800, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2d3dd03e97, in gsignal
Aborted (Signal sent by tkill() 17028 1000)
[fast_planner_node-1] process has died [pid 17028, exit code -6, cmd /home/arrow/catkin_ws/devel/lib/plan_manage/fast_planner_node /odom_world:=/mavros/local_position/odom /sdf_map/odom:=/mavros/local_position/odom /sdf_map/cloud:=/camera/depth /sdf_map/pose:=/camera/pose /sdf_map/depth:=/camera/depth/image_raw __name:=fast_planner_node __log:=/home/arrow/.ros/log/0938d10e-b4b1-11ea-9acd-0242ac110003/fast_planner_node-1.log].
log file: /home/arrow/.ros/log/0938d10e-b4b1-11ea-9acd-0242ac110003/fast_planner_node-1*.log

I noted the following message

[B-spline]:point set have only 1 points.

Any idea on what the issue is?

Comparision of the Kinodynamic and Topological Path Searching

@ZbyLGsc Thank you for this great work~
I would like to know the different applicability (or the different trajectory style) between these two Path Searching methods, based on your flight tests. What i can see is that there are a lot of circular obstacles in the Topological simulation but not in the Kinodynamic one.
Also, will there be a third method in the future~~?

thread safety issues about map updatig

hello, I see that in map update thread , data was written to distance buffer. In other thread, data in distance was read. Does this exist thread safety issues?

it seems like there are two function in edu_envirment.cpp with return value missed

pair<double, Eigen::Vector3d> EDTEnvironment::interpolateTrilinear(double values[2][2][2],......)in line 59
and
pair<double, Eigen::Vector3d> EDTEnvironment::evaluateEDTWithGrad(const Eigen::Vector3d& pos,...,...)in line 82

it seems like these function do not return any thing
image

by the way, what does the abbreviate EDT means?
i only find Euclid Distance Field in the paper, but nothing with the abbreviate EDT.

questions about FastPlannerManager::planYaw()

Hi, I have some questions about the yaw plan function.

  1. How is this derived?
    states2pts << 1.0, -dt_yaw, (1 / 3.0) * dt_yaw * dt_yaw, 1.0, 0.0, -(1 / 6.0) * dt_yaw * dt_yaw, 1.0,
    dt_yaw, (1 / 3.0) * dt_yaw * dt_yaw;
  2. the size of control points is seg_num + 3, why ? I find that In calcWaypointsCost function there are only seg_num+2 control points being used to calc cost. Can I undestand that the extra point is used to contrain end_yaw? But I dont know how (states2pts * end_yaw and states2pts * start_yaw) works, as mentioned in ques 1.
    Thanks!

Install on Jetson Nano

There are a number of libraries (.so) in the project, what do I need to rebuild from for this to work under jetson nano?

Issue: [random_forest-5] process has died

There is a problem that the process of map_generator. Does anyone know how to deal with it? Thnaks

[ WARN] [1597058385.626132476]: Finished generate random map 
[random_forest-5] process has died [pid 32441, exit code -11, cmd /home/ziniu/Documents/hkust_ws/devel/lib/map_generator/random_forest ~odometry:=/state_ukf/odom __name:=random_forest __log:=/home/ziniu/.ros/log/6435ec34-dafb-11ea-bc80-0024d6f1973f/random_forest-5.log].
log file: /home/ziniu/.ros/log/6435ec34-dafb-11ea-bc80-0024d6f1973f/random_forest-5*.log
[ WARN] [1597058385.994766179]: [Traj server]: ready.

dyn_planner node issue

Hello,

Just reporting this error. The code is running though.

dyn_planner_node: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 36; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ***"' failed.
Stack trace (most recent call last):
#8 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#7 Object "/home/michael/catkin_ws/devel/lib/plan_manage/dyn_planner_node", at 0x412978, in _start
#6 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff76ad3d82f, in __libc_start_main
#5 Object "/home/michael/catkin_ws/devel/lib/plan_manage/dyn_planner_node", at 0x41248f, in main
#4 Object "/home/michael/catkin_ws/devel/lib/plan_manage/dyn_planner_node", at 0x42055e, in dyn_planner::PlanningFSM::init(ros::NodeHandle&)
#3 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff76ad4ac81, in __assert_fail
#2 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff76ad4abd6, in
#1 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff76ad54029, in abort
#0 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff76ad52428, in gsignal
Aborted (Signal sent by tkill() 27357 1000)
[ WARN] [1563280908.273078848]: Finished generate random map
[dyn_planner_node-1] process has died [pid 27357, exit code -6, cmd /home/michael/catkin_ws/devel/lib/plan_manage/dyn_planner_node /laser_cloud_surround:=/random_forest/all_map /odom_world:=/state_ukf/odom __name:=dyn_planner_node __log:=/home/michael/.ros/log/bdfb3aa8-a7c6-11e9-8a55-f894c28abe6b/dyn_planner_node-1.log].
log file: /home/michael/.ros/log/bdfb3aa8-a7c6-11e9-8a55-f894c28abe6b/dyn_planner_node-1
.log
[ WARN] [1563280944.450820443]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.
[ WARN] [1563281031.431866653]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.
[ WARN] [1563281075.151515836]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.
[ WARN] [1563281085.073110464]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.

KinodynamicAstar::estimateHeuristic

能回答一下,这个函数是从哪里来的吗?
const Vector3d dp = x2.head(3) - x1.head(3);//获取位置差
const Vector3d v0 = x1.segment(3, 3);//获取x1向量中第3个元素开始的3个元素;也就是起点速度
const Vector3d v1 = x2.segment(3, 3);

double c1 = -36 * dp.dot(dp);
double c2 = 24 * (v0 + v1).dot(dp);
double c3 = -4 * (v0.dot(v0) + v0.dot(v1) + v1.dot(v1));
double c4 = 0;
double c5 = w_time_;

std::vector ts = quartic(c5, c4, c3, c2, c1);

double v_max = max_vel_;
double t_bar = (x1.head(3) - x2.head(3)).lpNorm() / v_max;
ts.push_back(t_bar);

double cost = 100000000;
double t_d = t_bar;

for (auto t : ts)
{
if (t < t_bar)
continue;
double c = -c1 / (3 * t * t * t) - c2 / (2 * t * t) - c3 / t + w_time_ * t;
if (c < cost)
{
cost = c;
t_d = t;
}
}

optimal_time = t_d;

return 1.0 * (1 + tie_breaker_) * cost;

Try to use it in gazebo to control the drone

Hello

I try to subscribe /planning/pos_cmd topic to control the drone in gazebo, but I found that the planning has stopped and the topic also stopped publishing before the drone reaches the destination.

Can you tell me what I should do if I want to control my drone to fly along the planned path?

thanks

Add a description of the project

Hi guys, you have a very interesting project.
I want to try flying in the woods with your algorithm. However, your package descriptions are sorely lacking. Can we expect a description of the project in the near future?

Variables set but not used (-Wunused-but-set-variable errors)

Thank you for this great package for simulating MAV. I am running Ubuntu 16.04 with ROS kinetic and Gazebo9.
I would like to mention that I tried to compile the code but it giving many errors in the fast_planner package mainly in
polynomial_traj.cpp ,astar.cpp , kinodynamic_astar.cpp program files, and many more.

I look forward to hearing from you. Thank you for your valuable time.

want to save more maps

The default param only saves a little map and disappears quickly. If you increase the deth scaling factor, does it store more maps?

NonUniformBspline::getControlPointEqu3介绍

能否介绍一下这个函数?
Eigen::VectorXd prow(3), vrow(3), arow(3);
prow << 1, 4, 1;
vrow << -1, 0, 1;
arow << 1, -2, 1;
以上数值是根据什么取的?或者有公式吗?

Constructor error when install in Ubuntu18.04

When I try

catkin_make

I got results like this

/so3_control_nodelet.cpp:218:24: error: expected constructor, destructor, or type conversion before ‘(’ token
 PLUGINLIB_DECLARE_CLASS(so3_control, SO3ControlNodelet, SO3ControlNodelet,
                        ^
uav_simulator/so3_control/

Usage with Flight Controllers

Hi @ZbyLGsc ,

I would like to test planners in this project with an actual flight controller. What are the control commands (i.e. position/velocity/acceleration) that are sent to the flight controller?

Thanks.

Error during Compilation: cannot find -lpose_utils

Hi.
I am trying to compile this package using catkin build. Environment is Ubuntu 18 with ROS melodic. I am getting the following error. Could you please give some hints on how to solve this?
Thanks

Errors     << so3_disturbance_generator:make /home/aaal/catkin_ws/logs/so3_disturbance_generator/build.make.000.log                                                                                                                   
/usr/bin/ld: cannot find -lpose_utils
collect2: error: ld returned 1 exit status
make[2]: *** [/home/aaal/catkin_ws/devel/lib/so3_disturbance_generator/so3_disturbance_generator] Error 1
make[1]: *** [CMakeFiles/so3_disturbance_generator.dir/all] Error 2
make: *** [all] Error 2

Tremendous memory usage in ESDF map

I'm playing with the simulator and found that increasing map size tremendously consumes memory.
On my 64GB RAM desktop maximum available size is roughly 100 x 100 x 100 m with 0.1m resolution (removed uav simulator from launch) and increasing size further throws std::bad_alloc error

I think memory usage should be optimized much further if planner to be used at wider space or outdoor.

Only plan_manage/launch/simulation.launch is launched in this test.

Reducing map resolution reduces memory usage significantly but I'm worrying about the bad impact on planner solution.

Memory usage
Memory usage is 52.5GB

Before launch - using 6.8GB
Screenshot from 2020-01-17 16-27-08

After launch - using 59.3 GB
Screenshot from 2020-01-17 16-30-02

Simulation.launch file diff from master is as following

$ git diff simulation.launch
diff --git a/fast_planner/plan_manage/launch/simulation.launch b/fast_planner/plan_manage/launch/simulation.launch
index 42ba205..467ff11 100644
--- a/fast_planner/plan_manage/launch/simulation.launch
+++ b/fast_planner/plan_manage/launch/simulation.launch
@@ -1,9 +1,9 @@
 <launch>
 
   <!-- size of map, change the size in x, y, z according to your application -->
-  <arg name="map_size_x" value="40.0"/>
-  <arg name="map_size_y" value="40.0"/>
-  <arg name="map_size_z" value=" 5.0"/>
+  <arg name="map_size_x" value="100.0"/>
+  <arg name="map_size_y" value="100.0"/>
+  <arg name="map_size_z" value="100.0"/>
 
   <!-- topic of your odometry such as VIO or LIO -->
   <arg name="odom_topic" value="/state_ukf/odom" />
@@ -39,7 +39,7 @@
     <!-- 1: use 2D Nav Goal to select goal  -->
     <!-- 2: use global waypoints below  -->
     <arg name="flight_type" value="1" />
-    
+
     <!-- global waypoints -->
     <!-- If flight_type is set to 2, the drone will travel these waypoints one by one -->
     <arg name="point_num" value="3" />
@@ -61,13 +61,13 @@
   </include>
 
   <!-- use simulator. It should be disabled if a real drone is used -->
-  <include file="$(find plan_manage)/launch/simulator.xml">
+  <!-- <include file="$(find plan_manage)/launch/simulator.xml">
     <arg name="map_size_x_" value="$(arg map_size_x)"/>
     <arg name="map_size_y_" value="$(arg map_size_y)"/>
     <arg name="map_size_z_" value="$(arg map_size_z)"/>
 
      <arg name="odometry_topic" value="$(arg odom_topic)" />
-  </include>
+  </include> -->
 
   <!-- trajectory server and trigger, you don't need to change them -->
   <node pkg="plan_manage" name="traj_server" type="traj_server" output="screen">
@@ -78,10 +78,10 @@
   </node>
 
   <node pkg="waypoint_generator" name="waypoint_generator" type="waypoint_generator" output="screen">
-    <remap from="~odom" to="$(arg odom_topic)"/>        
+    <remap from="~odom" to="$(arg odom_topic)"/>
     <remap from="~goal" to="/move_base_simple/goal"/>
     <remap from="~traj_start_trigger" to="/traj_start_trigger" />
-    <param name="waypoint_type" value="manual-lonely-waypoint"/>    
+    <param name="waypoint_type" value="manual-lonely-waypoint"/>
   </node>

Console output

$ roslaunch plan_manage simulation.launch 
SUMMARY
========

PARAMETERS
 * /fast_planner_node/bspline/limit_acc: 1.0
 * /fast_planner_node/bspline/limit_ratio: 1.1
 * /fast_planner_node/bspline/limit_vel: 2.1
 * /fast_planner_node/fsm/flight_type: 1
 * /fast_planner_node/fsm/thresh_no_replan: 2.0
 * /fast_planner_node/fsm/thresh_replan: 1.5
 * /fast_planner_node/fsm/waypoint0_x: 19.0
 * /fast_planner_node/fsm/waypoint0_y: 0.0
 * /fast_planner_node/fsm/waypoint0_z: 1.0
 * /fast_planner_node/fsm/waypoint1_x: 0.0
 * /fast_planner_node/fsm/waypoint1_y: -19.0
 * /fast_planner_node/fsm/waypoint1_z: 1.0
 * /fast_planner_node/fsm/waypoint2_x: 0.0
 * /fast_planner_node/fsm/waypoint2_y: 19.0
 * /fast_planner_node/fsm/waypoint2_z: 1.0
 * /fast_planner_node/fsm/waypoint_num: 3
 * /fast_planner_node/manager/clearance_threshold: 0.2
 * /fast_planner_node/manager/control_points_distance: 0.4
 * /fast_planner_node/manager/dynamic_environment: 0
 * /fast_planner_node/manager/local_segment_length: 6.0
 * /fast_planner_node/manager/max_acc: 1.0
 * /fast_planner_node/manager/max_jerk: 4.0
 * /fast_planner_node/manager/max_vel: 2.1
 * /fast_planner_node/manager/use_active_perception: False
 * /fast_planner_node/manager/use_geometric_path: False
 * /fast_planner_node/manager/use_kinodynamic_path: True
 * /fast_planner_node/manager/use_optimization: True
 * /fast_planner_node/manager/use_topo_path: False
 * /fast_planner_node/optimization/algorithm1: 15
 * /fast_planner_node/optimization/algorithm2: 11
 * /fast_planner_node/optimization/dist0: 0.7
 * /fast_planner_node/optimization/lambda1: 10.0
 * /fast_planner_node/optimization/lambda2: 0.8
 * /fast_planner_node/optimization/lambda3: 1e-05
 * /fast_planner_node/optimization/lambda4: 0.01
 * /fast_planner_node/optimization/max_acc: 1.0
 * /fast_planner_node/optimization/max_iteration_num1: 2
 * /fast_planner_node/optimization/max_iteration_num2: 300
 * /fast_planner_node/optimization/max_iteration_num3: 200
 * /fast_planner_node/optimization/max_vel: 2.1
 * /fast_planner_node/optimization/order: 3
 * /fast_planner_node/planner_node/planner: 1
 * /fast_planner_node/sdf_map/ceil_height: 2.5
 * /fast_planner_node/sdf_map/cx: 385.754
 * /fast_planner_node/sdf_map/cy: 236.743
 * /fast_planner_node/sdf_map/depth_filter_margin: 2
 * /fast_planner_node/sdf_map/depth_filter_maxdist: 5.0
 * /fast_planner_node/sdf_map/depth_filter_mindist: 0.2
 * /fast_planner_node/sdf_map/depth_filter_tolerance: 0.15
 * /fast_planner_node/sdf_map/esdf_slice_height: 0.3
 * /fast_planner_node/sdf_map/frame_id: world
 * /fast_planner_node/sdf_map/fx: 385.754
 * /fast_planner_node/sdf_map/fy: 257.296
 * /fast_planner_node/sdf_map/ground_height: -1.0
 * /fast_planner_node/sdf_map/k_depth_scaling_factor: 1000.0
 * /fast_planner_node/sdf_map/local_bound_inflate: 0.0
 * /fast_planner_node/sdf_map/local_map_margin: 50
 * /fast_planner_node/sdf_map/local_update_range_x: 5.5
 * /fast_planner_node/sdf_map/local_update_range_y: 5.5
 * /fast_planner_node/sdf_map/local_update_range_z: 4.5
 * /fast_planner_node/sdf_map/map_size_x: 100.0
 * /fast_planner_node/sdf_map/map_size_y: 100.0
 * /fast_planner_node/sdf_map/map_size_z: 100.0
 * /fast_planner_node/sdf_map/max_ray_length: 4.5
 * /fast_planner_node/sdf_map/min_ray_length: 0.5
 * /fast_planner_node/sdf_map/obstacles_inflation: 0.099
 * /fast_planner_node/sdf_map/p_hit: 0.65
 * /fast_planner_node/sdf_map/p_max: 0.9
 * /fast_planner_node/sdf_map/p_min: 0.12
 * /fast_planner_node/sdf_map/p_miss: 0.35
 * /fast_planner_node/sdf_map/p_occ: 0.8
 * /fast_planner_node/sdf_map/pose_type: 1
 * /fast_planner_node/sdf_map/resolution: 0.1
 * /fast_planner_node/sdf_map/show_esdf_time: False
 * /fast_planner_node/sdf_map/show_occ_time: False
 * /fast_planner_node/sdf_map/skip_pixel: 2
 * /fast_planner_node/sdf_map/use_depth_filter: True
 * /fast_planner_node/sdf_map/visualization_truncate_height: 2.49
 * /fast_planner_node/search/allocate_num: 100000
 * /fast_planner_node/search/check_num: 5
 * /fast_planner_node/search/horizon: 7.0
 * /fast_planner_node/search/init_max_tau: 0.8
 * /fast_planner_node/search/lambda_heu: 10.0
 * /fast_planner_node/search/margin: 0.2
 * /fast_planner_node/search/max_acc: 1.0
 * /fast_planner_node/search/max_tau: 0.8
 * /fast_planner_node/search/max_vel: 2.1
 * /fast_planner_node/search/resolution_astar: 0.1
 * /fast_planner_node/search/time_resolution: 0.8
 * /fast_planner_node/search/w_time: 10.0
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /traj_server/traj_server/time_forward: 1.5
 * /waypoint_generator/waypoint_type: manual-lonely-way...

NODES
  /
    fast_planner_node (plan_manage/fast_planner_node)
    traj_server (plan_manage/traj_server)
    waypoint_generator (waypoint_generator/waypoint_generator)

auto-starting new master
process[master]: started with pid [27068]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to c6aeab74-38fa-11ea-a451-00d8617c19f3
process[rosout-1]: started with pid [27079]
started core service [/rosout]
process[fast_planner_node-2]: started with pid [27086]
process[traj_server-3]: started with pid [27087]
process[waypoint_generator-4]: started with pid [27088]
hit: 0.619039
miss: -0.619039
min log: -1.99243
max: 2.19722
thresh log: 1.38629
[ WARN] [1579246033.185737302]: [Traj server]: ready.
margin:0.2
origin_: -50 -50  -1
map size: 100 100 100
[FSM]: state: INIT
no odom.
[FSM]: state: INIT
no odom.

SDF Map disappears when fusing with pointcloud topic

I'm trying to use pointcloud topic fusion method in the planner simulation.

However, I've found the critical issue when using pointcloud + odometry for SDF map fusion. Previously updated local map out of FOV doesn't maintained at all, only local map is updated and causes planner to fail often.

Using depth image - local map out of FOV is well maintained

Screenshot from 2020-02-05 15-18-42

Using pointcloud - local map out of FOV disappears

Screenshot from 2020-02-05 15-25-46

As far as I understood
Difference between image + camera pose fusion & pointcloud + odometry fusion is that

For Pointcloud fusion,
subscriber(indep_cloud_sub_) handles pointcloud topic with cloudCallback(...) which directly updates inflated map from pointclouds(md_.occupancy_buffer_inflate_ ) without occupancy updates.

while the depth image fusion methods
updateOccupancyCallback() calls

projectDepthImage()
raycastProcess()
clearAndInflateLocalMap()

These 3 functions do reproject depth image to points, updates occupancy then inflates.

It seems these functions fills the same md_.occupancy_buffer_inflate_ similary with cloudCallback
but issue occurs.

So I have tested with pointcloud to update md_.proj_points_ instead of md_.occupancy_buffer_inflate_ updating directly by modifying sdf_map.cpp as follows but issue still persists but cannot find out why.

Can you guide me what is causing the issue?

Modified followings

sdf_map.cpp

In updateOccupancyCallback, commented projectDepthImage() for sure and prevent counter reset.

void SDFMap::updateOccupancyCallback(const ros::TimerEvent& /*event*/) {
  if (!md_.occ_need_update_) return;

  /* update occupancy */
  ros::Time t1, t2;
  t1 = ros::Time::now();

  // projectDepthImage();
  raycastProcess();

  if (md_.need_clear_local_map_) {
    clearAndInflateLocalMap();
  }

  t2 = ros::Time::now();

  md_.fuse_time_ += (t2 - t1).toSec();
  md_.max_fuse_time_ = max(md_.max_fuse_time_, (t2 - t1).toSec());

  if (mp_.show_occ_time_)
    ROS_WARN("Fusion: cur t = %lf, avg t = %lf, max t = %lf", (t2 - t1).toSec(),
             md_.fuse_time_ / md_.update_num_, md_.max_fuse_time_);

  md_.occ_need_update_ = false;
  if (md_.need_clear_local_map_) md_.esdf_need_update_ = true;
  md_.need_clear_local_map_ = false;
}

Modified cloudCallback(...) to update md_.proj_points_ same as proejctDepthImage()

void SDFMap::cloudCallback(const sensor_msgs::PointCloud2ConstPtr& img) {

  pcl::PointCloud<pcl::PointXYZ> latest_cloud;
  pcl::fromROSMsg(*img, latest_cloud);

  md_.has_cloud_ = true;

  if (!md_.has_odom_) {
    // std::cout << "no odom!" << std::endl;
    return;
  }

  if (latest_cloud.points.size() == 0) return;

  if (isnan(md_.camera_pos_(0)) || isnan(md_.camera_pos_(1)) || isnan(md_.camera_pos_(2))) return;

  this->resetBuffer(md_.camera_pos_ - mp_.local_update_range_,
                    md_.camera_pos_ + mp_.local_update_range_);

  pcl::PointXYZ pt;
  Eigen::Vector3d p3d, p3d_inf;

  int inf_step = ceil(mp_.obstacles_inflation_ / mp_.resolution_);
  int inf_step_z = 1;

  md_.proj_points_cnt = 0;
  for (size_t i = 0; i < latest_cloud.points.size(); ++i) {
    pt = latest_cloud.points[i];
    p3d(0) = pt.x, p3d(1) = pt.y, p3d(2) = pt.z;
    md_.proj_points_[md_.proj_points_cnt++] = p3d;
  }
  md_.occ_need_update_ = true;
  md_.update_num_ +=1;
}

Modified launch file - cloud_simulation.launch

<launch>

  <!-- size of map, change the size in x, y, z according to your application -->
  <arg name="map_size_x" value="40.0"/>
  <arg name="map_size_y" value="40.0"/>
  <arg name="map_size_z" value=" 5.0"/>

  <!-- topic of your odometry such as VIO or LIO -->
  <arg name="odom_topic" value="/state_ukf/odom" />

  <node pkg="tf" type="static_transform_publisher" name="world_map_linker" args="0 0 0 0 0 0 world map 10" />
  <!-- main algorithm params -->
  <include file="$(find plan_manage)/launch/kino_algorithm.xml">

    <arg name="map_size_x_" value="$(arg map_size_x)"/>
    <arg name="map_size_y_" value="$(arg map_size_y)"/>
    <arg name="map_size_z_" value="$(arg map_size_z)"/>
    <arg name="odometry_topic" value="$(arg odom_topic)"/>

    <!-- camera pose: transform of camera frame in the world frame -->
    <!-- depth topic: depth image, 640x480 by default -->
    <!-- don't set cloud_topic if you already set these ones! -->
    <arg name="camera_pose_topic" value="/pcl_render_node/camera_pose_no_use"/>
    <arg name="depth_topic" value="/pcl_render_node/depth_no_use"/>

    <!-- topic of point cloud measurement, such as from LIDAR  -->
    <!-- don't set camera pose and depth, if you already set this one! -->
    <arg name="cloud_topic" value="/pcl_render_node/rendered_pcl"/>

    <!-- intrinsic params of the depth camera -->
    <arg name="cx" value="385.754"/>
    <arg name="cy" value="236.743"/>
    <arg name="fx" value="385.754"/>
    <arg name="fy" value="257.296"/>

    <!-- maximum velocity and acceleration the drone will reach -->
    <arg name="max_vel" value="2.1" />
    <arg name="max_acc" value="1.0" />

    <!-- 1: use 2D Nav Goal to select goal  -->
    <!-- 2: use global waypoints below  -->
    <arg name="flight_type" value="1" />
    
    <!-- global waypoints -->
    <!-- If flight_type is set to 2, the drone will travel these waypoints one by one -->
    <arg name="point_num" value="3" />

    <arg name="point0_x" value="19.0" />
    <arg name="point0_y" value="0.0" />
    <arg name="point0_z" value="1.0" />

    <!-- set more waypoints if you need -->
    <arg name="point1_x" value="0.0" />
    <arg name="point1_y" value="-19.0" />
    <arg name="point1_z" value="1.0" />

    <arg name="point2_x" value="0.0" />
    <arg name="point2_y" value="19.0" />
    <arg name="point2_z" value="1.0" />


  </include>

  <!-- use simulator. It should be disabled if a real drone is used -->
  <include file="$(find plan_manage)/launch/simulator.xml">
    <arg name="map_size_x_" value="$(arg map_size_x)"/>
    <arg name="map_size_y_" value="$(arg map_size_y)"/>
    <arg name="map_size_z_" value="$(arg map_size_z)"/>

     <arg name="odometry_topic" value="$(arg odom_topic)" />
  </include>

  <!-- trajectory server and trigger, you don't need to change them -->
  <node pkg="plan_manage" name="traj_server" type="traj_server" output="screen">
    <remap from="/position_cmd" to="planning/pos_cmd"/>

    <remap from="/odom_world" to="$(arg odom_topic)"/>
    <param name="traj_server/time_forward" value="1.5" type="double"/>
  </node>

  <node pkg="waypoint_generator" name="waypoint_generator" type="waypoint_generator" output="screen">
    <remap from="~odom" to="$(arg odom_topic)"/>        
    <remap from="~goal" to="/move_base_simple/goal"/>
    <remap from="~traj_start_trigger" to="/traj_start_trigger" />
    <param name="waypoint_type" value="manual-lonely-waypoint"/>    
  </node>



</launch>

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.