-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New vehicle type: Airship #490
Merged
Merged
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7d48768
added cloudship model
antonerasm ccaf16f
detail edit
dan-leo 8b2a3c0
Merge pull request #1 from flycloudline/cloudline_airship_model
antonerasm 4deba1b
added cloudship model from v1.10.1
dan-leo eb3552f
working cloudship in gazebo
dan-leo 4848665
Update airship hull profile
antonerasm 96155a0
Merge cloudline branch
antonerasm f046038
Update airship dynamics, add reversable thrust to motor_model, and up…
antonerasm a01b3f5
Add parameter descriptions, fix Gazebo7 implementation and update aer…
antonerasm 982e62b
Merge remote-tracking branch 'upstream/master'
antonerasm f6e68a0
reset pwm input offset
dan-leo 3ad6b7c
Update reversible motor model
antonerasm 667a1d7
Merge remote-tracking branch 'upstream/master'
antonerasm acc3948
Revert accidental submodule OpticalFlow updates
antonerasm cfc5831
Update GPS sensor
antonerasm eb5a9e0
Update airship model
antonerasm 66dc928
Merge upstream master
antonerasm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OpticalFlow
updated
from 28ef45 to 544711
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/**************************************************************************** | ||
* | ||
* Copyright (c) 2018 PX4 Development Team. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* 3. Neither the name PX4 nor the names of its contributors may be | ||
* used to endorse or promote products derived from this software | ||
* without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
****************************************************************************/ | ||
/** | ||
* @brief LTA Dynamics Plugin | ||
* | ||
* This plugin simulates the aerodynamics of an airship. | ||
* The equations are based on the paper: | ||
* Airship Dynamics Modeling: A Literature Review | ||
* Authors: Y. Li, M. Nahon, I. Sharf | ||
* | ||
* @author Anton Erasmus <[email protected]> | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <boost/bind.hpp> | ||
#include <gazebo/gazebo.hh> | ||
#include <gazebo/physics/physics.hh> | ||
#include <gazebo/common/common.hh> | ||
#include <gazebo/common/Plugin.hh> | ||
#include "common.h" | ||
|
||
#include "Wind.pb.h" | ||
|
||
namespace gazebo { | ||
|
||
/// \brief Plugin class to implement the buoyancy and aerodynamics of a Lighter-Than-Air (LTA) airship. | ||
/// This plugin accepts the following SDF parameters: | ||
/// | ||
/// <linkName>: Name of base link for receiving pose and and applying forces. | ||
/// <hullVolume>: The volume of the hull of the airship. | ||
/// <airDensity>: The density of air. | ||
/// <m11>: The added mass matrix term in row 1 column 1. | ||
/// <m22>: The added mass matrix term in row 2 column 2. | ||
/// <m26>: The added mass matrix term in row 2 column 6. | ||
/// <m33>: The added mass matrix term in row 3 column 3. | ||
/// <m35>: The added mass matrix term in row 3 column 5. | ||
/// <m44>: The added mass matrix term in row 4 column 4. | ||
/// <m53>: The added mass matrix term in row 5 column 3. | ||
/// <m55>: The added mass matrix term in row 5 column 5. | ||
/// <m62>: The added mass matrix term in row 6 column 2. | ||
/// <m66>: The added mass matrix term in row 6 column 6. | ||
/// <distCOV>: The distance from the nose to the Center of Volume (CoV). | ||
/// <distPotentialFlow>: The distance from the nose where the flow ceases to be potential. | ||
/// <distFinCenter>: The distance from the nose to the center of a fin. | ||
/// <distQuarterChord>: The distance from the center to the quarter chord length of a fin. | ||
/// <forceHullInviscidFlowCoeff>: The force coefficient of the inviscid flow contribution of the hull. | ||
/// <forceHullViscousFlowCoeff>: The force coefficient of the viscous flow contribution of the hull. | ||
/// <momentHullInviscidFlowCoeff>: The moment coefficient of the inviscid flow contribution of the hull. | ||
/// <momentHullViscousFlowCoeff>: The moment coefficient of the viscous flow contribution of the hull. | ||
/// <finNormalForceCoeff>: The fin normal force coefficient. | ||
/// <finStallAngle>: The fin stall angle [deg]. | ||
/// <axialDragCoeff>: The axial drag coefficient. | ||
/// <windSubTopic>: The topic name to subscribe to wind velocity data. | ||
class GazeboLTADynamicsPlugin : public ModelPlugin { | ||
public: | ||
GazeboLTADynamicsPlugin() | ||
: ModelPlugin() {} | ||
|
||
virtual ~GazeboLTADynamicsPlugin(); | ||
virtual void Publish(); | ||
protected: | ||
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf); | ||
virtual void OnUpdate(const common::UpdateInfo &); | ||
|
||
virtual double Sign(double val); | ||
virtual ignition::math::Vector3d LocalVelocity(ignition::math::Vector3d lin_vel, ignition::math::Vector3d ang_vel, ignition::math::Vector3d dist); | ||
virtual double DynamicPressure(ignition::math::Vector3d vec); | ||
virtual void UpdateForcesAndMoments(); | ||
|
||
private: | ||
std::string namespace_; | ||
std::string link_name_; | ||
|
||
std::string wind_sub_topic_ = "/wind"; | ||
transport::SubscriberPtr wind_sub_; | ||
typedef const boost::shared_ptr<const physics_msgs::msgs::Wind> WindPtr; | ||
|
||
double param_hull_volume_; | ||
double param_air_density_; | ||
double param_m11_; | ||
double param_m22_; | ||
double param_m26_; | ||
double param_m33_; | ||
double param_m35_; | ||
double param_m44_; | ||
double param_m53_; | ||
double param_m55_; | ||
double param_m62_; | ||
double param_m66_; | ||
double param_cov_; | ||
double param_eps_v_; | ||
double param_dist_fin_x_; | ||
double param_dist_fin_quarter_chord_; | ||
double param_f_hif_coeff_; | ||
double param_f_hvf_coeff_; | ||
double param_m_hif_coeff_; | ||
double param_m_hvf_coeff_; | ||
double param_f_fnf_coeff_; | ||
double param_fin_stall_angle_; | ||
double param_axial_drag_coeff_; | ||
|
||
ignition::math::Vector3d wind_; | ||
|
||
transport::NodePtr node_handle_; | ||
physics::ModelPtr model_; | ||
physics::WorldPtr world_; | ||
physics::LinkPtr link_; | ||
event::ConnectionPtr updateConnection_; | ||
|
||
void WindVelocityCallback(WindPtr &wind); | ||
|
||
boost::thread callback_queue_thread_; | ||
void QueueThread(); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ | |
namespace turning_direction { | ||
const static int CCW = 1; | ||
const static int CW = -1; | ||
const static int CCW_REVERSABLE = 2; | ||
const static int CW_REVERSABLE = -2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I commented in the other part of the code, I think reversible should be a separate state (possibly a boolean) |
||
} | ||
|
||
namespace gazebo { | ||
|
@@ -82,7 +84,7 @@ class GazeboMotorModel : public MotorModel, public ModelPlugin { | |
motor_speed_pub_topic_(kDefaultMotorVelocityPubTopic), | ||
motor_number_(0), | ||
motor_Failure_Number_(0), | ||
turning_direction_(turning_direction::CW), | ||
turning_direction_type_(turning_direction::CW), | ||
max_force_(kDefaultMaxForce), | ||
max_rot_velocity_(kDefaulMaxRotVelocity), | ||
moment_constant_(kDefaultMomentConstant), | ||
|
@@ -118,7 +120,7 @@ class GazeboMotorModel : public MotorModel, public ModelPlugin { | |
std::string namespace_; | ||
|
||
int motor_number_; | ||
int turning_direction_; | ||
int turning_direction_type_; | ||
|
||
int motor_Failure_Number_; /*!< motor_Failure_Number is (motor_number_ + 1) as (0) is considered no_fail. Publish accordingly */ | ||
int tmp_motor_num; // A temporary variable used to print msg | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document what each parameter stands for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On lines 56-83 I documented what each of the gazebo plugin parameters are. I thought that would be sufficient. Would you rather that I restate that here for each variable as well? Let me know what you think and I'll make the necessary changes