Giter Site home page Giter Site logo

zju-fast-lab / swarm-formation Goto Github PK

View Code? Open in Web Editor NEW
337.0 11.0 59.0 10.34 MB

Formation Flight in Dense Environments

License: GNU General Public License v3.0

CMake 6.46% Makefile 0.17% C++ 83.25% C 2.10% Python 4.82% Cuda 2.30% CSS 0.73% HTML 0.04% Fortran 0.07% Dockerfile 0.06%
swarm motion-planning multi-robot formation-flight aerial-robotics distributed-systems spatial-temporal trajectory-optimization

swarm-formation's Introduction

Swarm-Formation

Swarm-Formation is a distributed swarm trajectory optimization framework for formation flight in dense environments.

  • A differentiable graph-theory-based cost function that effectively describes the interaction topology of robots and quantifies the similarity distance between three-dimensional formations.
  • A spatial-temporal optimization framework with a joint cost function that takes formation similarity, obstacle avoidance, and dynamic feasibility into account, which makes the swarm robots possess the ability to move in formation while avoiding obstacles.

News

  • October 9, 2022 - An improved version which achieves fully autonomous large-scale formation flight in dense environments with a complete formation navigation system has been submitted to IEEE Transactions on Robotics Preprint, Bilibili.
  • April 20, 2022 - A robust version v1.1 has been open-sourced for ICRA2022.

Table of Contents

1. About

Author: Lun Quan*, Longji Yin*, Chao Xu, and Fei Gao, from Fast-Lab,Zhejiang University.

Paper: Distributed Swarm Trajectory Optimization for Formation Flight in Dense Environments, Lun Quan*, Longji Yin*, Chao Xu, and Fei Gao. Accepted in ICRA2022.

@article{quan2021distributed,
      title={Distributed Swarm Trajectory Optimization for Formation Flight in Dense Environments}, 
      author={Lun Quan and Longji Yin and Chao Xu and Fei Gao},
      journal={arXiv preprint arXiv:2109.07682},
      year={2021}
}

If our source code is used in your academic projects, please cite our paper. Thank you!

Video Links: Bilibili (only for Mainland China) or Youtube.

2. Quick Start within 3 Minutes

Compiling tests passed on ubuntu 18.04 and 20.04 with ros installed. You can just execute the following commands one by one.

sudo apt-get install libarmadillo-dev
git clone https://github.com/ZJU-FAST-Lab/Swarm-Formation.git
cd Swarm-Formation
catkin_make -j1
source devel/setup.bash
roslaunch ego_planner rviz.launch

Then open a new command window in the same workspace and execute the following commands one by one.

source devel/setup.bash
roslaunch ego_planner normal_hexagon.launch

Then use "2D Nav Goal" in rviz to publish the goal for swarm formation navigation. You need to specify the value of flight_type in run_in_sim.launch:

Now only two forms are supported to specify the target point.

  • flight_type = 2: use global waypoints
  • flight_type = 3: use "2D Nav Goal" to select goal

Finally, you can see a normal hexagon formation navigating in random forest map.

If you find this work useful or interesting, please kindly give us a star ⭐, thanks!😀

2.1 Quick Start with Docker

If your operating system doesn't support ROS noetic, docker is a great alternative.

First of all, you have to build the project and create an image like so:

## Assuimg you are in the correct project directory
make docker_build

After the image is created, copy and paste the following command to the terminal to run the image:

xhost +
make docker_run

Then execute the following command;

roslaunch ego_planner normal_hexagon.launch

3. Tips

  1. We recommend developers to use rosmon to replace the roslaunch
  • Why we use rosmon? : It is very developer-friendly, especially for the development of multi-robots.
  • How to use rosmon? : Install:
    sudo apt install ros-${ROS_DISTRO}-rosmon
    source /opt/ros/${ROS_DISTRO}/setup.bash # Needed to use the 'mon launch' shortcut
    
    Run the simple example of our project:
    source devel/setup.bash
    roslaunch ego_planner rviz.launch
    
    Then open a new command window in the same workspace and use rosmon:
    source devel/setup.bash
    mon launch ego_planner normal_hexagon.launch
    

4. Important updates

  • May 9, 2022 -Add Interface: Publish target points through "2D Nav Goal" in rviz for swarm formation navigation.
  • April 12, 2022 - A distributed swarm formation optizamition framework is released. An example of normal hexagon formation navigation in random forest map is given.

5. Acknowledgements

There are several important works which support this project:

  • GCOPTER: An efficient and versatile multicopter trajectory optimizer built upon a novel sparse trajectory representation named MINCO.
  • LBFGS-Lite: An Easy-to-Use Header-Only L-BFGS Solver.
  • EGO-Swarm: A Fully Autonomous and Decentralized Quadrotor Swarm System in Cluttered Environments.

6. Licence

The source code is released under GPLv3 license.

7. Maintenance

We are still working on extending the proposed system and improving code reliability.

For any technical issues, please contact Lun Quan ([email protected]) or Fei Gao ([email protected]).

For commercial inquiries, please contact Fei Gao ([email protected]).

swarm-formation's People

Contributors

avcuenes avatar dongjh20 avatar iamrajee avatar pupillen avatar samuraichamploo avatar ylj6038 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

swarm-formation's Issues

运行仿真测试时其中一个agent停止不动,然后电脑内存爆掉死机

作者您好!在多台电脑上运行仿真测试时都发现在到达一个目标点后再发布新的目标点后,集群中会有一个到两个agent停止不动,其余agents继续执行规划轨迹,然后电脑死机。通过系统监控发现内存爆掉。请问大家是否遇到过同样的问题?应该如何解决? 感谢!

Question on maps

Could it be possible to run your code on custom predesigned enviroments instead of random ones? Some of your packages depend on "map_generator" so removing it it's not an option but would like to tun some metrics for a paper.

多目标点规划导致的路径问题

当前路径规划似乎是全局规划,会同时规划所有目标点,请问如何恢复到Fast-Drone-250中一次只规划一个目标点的形式呢?

hummingbird.skeleton

[ERROR] [1679322504.115688710]: Error retrieving file [file:///home/tutu/Swarm-Formation/src/Utils/odom_visualization/meshes/hummingbird.skeleton]: Couldn't open file /home/tutu/Swarm-Formation/src/Utils/odom_visualization/meshes/hummingbird.skeleton

I need your help! Where could I find the file hummingbird.skeleton?
And the UAVs do not move after I set the 2D goal. I have no idea how to do the debug.
image

image

image

Thanks.

Hello, this is a great project.

Hello, this is a great project. As a beginner, I would like to read your code and I don't know if I have the pleasure to do so. I would like to ask you when this code will be open sourced. Thank you very much.
My email is [email protected] Thank you again for your guidance

仿真迁移真机时代码选择(有关摄像头)

您好,我们现在正在进行真机迁移工作,遇到了如下问题

我们在/Swarm-Formation/src/uav_simulator/local_sensing/src/下发现了两个文件pcl_render_node.cpppointcloud_render_node.cpp,对比之后有如下两个问题

  • 目前仿真环境CUDA不启动,默认使用pointcloud_render_node.cpp,而如今想要使用摄像头D435获得点云是否应该选择使用pcl_render_node.cpp
  • 如果不是,在pointcloud_render_node.cpp里的局部点云处理并未完成,请问是否有办法解决?

感谢您耐心地观看我的问题,祝您工作顺利,事事如意!

Swarm-Formation如何应对延迟,能否根据位置偏差重规划轨迹

您好,

我想在一个无人机仿真器里使用Swarm-Formation,但是遇到了一些问题。
仿真器与Swarm-Formation的通讯靠ROS完成,但是仿真器的计算延迟和ROS的通信延迟导致仿真器里的无人机无法完美执行Swarm-Formation发来的指令,Swarm-Formation的Rviz显示无人机的位置总是大幅落后于规划出来的红色轨迹。另外,仿真器与Swarm-Formation建立连接的时候无法同时连接所有无人机,无人机会先后依次出发并保持最大速度前进。即使在仿真里手动设置,让所有无人机在同一时刻出发,仍然无法完全解决这个问题。这些因素导致无人机在仿真里无法实现预期的编队。
所以想请问,在真机部署的时候,Swarm-Formation(或者Ego-Swarm)发送控制指令的频率大概是多少赫兹?真机部署如何解决无人机延迟的问题?以及,在延迟较大的情况下,是否有办法让无人机根据自己当前的位置,及时重新规划轨迹?

期待您的回复,万分感谢!

Questions about dfde.

Hi, thanks for the great work! I learned the formula (5) of the gradient of formation similarity distance metric f with respect to position p_i from the paper[1], before that, we need (8), but there is no specific expression for (8).

I saw the calculation of dfde from the code, it should be related to equation (6) and (9). Before calculating (6), we need (8), but the code does not correspond to equation (8). Is there a more detailed derivation of (8)? Does it just use the chain rule of Matrix Calculus to solve for partial derivatives (8)? From a reader's perspective, I think intuitive derivation or code is more conducive to the dissemination of knowledge. Hope to get your reply. Thanks again!

[1] L. Quan, L. Yin, C. Xu, and F. Gao, “Distributed Swarm Trajectory Optimization for Formation Flight in Dense Environments,” in 2022 International Conference on Robotics and Automation (ICRA), May 2022, pp. 4979–4985. doi: 10.1109/ICRA46639.2022.9812050.

Motion target interference

  你好,请问在实现多机规划仿真时,您的环境避障用到了ESDF图,而多无人机的避障和编队则是通过通信获取信息,但获取点云数据的时候应该会包含旁边运动的无人机,请问如何在生成环境ESDF图的时候避免身边运动无人机的干扰呢?理论上ESDF环境避障和通信获取其他无人机轨迹信息应该独立。
 希望作者有空能够解答一下,非常感谢!

想要将代码移植到turtlebot3,遇到速度无法降低到设定范围的问题

作者你好,我最近在Turtlebot3burger上调试你的代码,但最大速度只有0.22。所以对你的代码修改,但输出的速度基本上都超过0.3左右。

我做的修改文件run_in_sim.launch72-75代码,修改如下:

<arg name="max_vel" value="0.15" />
 <arg name="max_acc" value="1" />
 <!--always set to 1.5 times grater than sensing horizen-->
 <arg name="planning_horizon" value="1.5" />

然后,我在traj_server.cpp中输出所有的速度值。

for (int i = 0; i < time_vec_.size(); i++) {
      double tmp_vel2 = (vel_vec_[i](0))*(vel_vec_[i](0)) + (vel_vec_[i](1))*(vel_vec_[i](1)) + (vel_vec_[i](2))*(vel_vec_[i](2));

      //------------- 我添加的代码,用来输出每次运行的速度
      if(tmp_vel2>(0.15*0.15))
        result_file<<"velocity: "<<sqrt(tmp_vel2)<<"    overspeed!"<<"\n";
      else
        result_file<<"velocity: "<<sqrt(tmp_vel2)<<"\n";
      //------------- 

      max_vel2 = (tmp_vel2 > max_vel2) ? tmp_vel2 : max_vel2;
}

下面是一次到达目标点期间,所有运行的速度值,由于结果比较多,这里给出链接。文件名第一个数字表示不同的无人机。

如果有其他可以减低输出的速度的方法,麻烦告诉我。

如何灵活地设置目标点

在launch、xml文件中一个个设置太不灵活了,我尝试通过向话题发布消息来实现,可惜失败了,以下是我的话题列表(多个无人机的重复话题已省略)
/broadcast_traj_from_planner
/broadcast_traj_to_planner
/clicked_point
/drone_0_ego_planner_node/a_star_list
/drone_0_ego_planner_node/dist_grad_dur_opt
/drone_0_ego_planner_node/failed_list
/drone_0_ego_planner_node/feas_grad_dur_opt
/drone_0_ego_planner_node/global_list
/drone_0_ego_planner_node/goal_point
/drone_0_ego_planner_node/grad0_dur_opt
/drone_0_ego_planner_node/grad1_dur_opt
/drone_0_ego_planner_node/grid_map/esdf
/drone_0_ego_planner_node/grid_map/occupancy
/drone_0_ego_planner_node/grid_map/occupancy_inflate
/drone_0_ego_planner_node/init_debug_list
/drone_0_ego_planner_node/init_debug_list_array
/drone_0_ego_planner_node/init_list
/drone_0_ego_planner_node/init_list_array
/drone_0_ego_planner_node/optimal_list
/drone_0_ego_planner_node/optimal_list_array
/drone_0_ego_planner_node/pt0_dur_opt
/drone_0_ego_planner_node/pt1_dur_opt
/drone_0_ego_planner_node/smoo_grad_dur_opt
/drone_0_ego_planner_node/swarm_grad_dur_opt
/drone_0_ego_planner_node/swarm_graph_visual
/drone_0_odom_visualization/cmd
/drone_0_odom_visualization/covariance
/drone_0_odom_visualization/covariance_velocity
/drone_0_odom_visualization/height
/drone_0_odom_visualization/path
/drone_0_odom_visualization/pose
/drone_0_odom_visualization/robot
/drone_0_odom_visualization/robot_array
/drone_0_odom_visualization/sensor
/drone_0_odom_visualization/trajectory
/drone_0_odom_visualization/velocity
/drone_0_pcl_render_node/camera_pose
/drone_0_pcl_render_node/cloud
/drone_0_pcl_render_node/depth
/drone_0_pcl_render_node/local_map
/drone_0_planning/data_display
/drone_0_planning/finish
/drone_0_planning/pos_cmd
/drone_0_planning/start
/drone_0_planning/trajectory
/drone_0_visual_slam/odom
/goal
/initialpose
/map_generator/global_cloud
/map_generator/local_cloud
/move_base_simple/goal
/others_odom
/pcl_render_node/local_map
/rosout
/rosout_agg
/tf
/tf_static
/traj_start_trigger
/vins_estimator/extrinsic
/vins_estimator/imu_propagate
我尝试了发布消息到/drone_0_ego_planner_node/goal_point,但那只是改变了rviz中目标点的位置,而无人机并不会朝着新设置的目标点移动。
感谢您耐心地观看我的问题,祝您身体健康,万事顺遂!

Hardware testing

Hi, thanks for making this awesome project open-source. I was curious if this has been tested on the hardware.

I have a few questions related to the implementation:

  1. The max_iter in non-formation optimization is set to 60 Vs 200 set here how much performance difference does it make?

  2. In the current Implementation I see that if one of the UAVs is stuck somewhere, the others keep moving ahead, which I believe is a good thing in terms of a decentralized system but once it is able to navigate again, and since other agents are far away, its formation cost would go super high, would it generate any abnormal behaviors?

  3. Behaviour-wise speaking, rather than moving ahead if one of the agents is stuck, if I am willing to enable a "stick together" sort of behavior, where the rest of the agents can slow down for it to catch up (the whole point of the collaborative swarm) is it possible with this approach?

  4. The paper mentions, that formation is decoupled, but if the use_formation_ flag is enabled, it's part of the same optimization

thanks again

Cannot Compile

I was not able to install the packages, I got an error while running the command
catkin_make -j1

Below is the error message.

Could NOT find pcl_conversions (missing: pcl_conversions_DIR)
Could not find the required component 'pcl_conversions'. 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/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "pcl_conversions"
with any of the following names:-- 

Could you please let me know how to solve this issue.

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.