James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 1 | // 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 | |
| 9 | namespace frc { |
| 10 | |
| 11 | frc::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 |