2022-04-08 21:20:53 -07:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
|
|
|
|
|
#include "frc/ComputerVisionUtil.h"
|
|
|
|
|
|
|
|
|
|
#include "units/math.h"
|
|
|
|
|
|
|
|
|
|
namespace frc {
|
|
|
|
|
|
2022-12-06 21:11:27 -08:00
|
|
|
frc::Pose3d ObjectToRobotPose(const frc::Pose3d& objectInField,
|
|
|
|
|
const frc::Transform3d& cameraToObject,
|
|
|
|
|
const frc::Transform3d& robotToCamera) {
|
|
|
|
|
const auto objectToCamera = cameraToObject.Inverse();
|
|
|
|
|
const auto cameraToRobot = robotToCamera.Inverse();
|
|
|
|
|
return objectInField + objectToCamera + cameraToRobot;
|
2022-04-08 21:20:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace frc
|