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

Adds support for ocean currents #800

Merged
merged 16 commits into from
May 21, 2021
5 changes: 5 additions & 0 deletions src/systems/hydrodynamics/Hydrodynamics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ void Hydrodynamics::Configure(
return;
}

if(_sdf->HasElement("defaultCurrent"))
{
this->dataPtr->currentVector= _sdf->Get<math::Vector3d>("defaultCurrent");
}

this->dataPtr->prevState = Eigen::VectorXd::Zero(6);

AddWorldPose(this->dataPtr->linkEntity, _ecm);
Expand Down
2 changes: 2 additions & 0 deletions src/systems/hydrodynamics/Hydrodynamics.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ namespace systems
/// separately. If no namespace is given then the plugin listens on
/// the `/ocean_current` topic for a `Vector3d` message. Otherwise it
/// listens on `/model/{namespace name}/ocean_current`.[String, Optional]
/// <defaultCurrent> - A generic current.
arjo129 marked this conversation as resolved.
Show resolved Hide resolved
/// [vector3d m/s, optional, default = [0,0,0]m/s]
///
/// # Example
/// An example configuration is provided in the examples folder. The example
Expand Down