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

Added Cmat in hydrodynamic forces equation #466

Open
wants to merge 3 commits into
base: gazebo_classic
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion usv_gazebo_plugins/src/usv_gazebo_dynamics_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void UsvDynamicsPlugin::Update()
Cmat(1, 5) = this->paramXdotU * kVelLinearBody.X();
Cmat(5, 0) = this->paramYdotV * kVelLinearBody.Y();
Cmat(5, 1) = this->paramXdotU * kVelLinearBody.X();
const Eigen::VectorXd kCmat = Cmat * state;

// Drag
Dmat(0, 0) = this->paramXu + this->paramXuu * std::abs(kVelLinearBody.X());
Expand All @@ -277,7 +278,7 @@ void UsvDynamicsPlugin::Update()
tf2::Transform xformV = tf2::Transform(vq);

// Sum all forces - in body frame
const Eigen::VectorXd kForceSum = kAmassVec + kDvec;
const Eigen::VectorXd kForceSum = kAmassVec + kCmat + kDvec;

// Forces in fixed frame
ROS_DEBUG_STREAM_THROTTLE(1.0, "forceSum :\n" << kForceSum);
Expand Down