Below is my code. I have all the DH parameters that will allow me to calculate the end effector position.
I'm not sure where to input the values of thetas 1 ~5 shown at the bottom. Please help.
function [T] = getTransformMatrix(theta, d, a, alpha)
T = [cosd(theta) -sind(theta) * cosd(alpha)...
5 links (thus 6 frames) and corresponding theta, alpha, d and a values are all given.
However, I'm not sure how to start coding the DH parameters to derive a forward kinematics model.
I know that I'll have to use matrix operators, but do I just put in the values of the 4 factors mentioned above...
The process is a bit complicated, I am uploading everything I have, please have a look.
I'm attaching the excel file as well where the example calculation was done.
I am thinking of doing the same thing (summing up all the uncertainties that contribute to U(E) in the example) for the task, so summing up all the fractional uncertainties that contribute to U(Q). But the problem is unlike energy in the example, I'm not sure what's the contributors that lead to...
Thank you for your reply.
An example calculation was provided and I was told to use the same method for this task.
The example given was a crater created when a ball strikes sand from a vertical height h.
A table of results and additional information was provided- please refer to the attached...
Now I have the correct code. It is shown below.
I want to use another for loop to read the matrix and the vector though, without declaring the size of the matrix and vector as [3][3] or [3]. Should I use something like count to do this?
#include <iostream>
#include <fstream>
#include <string>...
Below is the edited code. But the result seems wrong. What can I do to make the code read only until data runs out? So I've first set the matrices to 10 x 10 as shown below, but I want this code to work also for any size matrices. For example, if it's a 4x4 matrix out of 10x10 matrix times 4x4...
Text files are arranged just normally I would say, without any headers. They contain pure integer values only, please refer to the file attached. For matrix B, I think it might be replaced with a new one (when the code is tested) where the column number is not 1. Sorry for the confusion, since...
Yes I've covered getline and used it to read and discard the first line of a text file before (the header). But I haven't learned any C-style input methods. I've covered eof as well for the end of file.
Instead of storing each value (if it goes up to 10 x 10, the code will be too long), is...
Right. Below is the fixed code.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
int i, j;
int A[10][10], B[10][10], C[10][10];
ifstream inFile1("matrix(1).txt");
ifstream inFile2("vector(1).txt");
for (int i = 0; i < 10; i++)...
The data files are given to me. As mentioned the two files given contain a 3x3 square matrix and a 3x1 vector respectively, but when the code gets tested they'll give another file that can go up to 1x1 to 10x10 square matrix and the corresponding vector (1x1 to 10x1). I cannot edit the file as...
Sorry for the late reply. Actually the task is reading two text files (one with a square matrix and the other with a vector) and multiplying them. It is not two square matrices, it is one square matrix and one vector.
The text files are given as the matrix having 3 x 3 and the vector having 3 x...
Alright, thank you.
I've tried to write the code to read the matrices but I don't think using xcoordinates[count], ycoordinates and zcoordinates is correct because I don't know what size the matrices are going to be. If it is 4 x 4 matrix, x y z is not enough since there's one more to take into...