22#include <wpi/math/geometry/Pose3d.hpp>
23#include <wpi/math/geometry/Rotation3d.hpp>
24#include <wpi/math/geometry/Translation3d.hpp>
30 const wpi::math::Translation3d& newTrl)
31 : trl{newTrl}, rot{newRot} {}
34 const wpi::math::Pose3d& last)
35 : trl{last.Translation() -
36 initial.Translation().RotateBy(
37 last.Rotation().RelativeTo(initial.Rotation()))},
38 rot{last.Rotation().RelativeTo(initial.Rotation())} {}
50 wpi::math::Rotation3d invRot = rot.Inverse();
51 wpi::math::Translation3d invTrl = -(trl.RotateBy(invRot));
56 return wpi::math::Transform3d{trl, rot};
64 const wpi::math::Translation3d& trlToApply)
const {
65 return trlToApply.RotateBy(rot) + trl;
69 const std::vector<wpi::math::Translation3d>& trls)
const {
70 std::vector<wpi::math::Translation3d> retVal;
71 retVal.reserve(trls.size());
72 for (
const auto& currentTrl : trls) {
73 retVal.emplace_back(
Apply(currentTrl));
78 wpi::math::Rotation3d
Apply(
const wpi::math::Rotation3d& rotToApply)
const {
79 return rotToApply.RotateBy(rot);
83 const std::vector<wpi::math::Rotation3d>& rots)
const {
84 std::vector<wpi::math::Rotation3d> retVal;
85 retVal.reserve(rots.size());
86 for (
const auto& currentRot : rots) {
87 retVal.emplace_back(
Apply(currentRot));
92 wpi::math::Pose3d
Apply(
const wpi::math::Pose3d& poseToApply)
const {
93 return wpi::math::Pose3d{
Apply(poseToApply.Translation()),
94 Apply(poseToApply.Rotation())};
98 const std::vector<wpi::math::Pose3d>& poses)
const {
99 std::vector<wpi::math::Pose3d> retVal;
100 retVal.reserve(poses.size());
101 for (
const auto& currentPose : poses) {
102 retVal.emplace_back(
Apply(currentPose));
108 const wpi::math::Translation3d trl;
109 const wpi::math::Rotation3d rot;
Definition VisionEstimation.h:30
Definition TimeSyncServer.h:32