-
Notifications
You must be signed in to change notification settings - Fork 277
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
Adding thrust coefficient calculation #1652
Merged
nkoenig
merged 14 commits into
ign-gazebo6
from
marcoag/thrust_coefficient_for_thrust_plugin
Oct 6, 2022
+270
−6
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8e93dec
adding thrust coefficient calculation
f8550f1
Update src/systems/thruster/Thruster.cc
4f34ef0
Update src/systems/thruster/Thruster.cc
marcoag 0a69777
Update src/systems/thruster/Thruster.cc
marcoag 7afeb94
Update src/systems/thruster/Thruster.cc
marcoag bd78fd6
Update src/systems/thruster/Thruster.cc
marcoag 0ac7d98
Update src/systems/thruster/Thruster.cc
marcoag 87a1ae3
Update src/systems/thruster/Thruster.cc
marcoag fd99f00
Update src/systems/thruster/Thruster.cc
marcoag 0cd1d65
Update src/systems/thruster/Thruster.hh
marcoag 79abb52
Merge branch 'ign-gazebo6' into marcoag/thrust_coefficient_for_thrust…
7351aab
thrust coefficient test and behavior updates
51337cd
making float comparision more robust
b051ef0
fix float comparision and lint
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
thrust coefficient test and behavior updates
Signed-off-by: Marco A. Gutierrez <[email protected]>
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
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
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
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,114 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<world name="thruster"> | ||
|
||
<physics name="fast" type="none"> | ||
<!-- Zero to run as fast as possible --> | ||
<real_time_factor>0</real_time_factor> | ||
</physics> | ||
|
||
<!-- prevent sinking --> | ||
<gravity>0 0 0</gravity> | ||
|
||
<plugin | ||
filename="ignition-gazebo-physics-system" | ||
name="ignition::gazebo::systems::Physics"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-scene-broadcaster-system" | ||
name="ignition::gazebo::systems::SceneBroadcaster"> | ||
</plugin> | ||
|
||
<light type="directional" name="sun"> | ||
<cast_shadows>true</cast_shadows> | ||
<pose>0 0 10 0 0 0</pose> | ||
<diffuse>1 1 1 1</diffuse> | ||
<specular>0.5 0.5 0.5 1</specular> | ||
<attenuation> | ||
<range>1000</range> | ||
<constant>0.9</constant> | ||
<linear>0.01</linear> | ||
<quadratic>0.001</quadratic> | ||
</attenuation> | ||
<direction>-0.5 0.1 -0.9</direction> | ||
</light> | ||
|
||
<model name="sub"> | ||
|
||
<link name="body"> | ||
<pose>0 0 0 0 1.57 0</pose> | ||
<inertial> | ||
<mass>100</mass> | ||
<inertia> | ||
<ixx>33.89</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>33.89</iyy> | ||
<iyz>0</iyz> | ||
<izz>1.125</izz> | ||
</inertia> | ||
</inertial> | ||
<visual name="visual"> | ||
<geometry> | ||
<cylinder> | ||
<length>2</length> | ||
<radius>0.15</radius> | ||
</cylinder> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<link name="propeller"> | ||
<pose>-1.05 0 0 0 0 0</pose> | ||
<inertial> | ||
<mass>0.1</mass> | ||
<inertia> | ||
<ixx>0.000354167</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>0.000021667</iyy> | ||
<iyz>0</iyz> | ||
<izz>0.000334167</izz> | ||
</inertia> | ||
</inertial> | ||
<visual name="visual"> | ||
<geometry> | ||
<box> | ||
<size>0.01 0.25 0.05</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<joint name="propeller_joint" type="revolute"> | ||
<parent>body</parent> | ||
<child>propeller</child> | ||
<axis> | ||
<xyz>1 0 0</xyz> | ||
<limit> | ||
<lower>-1e+12</lower> | ||
<upper>1e+12</upper> | ||
<effort>1e6</effort> | ||
<velocity>1e6</velocity> | ||
</limit> | ||
</axis> | ||
</joint> | ||
|
||
<plugin | ||
filename="ignition-gazebo-thruster-system" | ||
name="ignition::gazebo::systems::Thruster"> | ||
<namespace>custom</namespace> | ||
<joint_name>propeller_joint</joint_name> | ||
<fluid_density>950</fluid_density> | ||
<propeller_diameter>0.25</propeller_diameter> | ||
<velocity_control>true</velocity_control> | ||
<max_thrust_cmd>300</max_thrust_cmd> | ||
<min_thrust_cmd>0</min_thrust_cmd> | ||
<wake_fraction>0.2</wake_fraction> | ||
<alpha_1>0.9</alpha_1> | ||
<alpha_2>0.01</alpha_2> | ||
</plugin> | ||
</model> | ||
|
||
</world> | ||
</sdf> |
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.
@marcoag could the thrust coefficient ever become zero while moving (in other words, could either or be negative)? If so, maybe we should reset thrust coefficient to one if propeller angular velocity ever becomes zero. WDYT?
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.
Also, I'm surprised the compiler didn't complain about a floating point comparison to zero. AFAIK
std::abs(this->propellerAngVel) < std::numeric_limits<double>::epsilon()
would be a slightly more robust test.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.
It did threw a warning, I assumed anything that is not a strict zero would work.
Changed to your suggestion: 51337cd.