[gazebo] Add actuator dynamics and bebop model (#2219)

* Add gazebo model for Parrot Bebop 1

* Add first-order high pass filter

* First implementation of actuator dynamics and spinup torque

Flies ok with PID control

Does not fly ok with INDI, the required G1 R is 0.159 instead of
0.0022 (estimated by flying in adaptive mode). The other parameters
are close to those specified in the airframe file.

* FIX incorrect yaw behavior

Fixed two bugs:
1. gazebo_actuators.torques was set to NPS_ACTUATOR_THRUSTS
2. spinup torque direction is now also controlled by motor mixing

* Clean up debug code and file logger

* Clean up gazebo example airframes

* Minor cleanup

* FIX warnings about missing initializer in fdm_gazebo

* Update documentation

* Remove modules section, move to firmware

* Minor fixes to fdm_gazebo and high_pass_filter

* Move actuator dynamics to included airframe files

Should prevent duplicate actuator defines spread accross all
airframe files.

* Fix FILTER_ROLL_RATE in bebop2_indi airframe

Moved to firmware targets so it will be disabled in gazebo.
Is this actually working in jsbsim??

* Update documentation

* Fix newlines

* Minor fixes in nps_fdm_gazebo.cpp

* Re-enable filter roll rate

Caution: causes oscillations around roll axis in gazebo

* Disable roll filter and cleanup
This commit is contained in:
Tom van Dijk
2018-01-30 16:39:18 +01:00
committed by Kirk Scheper
parent 2d86a0b60a
commit cfabb51eed
11 changed files with 477 additions and 61 deletions
@@ -0,0 +1,10 @@
<!DOCTYPE airframe SYSTEM "../../../airframes/airframe.dtd">
<airframe>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_THRUSTS" value="1.55, 1.55, 1.55, 1.55" type="float[]"/>
<define name="ACTUATOR_TORQUES" value="0.155, 0.155, 0.155, 0.155" type="float[]"/>
<define name="BYPASS_AHRS" value="1"/>
<define name="SIMULATE_VIDEO" value="1"/>
</section>
</airframe>
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE airframe SYSTEM "../../../airframes/airframe.dtd">
<airframe>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_THRUSTS" value="2.09, 2.09, 2.09, 2.09" type="float[]"/>
<define name="ACTUATOR_TORQUES" value="0.0250, 0.0250, 0.0250, 0.0250" type="float[]"/>
<define name="ACTUATOR_TIME_CONSTANTS" value="0.02, 0.02, 0.02, 0.02" type="float[]"/>
<define name="ACTUATOR_MAX_ANGULAR_MOMENTUM" value="0.19, 0.19, 0.19, 0.19" type="float[]"/>
<define name="GAZEBO_AC_NAME" value="bebop" type="string"/>
<define name="BYPASS_AHRS" value="1"/>
</section>
</airframe>
@@ -0,0 +1,264 @@
<?xml version='1.0'?>
<sdf version='1.4'>
<model name="bebop">
<pose>0 0 .1 0 0 0</pose>
<link name="chassis">
<velocity_decay>
<linear>0.001</linear>
</velocity_decay>
<inertial>
<mass>0.38905</mass>
<inertia>
<ixx> 0.000906 </ixx>
<iyy> 0.001242 </iyy>
<izz> 0.002054 </izz>
<ixy> 0. </ixy>
<ixz> 0.000014 </ixz>
<iyz> 0. </iyz>
</inertia>
</inertial>
<collision name="collision">
<geometry>
<box>
<size>0.4 0.4 0.05</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.15 0.05 0.05</size>
</box>
</geometry>
</visual>
<sensor name="contactsensor" type="contact">
<contact>
<collision>collision</collision>
</contact>
</sensor>
</link>
<!-- MOTORS -->
<link name="nw_motor">
<pose>0.077 0.095 0 0 0 0</pose>
<inertial>
<mass>0.01</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<visual name="visual">
<geometry>
<cylinder>
<radius>0.05</radius>
<length>0.02</length>
</cylinder>
</geometry>
<material>
<diffuse>0.25 0.85 0.95 1</diffuse>
<ambient>0.25 0.85 0.95 1</ambient>
</material>
</visual>
</link>
<joint type="fixed" name="nw_motor_joint">
<parent>chassis</parent>
<child>nw_motor</child>
</joint>
<link name="se_motor">
<pose>-0.077 -0.095 0 0 0 0</pose>
<inertial>
<mass>0.01</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<visual name="visual">
<geometry>
<cylinder>
<radius>0.05</radius>
<length>0.02</length>
</cylinder>
</geometry>
<material>
<diffuse>0.1 0.1 0.1 1</diffuse>
<ambient>0.1 0.1 0.1 1</ambient>
</material>
</visual>
</link>
<joint type="fixed" name="se_motor_joint">
<parent>chassis</parent>
<child>se_motor</child>
</joint>
<link name="ne_motor">
<pose>0.077 -0.095 0 0 0 0</pose>
<inertial>
<mass>0.01</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<visual name="visual">
<geometry>
<cylinder>
<radius>0.05</radius>
<length>0.02</length>
</cylinder>
</geometry>
<material>
<diffuse>0.25 0.85 0.95 1</diffuse>
<ambient>0.25 0.85 0.95 1</ambient>
</material>
</visual>
</link>
<joint type="fixed" name="ne_motor_joint">
<parent>chassis</parent>
<child>ne_motor</child>
</joint>
<link name="sw_motor">
<pose>-0.077 0.095 0 0 0 0</pose>
<inertial>
<mass>0.01</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<visual name="visual">
<geometry>
<cylinder>
<radius>0.05</radius>
<length>0.02</length>
</cylinder>
</geometry>
<material>
<diffuse>0.1 0.1 0.1 1</diffuse>
<ambient>0.1 0.1 0.1 1</ambient>
</material>
</visual>
</link>
<joint type="fixed" name="sw_motor_joint">
<parent>chassis</parent>
<child>sw_motor</child>
</joint>
<!-- CAMERAS -->
<link name="front_camera">
<pose>0.15 0 0 0 0 0</pose>
<inertial>
<mass>0.001</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<sensor type="camera" name="front_camera">
<update_rate>30.0</update_rate>
<camera name="front_camera">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>1280</width>
<height>720</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
<noise>
<type>gaussian</type>
<!-- Noise is sampled independently per pixel on each frame. That pixel's
noise value is added to each of its color channels, which at that point lie
in the range [0,1]. -->
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
</sensor>
</link>
<joint name="front_camera_joint" type="fixed">
<parent>chassis</parent>
<child>front_camera</child>
</joint>
<link name="bottom_camera">
<pose>0 0 -.03 0 1.57 0</pose>
<inertial>
<mass>0.001</mass>
<inertia>
<ixx>0.0001</ixx>
<iyy>0.0001</iyy>
<izz>0.0001</izz>
<ixy>0</ixy>
<iyz>0</iyz>
<ixz>0</ixz>
</inertia>
</inertial>
<sensor type="camera" name="bottom_camera">
<update_rate>30.0</update_rate>
<camera name="bottom_camera">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>320</width>
<height>240</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
<noise>
<type>gaussian</type>
<!-- Noise is sampled independently per pixel on each frame. That pixel's
noise value is added to each of its color channels, which at that point lie
in the range [0,1]. -->
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
</sensor>
</link>
<joint name="bottom_camera_joint" type="fixed">
<parent>chassis</parent>
<child>bottom_camera</child>
</joint>
</model>
</sdf>
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<model>
<name>Bebop (Paparazzi)</name>
<version>1.0</version>
<sdf version='1.4'>bebop.sdf</sdf>
<author>
<name>Tom van Dijk</name>
<email>tomvand@users.noreply.github.com</email>
</author>
<description>
Simple Bebop model for use with Paparazzi's NPS (http://wiki.paparazziuav.org).
</description>
</model>