mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -8,12 +8,12 @@
|
||||
#include "wpi/math/system/Discretization.hpp"
|
||||
#include "wpi/units/math.hpp"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::math;
|
||||
|
||||
ChassisSpeeds LTVUnicycleController::Calculate(
|
||||
const Pose2d& currentPose, const Pose2d& poseRef,
|
||||
units::meters_per_second_t linearVelocityRef,
|
||||
units::radians_per_second_t angularVelocityRef) {
|
||||
wpi::units::meters_per_second_t linearVelocityRef,
|
||||
wpi::units::radians_per_second_t angularVelocityRef) {
|
||||
// The change in global pose for a unicycle is defined by the following three
|
||||
// equations.
|
||||
//
|
||||
@@ -53,7 +53,7 @@ ChassisSpeeds LTVUnicycleController::Calculate(
|
||||
|
||||
// The DARE is ill-conditioned if the velocity is close to zero, so don't
|
||||
// let the system stop.
|
||||
if (units::math::abs(linearVelocityRef) < 1e-4_mps) {
|
||||
if (wpi::units::math::abs(linearVelocityRef) < 1e-4_mps) {
|
||||
linearVelocityRef = 1e-4_mps;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ ChassisSpeeds LTVUnicycleController::Calculate(
|
||||
m_poseError.Rotation().Radians().value()};
|
||||
Eigen::Vector2d u = K * e;
|
||||
|
||||
return ChassisSpeeds{linearVelocityRef + units::meters_per_second_t{u(0)},
|
||||
return ChassisSpeeds{linearVelocityRef + wpi::units::meters_per_second_t{u(0)},
|
||||
0_mps,
|
||||
angularVelocityRef + units::radians_per_second_t{u(1)}};
|
||||
angularVelocityRef + wpi::units::radians_per_second_t{u(1)}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user