Git Product home page Git Product logo

btraj's Introduction

Btraj

1.Introduction

Btraj is an online UAV planning framework used to generate safe, dynamically feasible trajectories in previous unknown environments. It can be divided as front-end path finding module and back-end trajectory optimization module. In the front-end, we provide two alternates: Fast Marching*(FM*) on a velocity field and A* on a pure grid map. A flight corridor consists of cubes are generated based on the path. In the back-end, we utilize properties of Bezier curve to confine the piecewise Bezier curves entirely within the corridor and dynamical limits. For details we refer readers to our paper.

Authors:Fei Gao and Shaojie Shen from the HUKST Aerial Robotics Group.

Disclaimer

This is research code, any fitness for a particular purpose is disclaimed.

Related Paper

  • Online Safe Trajectory Generation For Quadrotors Using Fast Marching Method and Bernstein Basis Polynomial, Fei Gao, William Wu, Yi Lin and Shaojie Shen, IEEE International Conference on Robotics and Automation (ICRA), 2018, Brisbane, Australia. full text

Video of this paper can be found:

video

If you use this planning framework for your academic research, please cite our related paper.

@inproceedings{Fei2018ICRA,
	Address = {Brisbane, Australia},
	Author = {F. Gao and W.Wu and Y. Lin and S. Shen},
	Booktitle = {Online Safe Trajectory Generation For Quadrotors
Using Fast Marching Method and Bernstein Basis Polynomial},
	Title = {Proc. of the {IEEE} Intl. Conf. on Robot. and Autom.},
	Month = May,
	Year = {2018}}
}

2.Prerequisities

  • Our testing environment: Ubuntu 16.04, ROS Kinetic.
  • We provide a simple simulation to test the code. To run the simulation, you should install armadillo, which is a c++ linear algebra library. Then clone and compile plan_utils, which contains several ROS-package used for running the simulation.
  sudo apt-get install libarmadillo-dev
  cd ~/catkin_ws/src
  git clone https://github.com/HKUST-Aerial-Robotics/plan_utils.git
  cd ../
  catkin_make
  source ~/catkin_ws/devel/setup.bash

3.Build on ROS

Clone the repository to your catkin workspace and catkin_make. For example:

  cd ~/catkin_ws/src
  git clone https://github.com/HKUST-Aerial-Robotics/Btraj.git
  cd ../
  catkin_make
  source ~/catkin_ws/devel/setup.bash

4.Install Mosek

We use mosek for solving quadratic program(QP). To use mosek, you should approve an academic license in here. The academic license is free and is easy to approve. Then create a folder named 'mosek' in your home directory and put your license in it. All header and library files are already included in the 'third_party' folder under this repo, so you don't need to download mosek again.

5.Usage

If you have done all above, you can try the simple simulation.

  roslaunch bezier_planer simulation.launch

In rviz, click 'Panels -> tools -> +' and select the plugin 'Goal3DTool'. If you have successfully compiled all packages from plan_utils, now you can see 3D Nav Goal in the tools panel.

We use 3D Nav Goal to send a target for the drone to navigate. To use it, click the tool (shortcut keyboard 'g' may conflict with 2D Nav Goal), then press on left mouse button on a position in rviz, click right mouse button to start to drag it slide up or down for a targeting height (don't loose left button at this time). Finally you loose left mouse button and a target will be sent to the planner, done.

By default the planer use FM* to find a path in the distance field. You can change the path search function to A* in the launch file by setting is_use_fm to false.

6.Acknowledgements

We use mosek for solving quadratic program(QP), fast_methods for performing general fast marching method and sdf_tools for building euclidean distance field.

7.Licence

The source code is released under GPLv3 license.

8.Notes

  • The code has not been deeply tested, if you find any problems, do not hesitate to raise a issue or write e-mail to me.
  • The code is written for research purpose and has not been fully optimized. In the future I will add more functionalities and improve efficiency, and also add more comment.

btraj's People

Contributors

ustfgaoaa 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

btraj's Issues

MatrixXd M issue

Hi, when I read the code in bezier_base.cpp, I got some questions in MatrixXd M.
In the branch of case, when the order is 1 or 2 or 3, why the (0,0) element is -1? I thought they were maybe 1, or did you have any more considerations? Thanks:)
Your code are very excellent!

End state constraint in QP

I have a problem with the coefficients in the end state constraint.
Specificly, I think the coefficient in Btraj/src/trajectory_generator.cpp should be as follows:
line 301-302
aval[0] = - 1.0 * traj_order;
aval[1] = 1.0 * traj_order;
line 315-318
aval[0] = 1.0 * traj_order * (traj_order - 1) / lstScale;
aval[1] = - 2.0 * traj_order * (traj_order - 1) / lstScale;
aval[2] = 1.0 * traj_order * (traj_order - 1) / lstScale;

compile problem related to libmosek64.so

Linking CXX executable /home/chong/bezier_pathplan/devel/lib/bezier_planer/b_traj_node
/usr/bin/ld:/home/chong/bezier_pathplan/src/Btraj/third_party/mosek/lib/mosek8_1/libmosek64.so: file format not recognized; treating as linker script
/usr/bin/ld:/home/chong/bezier_pathplan/src/Btraj/third_party/mosek/lib/mosek8_1/libmosek64.so:1: syntax error
collect2: error: ld returned 1 exit status
Btraj/CMakeFiles/b_traj_node.dir/build.make:579: recipe for target '/home/chong/bezier_pathplan/devel/lib/bezier_planer/b_traj_node' failed
make[2]: *** [/home/chong/bezier_pathplan/devel/lib/bezier_planer/b_traj_node] Error 1
CMakeFiles/Makefile2:2672: recipe for target 'Btraj/CMakeFiles/b_traj_node.dir/all' failed
make[1]: *** [Btraj/CMakeFiles/b_traj_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Ceres solver instead of Mosek?

Greatwork actually and I would like to ask you why did you choose Mosek to solve the quadratic optimization problem? It can be solved using Ceres solver as well no?
Thank you

SDF.h missing

Dear All

First all thank you for sharing this nice piece of work!

While compiling btraj i am not able to generate SDH.h. I am able to generate SDH.h if I compile arc_utilities and sdf_tools in a separate catkin ws. If I add arc_utilities in third_party it failed always...
Is it normal that you did not add arc_utilities in third_party?

Besides in the package.xml there are still dependancies with moveit packages which are not used it here

Thank you for your support

Best regards

Report a BUG in random_forest_sensing.cpp

Hello~
I found a small bug in random_forest_sensing.cpp

x = floor(x/_resolution) * _resolution + _resolution / 2.0;

Here x,y is added by 0.5 * resolution, so x,y should not add 0.5 * resolution again in line 77 again.
pt_random.x = x + (r+0.5) * _resolution;

This will cause the coordinates of the cloud points to be a multiple of resolution, due to imprecision of double data type, there will be some gaps in the collision map built by the point cloud.
I found this bug when I set the margin coefficient to 0, some paths pass through the middle of the obstacle.

can not add a 3D Nav Goal in rviz

hi, I add a 3D Nav Goal in rviz according to the USAGE steps, but failed.
what should i do to trigger a path planning?
THX!

[ WARN] [1648127184.733786197]: Finished generate random map
[ WARN] [1648127185.147689826]: WARNING: package://odom_visualization/meshes/hummingbird.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
[ WARN] [1648127185.147961636]: Can't assign material missing_material to SubEntity of mesh_resource_marker_0 because this Material does not exist. Have you forgotten to define it in a .material script?
[ WARN] [1648127210.794698700]: 3D Goal Set
[ WARN] [1648127210.797453307]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.
[ WARN] [1648127225.605172688]: 3D Goal Set
[ WARN] [1648127225.605944921]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.
[ WARN] [1648127293.667733249]: 3D Goal Set
[ WARN] [1648127293.668879180]: [waypoint_generator] invalid goal in manual-lonely-waypoint mode.

bug

vertex_idx(0, 2) = vertex_idx(1, 2) = vertex_idx(2, 2) = vertex_idx(3, 2) = id_z - 1;

This line should be placed in the else branch.

no msg files

In your repo, there are no required msgs, the repo cannot be even compiled successfully.

trouble of catkin_make

when I compile the Package Bteaj, error:

/usr/bin/ld: skipping incompatible /home/nvidia/catkin_wsu/src/Btraj/third_party/mosek/lib/mosek8_1/libmosek64.so when searching for -lmosek64
/usr/bin/ld: cannot find -lmosek64
/usr/bin/ld: skipping incompatible /home/nvidia/catkin_wsu/src/Btraj/third_party/mosek/lib/mosek8_1/libmosek64.so when searching for -lmosek64
/usr/bin/ld: cannot find -lmosek64
collect2: error: ld returned 1 exit status
Btraj/CMakeFiles/b_traj_node.dir/build.make:579: recipe for target '/home/nvidia/catkin_wsu/devel/lib/bezier_planer/b_traj_node' failed
make[2]: *** [/home/nvidia/catkin_wsu/devel/lib/bezier_planer/b_traj_node] Error 1
CMakeFiles/Makefile2:2672: recipe for target 'Btraj/CMakeFiles/b_traj_node.dir/all' failed
make[1]: *** [Btraj/CMakeFiles/b_traj_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j6 -l6" failed

something wrong with catkin-make

Hi Gao,
It seems something wrong with catkin_make,Would you mind helping me fix it ?
thanks a lot.
(I test it on Ubuntu 16.04)

CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "quadrotor_msgs"
with any of the following names:

quadrotor_msgsConfig.cmake
quadrotor_msgs-config.cmake

Add the installation prefix of "quadrotor_msgs" to CMAKE_PREFIX_PATH or set
"quadrotor_msgs_DIR" to a directory containing one of the above files. If
"quadrotor_msgs" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
Btraj-master/CMakeLists.txt:6 (find_package)

-- Could not find the required component 'quadrotor_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "quadrotor_msgs"
with any of the following names:

quadrotor_msgsConfig.cmake
quadrotor_msgs-config.cmake

Add the installation prefix of "quadrotor_msgs" to CMAKE_PREFIX_PATH or set
"quadrotor_msgs_DIR" to a directory containing one of the above files. If
"quadrotor_msgs" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
Btraj-master/CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/zhouwei/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/zhouwei/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

traj_server.cpp

Hi, When I was reading the source code of traj_erver.cpp in Btraj, I encountered some problems,
What do these numbers mean and why choose these number as pos_gain and vel_gain? Can I replace them with other numbers?
double pos_gain[3] = {5.7, 5.7, 6.2};
double vel_gain[3] = {3.4, 3.4, 4.0};

there is something wrong with btraj

when i am compiling the pkg,it turns out with:
fatal error: sdf_tools/SDF.h: No such file or directory compilation terminated.
what should i do?

Robot status error for frame [world] does not exist

i want to run you code and don't modify the code. But after catkin_make without error ,in rviz, it shows that Robot status error for frame [world] does not exist. don't konw how to resolve it . thank you.

Build failed on my own PC

Hi Gao,

It seems something wrong happened with catkin_make, would you mind helping me fix it?

All the best wishes,

make[2]: *** [Btraj/third_party/sdf_tools/CMakeFiles/sdf_tools.dir/src/sdf_tools/sdf.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [Btraj/third_party/sdf_tools/CMakeFiles/sdf_tools.dir/src/sdf_tools/dynamic_spatial_hashed_collision_map.cpp.o] 错误 1
make[2]: *** [Btraj/third_party/sdf_tools/CMakeFiles/sdf_tools.dir/src/sdf_tools/collision_map.cpp.o] 错误 1
make[1]: *** [Btraj/third_party/sdf_tools/CMakeFiles/sdf_tools.dir/all] 错误 2
make: *** [all] 错误 2
Invoking "make -j12 -l12" failed

compile problem related to sdf.hpp

When trying to compile Btraj, I am getting the following compiler error:

In file included from /home/ohrad/catkin_ws/src/Btraj/third_party/sdf_tools/include/sdf_tools/collision_map.hpp:14:0,
from /home/ohrad/catkin_ws/src/Btraj/include/a_star.h:9,
from /home/ohrad/catkin_ws/src/Btraj/src/a_star.cpp:1:
/home/ohrad/catkin_ws/src/Btraj/third_party/sdf_tools/include/sdf_tools/sdf.hpp: In member function ‘double sdf_tools::SignedDistanceField::EstimateDistanceInternal(double, double, double, int64_t, int64_t, int64_t) const’:
/home/ohrad/catkin_ws/src/Btraj/third_party/sdf_tools/include/sdf_tools/sdf.hpp:435:89: error: operands to ?: have different types ‘const ScalarMultipleReturnType {aka const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op, const Eigen::Matrix<double, 3, 1> >}’ and ‘const Vector3d {aka const Eigen::Matrix<double, 3, 1>}’
const Eigen::Vector3d direction_to_boundary = (nominal_sdf_distance >= 0.0) ? -gradient : gradient;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/ohrad/catkin_ws/src/Btraj/third_party/sdf_tools/include/sdf_tools/sdf.hpp:435:89: note: and each type can be converted to the other

I see that there is a TODO note related to gradient and I am wondering if that is related.

Removing the negative sign in front of gradient fixes this compile error, but this does not seem like the proper fix.

Abnormal report error

Hi
My test environment: Ubuntu 18.04, ROS melodic.
I follow the Btraj readme configuration steps as follows :
  1. install armadillo

    2.  sudo apt-get install libarmadillo-dev
        cd ~/catkin_ws/src
        git clone https://github.com/HKUST-Aerial-Robotics/plan_utils.git
       cd ../
       catkin_make
       source ~/catkin_ws/devel/setup.bash

     3. cd ~/catkin_ws/src
         git clone https://github.com/HKUST-Aerial-Robotics/Btraj.git
         cd ../
         catkin_make
         source ~/catkin_ws/devel/setup.bash

       4.   roslaunch bezier_planer simulation.launch

It made the following errors,:
Screenshot from 2020-07-26 12-15-58

Who can help me to see what's reason?

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.