Skip to content
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

Fluid density #496

Open
wants to merge 3 commits into
base: gazebo_classic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions usv_gazebo_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ catkin_package(
CATKIN_DEPENDS message_runtime gazebo_dev roscpp wave_gazebo_plugins
)

# Plugins require c++11
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
# Plugins require c++17
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")

include_directories( include
${catkin_INCLUDE_DIRS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace gazebo
/// <boatArea>: Horizontal surface area [m^2]. Default value is 0.48.
/// <boatLength>: Boat length [m]. Default value is 1.35.
/// <boatWidth>: Boat width [m]. Default value is 1.
/// <waterDensity>: Water density [kg/m^3]. Default value is 997.7735.
/// <waterDensity>: Water density [kg/m^3]. Default value is 1000.
/// <waterLevel>: Water height [m]. Default value is 0.5.
/// <xDotU>: Added mass coeff, surge.
/// <yDotV>: Added mass coeff, sway.
Expand Down
2 changes: 1 addition & 1 deletion usv_gazebo_plugins/src/buoyancy_gazebo_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ std::string BuoyancyObject::Disp()

/////////////////////////////////////////////////
BuoyancyPlugin::BuoyancyPlugin()
: fluidDensity(997),
: fluidDensity(1000),
fluidLevel(0.0),
linearDrag(0.0),
angularDrag(0.0),
Expand Down
2 changes: 1 addition & 1 deletion usv_gazebo_plugins/src/usv_gazebo_dynamics_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void UsvDynamicsPlugin::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
}

this->waterLevel = this->SdfParamDouble(_sdf, "waterLevel" , 0.5);
this->waterDensity = this->SdfParamDouble(_sdf, "waterDensity", 997.7735);
this->waterDensity = this->SdfParamDouble(_sdf, "waterDensity", 1000);
this->paramXdotU = this->SdfParamDouble(_sdf, "xDotU" , 5);
this->paramYdotV = this->SdfParamDouble(_sdf, "yDotV" , 5);
this->paramZdotW = this->SdfParamDouble(_sdf, "zDotW" , 0.1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<bodyName>${namespace}/base_link</bodyName>
<!-- Must be same as the ocean model!-->
<waterLevel>0</waterLevel>
<waterDensity>997.8</waterDensity>
<waterDensity>1000</waterDensity>
<!-- Added mass -->
<xDotU>0.0</xDotU>
<yDotV>0.0</yDotV>
Expand Down
16 changes: 4 additions & 12 deletions wave_gazebo_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@ cmake_minimum_required(VERSION 2.8.3)
project(wave_gazebo_plugins)

###############################################################################
# Compile as C++11, supported in ROS Kinetic and newer

#set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)

# For this package set as C++14
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "-std=c++14")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
if(COMPILER_SUPPORTS_CXX17)
add_compile_options(-std=c++17)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
endif()

# Set policy for CMake 3.1+. Use OLD policy to let FindBoost.cmake, dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace asv

/// \brief Density of water.
///
/// \return 998.6 [kg m-3].
/// \return 1000 [kg m-3].
public: static double WaterDensity();

/// \brief Kinematic viscosity of water at 18 dgree C.
Expand Down
2 changes: 1 addition & 1 deletion wave_gazebo_plugins/src/PhysicalConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace asv
/////////////////////////////////////////////////////////////////////////////
double PhysicalConstants::WaterDensity()
{
return 998.6;
return 1000.;
}

/////////////////////////////////////////////////////////////////////////////
Expand Down