Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何灵活地设置目标点 #6

Closed
luhai18374277 opened this issue May 8, 2022 · 5 comments
Closed

如何灵活地设置目标点 #6

luhai18374277 opened this issue May 8, 2022 · 5 comments

Comments

@luhai18374277
Copy link

luhai18374277 commented May 8, 2022

在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中目标点的位置,而无人机并不会朝着新设置的目标点移动。
感谢您耐心地观看我的问题,祝您身体健康,万事顺遂!

@luhai18374277 luhai18374277 changed the title 如何灵活的设置目标点 如何灵活地设置目标点 May 8, 2022
@SamuraiChamploo
Copy link
Member

你好,这部分说明比较麻烦,我会在这周有空的时候更新终点设置的方式,请到时候关注反馈,谢谢

@luhai18374277
Copy link
Author

你好,这部分说明比较麻烦,我会在这周有空的时候更新终点设置的方式,请到时候关注反馈,谢谢

感谢您及时的答复!

比起同时给出所有目标点(前往第i个目标点的路径规划似乎会受到第i+1个目标点的影响,例如无人机似乎不会走出一个直角),我更希望在到达某个目标点时再给出下一个目标点,对此我该如何修改代码或是自行编写脚本呢?

期待您的答复,再次祝福您工作顺利,生活愉快!

@ZamesNg
Copy link

ZamesNg commented May 9, 2022

我可以给一点小提示,非官方答复 :) 。
如果不想在launch文件里设定目标点,可以修改 run_in_sim.launch 里的参数:
<arg name="flight_type" value="2" /> 改为 <arg name="flight_type" value="1" />
然后你就可以让每个无人机都会subscribe一个话题来接收目标点。
但是有三个需要注意的地方:

  1. 现在的代码里所有无人机都subscribe了同一个话题"/goal",需要在launch文件里remap一下。
  2. 每个无人机的目标点不应该是一样的,所以最好写个中间节点,先接收目标编队中心的目标点再转成每个无人机单独的目标点。
  3. 按照这个方法做的话,无人机一旦收到新的目标点,就会放弃当前目标点然后向新的目标点前进。你可以等无人机到达目标点后再指定新目标点,这样就可实现你说的走直角的效果。当然也可以直接修改ego_replan_fsm.cpp里的状态机,但是这就很复杂了。

@luhai18374277
Copy link
Author

我理解了您说的方法,它确实可以奏效,这让我更加理解了系统运转的方式,帮大忙了,十分感谢您的回答!

@Pupillen
Copy link
Member

Pupillen commented May 9, 2022

添加了rviz 发布目标点的接口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants