byu-magicc / fcu_sim

[DEPRECATED] Superseded by https://github.com/byu-magicc/rosflight_plugins
2 stars 4 forks source link

FCU Sim

fcu_sim is a MAV gazebo simulator. It has been modified for use in the MAGICC ros_plane and ros_copter framework.

It based on the RotorS simulator created by researchers at eth-Zurich, however almost all of that package has been removed or changed. If interested, the original package can be found at https://github.com/ethz-asl/rotors_simulator.

Installation

To install, simply clone this metapackage into the src directory of your catkin workspace. You will then need to pull the ROSflight2 submodule for the software-in-the-loop package to successfully build.

cd fcu_sim
git submodle update --init --recursive

Feedback and Contributing

We welcome feedback and contributions via Issues and Pull Requests. This software is distributed with an Apache license like the RotorS simulator, which allows for use in both open source and closed-source applications, all you need to do is keep a copy of the license at the top of all redistributed and derivative work. The license can be found here

Tutorials

We have created tutorials to help you get started building models, worlds and plugins. They located at magiccvs.byu.edu/wiki/Gazebo_Tutorials. These should be publicly available for anyone who is interested in using this simulator to help with their research.

File Descriptions

This is a metapackage. The packages are organized as follows:

How To Use

To use for simulating shredder, one can simply just copy the launch file and customize it for their needs. However, creating a new model may be more complicated.

Try launching simulator.launch. If all goes well, you should see your MAV fall to the ground in Gazebo (This is because it not being provided with any commands). You can additionally run fcu_common/joy to control your MAV like it were being commaned by RC inputs. simple.launch should run this joystick RC teleop as well as launching your MAV in Gazebo. Look at the documentation for fcu_common/joy to know how to use this node.

To use the ROSflight SIL plugin instead of the simplified multirotor dynamics, simply uncomment line 60 of shredder_base.xacro, and comment out line 64. This instead loads the software-in-the loop plugin and runs the embedded ROSflight code in Gazebo.

Technical Details

Simulation of multirotors is done in two ways:

  1. First-order models of applied body-fixed torques. Torques are applied to the body-fixed axes of the UAV using PID control and with a first-order response. The time constants and thrust/torque response for several motors/propeller combinations have been measured using the thrust test stand at BYU, and the information in the shredder and mikey configurations are accurate. We have data for all the 3DR motor/propeller combination, a number of 250-size quad systems, MikroCopter systems, and old Ascending Technologies systems. We have found that this first-order model is appropriate for most simulations. It is somewhat simplistic, bu it is faster to calculate than other methods.

  2. ROSflight SIL. This method uses the actual ROSflight code to perform estimation and control. Forces are then applied as if propellers at the various locations on the airframe. Currently, propellers not aligned with the body-fixed Z axes are not supported, but likely could be if you need something like that. Individual motor response is modeled using a quadratic fit, and a first-order response. This parameterization fits very well the data collected on actual thrust stands. For more information on how to collect the motor data for your platform, please contact one of the authors via an Issue or personal message.

Simulation of Fixed wing MAVs is performed using the method described in "Small Unmanned Aircraft - Theory and Practice" by Randy Beard and Tim McLain. This model uses stability derivatives which can be calculated by AVL for a particular airframe, and lift coefficients from a particular airframe. A detailed explanation of each term in the aircraft_forces_and_moments plugin can be found in that book. Currently, ROSflight SIL is not well supported for fixed wing MAVs. We expect this to change in the near future.