This repo is for exploring PX4 SITL & HITL Mode and UAV trajectory replanning using RRT* in Ewok-Replanning RRT*
Pull all of the repo and its submodule using
git clone --branch melodic-dev --recurse-submodules https://github.com/haritsahm/PX4-TrajectoryReplanning.git
check if these folder is inside src: ewok, mavros_controllers, px4, and px4_trajectory_replanning, px4_simulation
After that run this command to download the submodules
git submodule update --init --recursive
After everything is finished, we need to create a symlink from src to the mavlink_sitl_gazebo inside px4/Tools if its not available.
cd src/ # move to src directory
ln -s px4/Tools/sitl_gazebo/ mavlink_sitl_gazebo
Because several packages generate the same target directory, we use catkin build to avoid these errors. Suggested by Effective Robotics Programming with ROS - Third Edition#1
Build workspace using python3 interpreter from terminal
catkin build --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_ROS_INTERFACE=ON --make-args -j4
Similar to Setup Qt Creator for ROS by Levi Armstrong
- First open the project, then navigate to the Projects > Build Settings
- Remove existing "Build Steps".
- Add a custom build step Add Build Step > Custom Process Step as shown below.
- Command: /usr/local/bin/catkin
- Arguments: build --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_ROS_INTERFACE=ON --make-args -j2
- Working directory: %{CurrentProject:Path}
- Remove existing "Clean Steps".
- Add a custom clean step Add Clean Step > Custom Process Step as shown below.
- Command: /usr/local/bin/catkin
- Arguments: clean
- Working directory: %{CurrentProject:Path}
Use rviz to vizualize the simulation
rviz -d src/ewok/ewok_simulation/rviz/simulation_rrt.rviz
roslaunch ewok_simulation trajectory_replanning_simulation_rrt.launch
roslaunch ewok_simulation trajectory_replanning_forest_rrt.launch
Please run this everytime you want to connect it with offboard controller or after editing the offboard controller
roslaunch px4_trajectory_replanning px4_gazebo_cones.launch
roslaunch px4_trajectory_replanning px4_rviz.launch
This is the main offboard controller
roslaunch px4_trajectory_replanning px4_offboard_controller.launch
roslaunch px4_trajectory_replanning px4_offboard_interface.launch
Wait for a few seconds until the mode status is filled.
- Press the offboard button to change the pixhawk mode to offboard control
- wait for 3 seconds and then send any desired tasks
- Do not start the mission instruction before the replanning system is running
roslaunch px4_trajectory_replanning trajectory_replanning_rrt.launch
##License
This project is licensed under the GNU Lesser General Public License Version 3 (LGPLv3). The interface was developed using Qt Designer and Qt Creator. They are licensed under GNU General Public License Version 3 (GPLv3). The interface is using Qt Core, Qt Gui, and Qt Widgets Framework APIs licensed udner the GNU Lesser General Public License Version 3 (LGPLv3). Ewok is licensed under the GNU Lesser General Public License Version 3 (LGPLv3). Pixhawk Firmware and Middleware is licensed under BSD-3-Clause License. For full license details, refer to the license file in the library's directory.