Skip to content

Start the simulation

Bo Shang edited this page Dec 5, 2017 · 7 revisions
  • Launch Ardupilot & Gazebo
Terminal 1:

source ~/simulation/ros_catkin_ws/devel/setup.bash
cd ~/simulation/ardupilot/ArduCopter
../Tools/autotest/sim_vehicle.sh -j 4 -f Gazebo
# Once MAVProxy has launched completely, load the parameters
param load /home/bshang2/simulation/ardupilot/Tools/Frame_params/Erle-Copter.param
# Change the "bshang2" to your username.

Terminal 2:
source ~/simulation/ros_catkin_ws/devel/setup.bash
roslaunch ardupilot_sitl_gazebo_plugin erlecopter_mark.launch

Terminal 1:
mode GUIDED
arm throttle
takeoff 2
param set SYSID_MYGCS 1
  • Run this project in Terminal 3
source ~/simulation/ros_catkin_ws/devel/setup.bash
rosrun ros_erle_pattern_follower ros_erle_pattern_follower
  • Launch MATLAB and type command: "rosinit"
  • Run related Simulink file

Launch MATLAB

On the MATLAB command line, execute the following:

rosinit

Open this Simulink file and run the model.

Simulink file explanation:

  • pattern_follow_body_frame.slx - Basic P controller;

  • body_frame_iopid.slx - IOPID controller with back-calculation anti-windup; https://drive.google.com/file/d/0B2fvRttkMQIpUGVRdGNEMjV4UE0/view?usp=sharing The drone keeps avoiding the target, something needs to get negative. This issue is solved in iopid_back_calculation.slx

  • iopid_back_calculation - IOPID controller with back-calculation anti-windup;

  • Test_velocity_setpoint.slx - Fixed velocity setpoint, for testing;

  • iopid_clamping.slx - IOPID controller with clamping anti-windup. It still has serious actuator saturation after using clamping anti-windup.

to use back-calculation

Support forums and chats

Please ask your questions not related to bugs/feauture requests on:

References: