ZJU-FAST-Lab / Swarm-Formation

Formation Flight in Dense Environments
GNU General Public License v3.0
406 stars 64 forks source link

变换队形 #29

Closed robot-WT closed 4 months ago

robot-WT commented 5 months ago

我想实现像视频里的心形队形,或者字母队形,应该如何配置呢,期待您的回答。

robot-WT commented 5 months ago

我知道了

robot-WT commented 5 months ago

我想在运动的时候能够变换队形,所以写了一个python程序程序读取normal_hexagon.yaml(我新建了),此时formation_type也变为了我预设的值,但运动过程中的队形也就没有变。所以我修改了程序,我在输出reached goal的前面重新设置参数ploy_trajopt->setParam(nh);但会导致程序报错,您能帮忙看看是什么问题吗?万分感谢

AnonChihayaaa commented 4 months ago

Do you solve this yet? I'm also focusing on changing the formation during flight but have trouble getting it work. Can you share how to implement this?

robot-WT commented 4 months ago

Considering that the formation transformation is completed during sports, we find its formation definition function setDesiredFormation and find that it is initialized when the class is instantiated. Additional calls will cause an error. A loop function is needed to determine when the formation transformation is completed, based on formation_type. Determine formation changes. Considering the communication mechanism of ROS, we know that rosmaster manages all parameters in ros, which is equivalent to a database. We only need to complete the overloading of parameters and complete the formation transformation in the instantiated loop execution function. Since the callback function of ros is repeatedly executed in the program, we found a callback function formationWaypointCallback to overload the formation parameter.