Integration of some algorithms with PX4 and AirSim for real-time collision-free and obstacle-free trajectories in bounded environment.
This repo is only tested in Ubuntu18.04 with ROS Melodic.
AirSim 1.8.1
- airsim_ros_pkgs is need as a ROS wrapper over the AirSim C++ client library.
- Please follow this tutorial to build and use AirSim ROS wrapper.
PX4-Autopilot 1.13.0
- Clone PX4-Autopilot
-
Start AirSim environment
- Download AirSim linux build from here.
- Start environment.
-
Start simulation
roslaunch px4_avoidance_airsim start_simulation.launch
- Note: The local-planner in PX4-avoidance and fast-planner using different config file. Please select the right config file when you start simulation using
roslaunch px4_avoidance_airsim start_simulation.launch
.
-
Launch planning algorithms
- Such as
roslaunch px4_avoidance_airsim start_fast_planner.launch
orroslaunch px4_avoidance_airsim start_px4_avoidance.launch
- Such as
-
Have fun
Sometimes the communication between PX4 SITL and the AirSim is not fast enough. It leads to the very slow mavros topics, normally 4Hz for local_pose.
You can modify the MAVLINK data rate in
ROMFS/px4fmu_common/init.d-posix/rcS
Line 274 to
mavlink start -x -u $udp_onboard_payload_port_local -r 4000000 -f -m onboard -o $udp_onboard_payload_port_remote
(in v1.11.3 version).
In latest v1.13, it should be at ROMFS/px4fmu_common/init.d-posix/px4-rc.mavlink
Line 29.
MPC_XY_CRUISE 3m/s
MC_PITCHRATE_MAX 60 deg/s
MC_ROLLRATE_MAX 60 deg/s
MC_YAWRATE_MAX 60 deg/s
method 1:
in fast_planner/plan_manage/src/kino_replan_fsm.cpp
if (target_type_ == TARGET_TYPE::MANUAL_TARGET) {
end_pt_ << msg->poses[0].pose.position.x, msg->poses[0].pose.position.y, 1.0;
}
method 2:
in uav_simulator/Utils/waypoint_generator/src/waypoint_generator.cpp
line 146
voidgoal_callback(constgeometry_msgs::PoseStamped::ConstPtr&msg)