blob: 97968dce908f05ce754cef28cabbed982b78fbeb [file] [log] [blame]
James Kuszmaulcf324122023-01-14 14:07:17 -08001// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#include "frc/ComputerVisionUtil.h"
6
7#include "units/math.h"
8
9namespace frc {
10
11frc::Pose3d ObjectToRobotPose(const frc::Pose3d& objectInField,
12 const frc::Transform3d& cameraToObject,
13 const frc::Transform3d& robotToCamera) {
14 const auto objectToCamera = cameraToObject.Inverse();
15 const auto cameraToRobot = robotToCamera.Inverse();
16 return objectInField + objectToCamera + cameraToRobot;
17}
18
19} // namespace frc