mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Replace .to<double>() and .template to<double>() with .value() (#3667)
It's a less verbose way to do the same thing.
This commit is contained in:
@@ -109,8 +109,7 @@ class Spline {
|
||||
* @return The vector.
|
||||
*/
|
||||
static Eigen::Vector2d ToVector(const Translation2d& translation) {
|
||||
return Eigen::Vector2d{translation.X().to<double>(),
|
||||
translation.Y().to<double>()};
|
||||
return Eigen::Vector2d{translation.X().value(), translation.Y().value()};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,14 +80,14 @@ class WPILIB_DLLEXPORT SplineHelper {
|
||||
private:
|
||||
static Spline<3>::ControlVector CubicControlVector(double scalar,
|
||||
const Pose2d& point) {
|
||||
return {{point.X().to<double>(), scalar * point.Rotation().Cos()},
|
||||
{point.Y().to<double>(), scalar * point.Rotation().Sin()}};
|
||||
return {{point.X().value(), scalar * point.Rotation().Cos()},
|
||||
{point.Y().value(), scalar * point.Rotation().Sin()}};
|
||||
}
|
||||
|
||||
static Spline<5>::ControlVector QuinticControlVector(double scalar,
|
||||
const Pose2d& point) {
|
||||
return {{point.X().to<double>(), scalar * point.Rotation().Cos(), 0.0},
|
||||
{point.Y().to<double>(), scalar * point.Rotation().Sin(), 0.0}};
|
||||
return {{point.X().value(), scalar * point.Rotation().Cos(), 0.0},
|
||||
{point.Y().value(), scalar * point.Rotation().Sin(), 0.0}};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user