HKUST-Aerial-Robotics / Fast-Planner

A Robust and Efficient Trajectory Planner for Quadrotors
GNU General Public License v3.0
2.4k stars 665 forks source link

Try to use it in gazebo to control the drone #45

Closed DengLiankang closed 4 years ago

DengLiankang commented 4 years ago

Hello

I try to subscribe _/planning/poscmd 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

DengLiankang commented 4 years ago

I see the planned path by viewing /planning/travel_traj topic in rviz ,and my drone can't keep up with this path.

I guess I made a mistake somewhere.

ZbyLGsc commented 4 years ago

@DengLiankang First, I suggest you to ensure whether the command is published correctly or not. You may plot the curve using rqt, or check the "planning/position_cmd_vis" topic in RVIZ to see the marker of command. I think there should not be problem about publishing command if you did not modify the traj_server.

If you do find problem about publishing commands pls report with more details.

DengLiankang commented 4 years ago

@ZbyLGsc thanks for your reply.

In fact, traj_server published the complete commands about the planned path. I try to use these commands to control the drone,but before the drone reached the destination, the commands was completely published.

I read the code carefully and found that the fast_planner node uses the odometry messages only in the GEN_NEW_TRAJ state. Maybe I can try to use odometry messages to replan during the flight to the destination.

Thanks again for your reply, I think I can close this issue.

ZbyLGsc commented 4 years ago

@DengLiankang What you describe is not a problem of the planner, it is a control problem, i.e., the real pose can not catch up with the commanded pose. Given a good trajectory tracking controller, the drone should be able to follow the trajectory well, therefore I suggest you to check the controller used in Gazebo.