rmcv
v0.1.0
A library for RoboMaster computer vision based on OpenCV.
|
Go to the documentation of this file.
10 #ifndef RMCV_MOBILITY_H
11 #define RMCV_MOBILITY_H
13 #include "core/core.h"
29 void AxisRotateX(
double y,
double z,
double thetaX,
double &outY,
double &outZ);
37 void AxisRotateY(
double x,
double z,
double thetaY,
double &outX,
double &outZ);
45 void AxisRotateZ(
double x,
double y,
double thetaZ,
double &outX,
double &outY);
53 [[maybe_unused]]
double
54 DeltaHeight(cv::InputArray translationVector,
double motorAngle,
const cv::Point2f &offset = {0, 0},
55 double angleOffset = 0);
60 [[maybe_unused]]
double Distance(cv::InputArray translationVector);
81 SolveCameraPose(cv::InputArray rotationVector, cv::InputArray translationVector, cv::OutputArray pose);
93 [[maybe_unused]]
double
94 SolveGEA(cv::InputArray translationVector, cv::OutputArray gimbalErrorAngle,
double g,
double v0,
double h,
106 [[maybe_unused]]
bool
107 SolvePNP(
const std::vector<cv::Point2f> &imagePoints, cv::InputArray cameraMatrix, cv::InputArray distortionFactor,
108 const cv::Size2f &exactSize, cv::OutputArray translationVector, cv::OutputArray rotationVector,
109 const cv::Rect &ROI = {0, 0, 0, 0});
112 #endif //RMCV_MOBILITY_H
void AxisRotateY(double x, double z, double thetaY, double &outX, double &outZ)
Rotate the vector around the y-axis.
Definition: mobility.cpp:16
CompensateMode
Define witch method is used to calculate the compensation of gravity.
Definition: mobility.h:17
bool SolveCameraPose(cv::InputArray rotationVector, cv::InputArray translationVector, cv::OutputArray pose)
Solve camera pose in pitch, yaw, and roll relative to a target.
Definition: mobility.cpp:73
bool SolvePNP(const std::vector< cv::Point2f > &imagePoints, cv::InputArray cameraMatrix, cv::InputArray distortionFactor, const cv::Size2f &exactSize, cv::OutputArray translationVector, cv::OutputArray rotationVector, const cv::Rect &ROI={0, 0, 0, 0})
Solve the rotation & translation vector using cv::solvePnP & cv::SOLVEPNP_IPPE_SQUARE.
Definition: mobility.cpp:150
@ COMPENSATE_CLASSIC
Use newtonian's theorem of mechanics.
Definition: mobility.h:19
@ COMPENSATE_NONE
No compensation.
Definition: mobility.h:18
void AxisRotateX(double y, double z, double thetaX, double &outY, double &outZ)
Rotate the vector around the x-axis.
Definition: mobility.cpp:8
double DeltaHeight(cv::InputArray translationVector, double motorAngle, const cv::Point2f &offset={0, 0}, double angleOffset=0)
Solve height difference between barrel and target.
Definition: mobility.cpp:32
double ProjectileAngle(double v0, double g, double d, double h)
Solve initial angle required for a projectile motion.
Definition: mobility.cpp:55
double Distance(cv::InputArray translationVector)
Solve the distance between camera and target.
Definition: mobility.cpp:47
Main modules.
Definition: daheng.h:17
@ COMPENSATE_NI
Use newton iteration method.
Definition: mobility.h:20
void AxisRotateZ(double x, double y, double thetaZ, double &outX, double &outY)
Rotate the vector around the z-axis.
Definition: mobility.cpp:24
double SolveGEA(cv::InputArray translationVector, cv::OutputArray gimbalErrorAngle, double g, double v0, double h, const cv::Point2f &offset={0, 0}, double angleOffset=0, rm::CompensateMode mode=rm::COMPENSATE_NONE)
Solve gimbal error angle to target by given method.
Definition: mobility.cpp:114