Welcome to the UAV Motion Planning and Control repository! This project is based on the EGO Planner v2 and includes a PX4 controller that implements both PID and LQR controllers for executing UAV trajectories. The workspace supports simulation in two environments: PX4-Autopilot and XTDrone. A visual algorithm package for target tracking will be coming soon in the future.
- EGO Planner v2: Advanced motion planning algorithm for UAVs.
- PX4 Controller: Supports both PID and LQR controllers for precise trajectory execution.
- Dual Simulation Environments: Compatible with both PX4-Autopilot and XTDrone platforms.
Before cloning the repository, ensure you have the following dependencies installed:
Clone this repository to your local machine:
cd catkin_ws
git clone https://github.com/iZhuoxx/Object-Tracking-for-UAV.git
catkin_make
source devel/setup.bash
To simulate the UAV in the PX4-Autopilot environment, follow these steps:
-
Navigate to the script directory:
cd script
-
Run the PX4-Autopilot simulation script:
sh mybot_gazebo.sh
To simulate the UAV in the XTDrone platform, follow these steps:
-
Navigate to the script directory:
cd script
-
Run the XTDrone simulation script:
sh XTbot_gazebo.sh
Please follow these steps to operate the UAV:
-
Start the Simulation Platform:
- Running the appropriate PX4-Autopilot's or XTDrone's simulation script, the UAV will initialize in the Gazebo simulation environment.
-
Use QGroundControl:
- Launch QGroundControl to take off the UAV.
-
Run the Motion Planner Script:
- Run the simulation script that we provided in script folder. The motion planning and control algorithms will be executed, allowing you to observe the UAV's trajectory.
-
Configure RQT Reconfigure Interface:
- When the
rqt_reconfigure
interface appears, first select themode_bool
option to enter offboard mode. - Then, select the
cmd_bool
option to initiate the setpoint in Rviz.
- When the
-
Set the Target with 2D Nav Goal:
- Use the "2D Nav Goal" tool in Rviz to set the target destination for the UAV. Now the drone will fly towards the target point and you can visualize the output of the motion planner algorithm.
- Gazebo: The primary simulation environment where you can visualize the UAV's movements and interactions.
- Rviz: Use Rviz for a 3D visualization of the planning and control processes.
For questions, issues, or support, please open an issue or contact [email protected].