Hand-Eye Coordination
Utilities and FeatureDetection Class
Types
Name | Description |
---|---|
FeatureDetection | A class that contains computer vision methods that are used in the project |
Functions
Name | Description |
---|---|
ReadMatrixFromTxt | Read in txt file and store data as an Eigen matrix Parameter path : path to the .txt file Parameter output : output matrix |
ReadParameter | Obtain joint 4 position expressed in the robot base frame via Denavit–Hartenberg (DH) transformation matricesRead parameters from file |
SVD_rigid_transform | Find out the rigid transformation matrix from one point cloud to the other, with known correspondences |
DrawDashedLine | Function for drawing a dashed line |
Function Details
DrawDashedLine
void DrawDashedLine(cv::Mat& img, cv::Point pt1, cv::Point pt2, cv::Scalar color, int thickness, std::string style, int gap)
Function for drawing a dashed line
- Parameter
img
- image on which the dashed line is drawn
- Parameter
pt1
- pixel position of the starting point
- Parameter
pt2
- pixel position of the ending point
- Parameter
color
- colour scalar
- Parameter
thickness
- thickness value
- Parameter
style
- line style, "dotted" by default
- Parameter
gap
- gap of the dashed line
ReadMatrixFromTxt
void ReadMatrixFromTxt(const std::string path, Eigen::MatrixXd &output)
Read in txt file and store data as an Eigen matrix
- Parameter
path
- path to the .txt file
- Parameter
output
- output matrix
ReadParameter
template<typename T> inline void ReadParameter(const std::string &path, const std::string &key, T &value)
Obtain joint 4 position expressed in the robot base frame via Denavit–Hartenberg (DH) transformation matrices
- Parameter
JointAngleList
- Historical joint angles from the encoder reading.
- Parameter
J4PositionList
- Output matrix that stores historical joint 4 positions in the robot frame.
- Parameter
l1
- built-in parameter l1
- Parameter
l2
-
built-in parameter l2
Read parameters from file
- Template parameter
T
- data type
- Parameter
path
- file path
- Parameter
key
- parameter name
- Parameter
value
- output parameter value
SVD_rigid_transform
Eigen::Matrix4d SVD_rigid_transform(const Eigen::MatrixXd &pts1, const Eigen::MatrixXd &pts2)
Find out the rigid transformation matrix from one point cloud to the other, with known correspondences
- Parameter
pts1
- n*3 matrix, which stores the 3D positions of points in cloud 1
- Parameter
pts2
- n*3 matrix, which stores the 3D positions of points in cloud 2
- Return
- Eigen::Matrix4d rigid homogeneous transformation matrix