Skip to content

Commit

Permalink
piston force should be in Newtons rather than lbs
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Anderson <[email protected]>
  • Loading branch information
andermi committed Aug 29, 2023
1 parent eeca9ce commit ac7f755
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buoy_gazebo/src/ElectroHydraulicPTO/ElectroHydraulicPTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void ElectroHydraulicPTO::PreUpdate(
// Apply force if not in Velocity Mode, in which case a joint velocity is applied elsewhere
// (likely by a test Fixture)
if (!this->dataPtr->VelMode) {
double piston_force = -deltaP * this->dataPtr->PistonArea;
double piston_force = -deltaP * this->dataPtr->PistonArea * buoy_utils::NEWTONS_PER_LB;
// Create new component for this entitiy in ECM (if it doesn't already exist)
auto forceComp = _ecm.Component<gz::sim::components::JointForceCmd>(
this->dataPtr->PrismaticJointEntity);
Expand All @@ -446,7 +446,7 @@ void ElectroHydraulicPTO::PreUpdate(
this->dataPtr->PrismaticJointEntity,
gz::sim::components::JointForceCmd({piston_force})); // Create this iteration
} else {
forceComp->Data()[0] += piston_force; // Add force to existing forces.
forceComp->Data()[0] += piston_force; // Add force to existing forces.
}
}
}
Expand Down
1 change: 1 addition & 0 deletions buoy_gazebo/src/buoy_utils/Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static constexpr double RPM_TO_RAD_PER_SEC{2.0 * M_PI / 60.0};
static constexpr double NM_PER_INLB{0.112984829};
static constexpr double INLB_PER_NM{8.851};
static constexpr double INCHES_PER_METER{39.4};
static constexpr double NEWTONS_PER_LB{4.4482};
} // namespace buoy_utils


Expand Down

0 comments on commit ac7f755

Please sign in to comment.