Merge branch 'main' into 2027

This commit is contained in:
Peter Johnson
2025-11-01 09:39:08 -07:00
61 changed files with 455 additions and 941 deletions

View File

@@ -260,7 +260,7 @@ WPILIB_DLLEXPORT constexpr Eigen::Vector3d PoseTo3dVector(const Pose2d& pose) {
}
/**
* Converts a Pose2d into a vector of [x, y, std::cos(theta), std::sin(theta)].
* Converts a Pose2d into a vector of [x, y, cos(theta), sin(theta)].
*
* @param pose The pose that is being represented.
*

View File

@@ -91,7 +91,7 @@ class WPILIB_DLLEXPORT Ellipse2d {
auto a = units::math::max(m_xSemiAxis, m_ySemiAxis);
// Minor semi-axis
auto b = units::math::min(m_xSemiAxis, m_ySemiAxis); // NOLINT
auto b = units::math::min(m_xSemiAxis, m_ySemiAxis);
auto c = units::math::sqrt(a * a - b * b);
@@ -203,7 +203,9 @@ class WPILIB_DLLEXPORT Ellipse2d {
auto x = rotPoint.X() - m_center.X();
auto y = rotPoint.Y() - m_center.Y();
// NOLINTNEXTLINE (bugprone-integer-division)
return (x * x) / (m_xSemiAxis * m_xSemiAxis) +
// NOLINTNEXTLINE (bugprone-integer-division)
(y * y) / (m_ySemiAxis * m_ySemiAxis);
}
};

View File

@@ -296,8 +296,8 @@ class WPILIB_DLLEXPORT Quaternion {
// 𝑣⃗ = θ * v̂
// v̂ = 𝑣⃗ / θ
// 𝑞 = std::cos(θ/2) + std::sin(θ/2) * v̂
// 𝑞 = std::cos(θ/2) + std::sin(θ/2) / θ * 𝑣⃗
// 𝑞 = cos(θ/2) + sin(θ/2) * v̂
// 𝑞 = cos(θ/2) + sin(θ/2) / θ * 𝑣⃗
double theta = gcem::hypot(rvec(0), rvec(1), rvec(2));
double cos = gcem::cos(theta / 2);

View File

@@ -247,6 +247,31 @@ class WPILIB_DLLEXPORT DCMotor {
return DCMotor(12_V, 9.37_Nm, 483_A, 2_A, 5800_rpm, numMotors);
}
/**
* Return a gearbox of Kraken X44 brushless motors.
*/
static constexpr DCMotor KrakenX44(int numMotors = 1) {
// From https://motors.ctr-electronics.com/dyno/dynometer-testing/
return DCMotor(12_V, 4.11_Nm, 279_A, 2_A, 7758_rpm, numMotors);
}
/**
* Return a gearbox of Kraken X44 brushless motors with FOC (Field-Oriented
* Control) enabled.
*/
static constexpr DCMotor KrakenX44FOC(int numMotors = 1) {
// From https://motors.ctr-electronics.com/dyno/dynometer-testing/
return DCMotor(12_V, 5.01_Nm, 329_A, 2_A, 7368_rpm, numMotors);
}
/**
* Return a gearbox of Minion brushless motors.
*/
static constexpr DCMotor Minion(int numMotors = 1) {
// From https://motors.ctr-electronics.com/dyno/dynometer-testing/
return DCMotor(12_V, 3.17_Nm, 211_A, 2_A, 7704_rpm, numMotors);
}
/**
* Return a gearbox of Neo Vortex brushless motors.
*/