-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The dimension of the Mass Matrix and the bias force #77
Comments
I guess you are simulating a 6-DOF robot? A think to take in account is that the adam by default returns the floating base mass matrix, i.e. the one described in Equation 3.57 of https://traversaro.github.io/traversaro-phd-thesis/traversaro-phd-thesis.pdf . |
Yes I am using a robot with a DOF of 6, so I can directly exclude rows and columns from 7 to 12? |
I have another question. I'm trying to simulate a robot with 6 degrees of freedom (DOF), but I don't understand why I'm getting a 'NaN' (not a number) value. Here's my code: |
adam by default gives you the following equation of motions composed by (again, from Eq 3.57 https://traversaro.github.io/traversaro-phd-thesis/traversaro-phd-thesis.pdf) 12 (6+6) rows: where the position If you want to simulate a fixed base robot, you need to apply the constraint that is equivalent to: that means that only actual state that can change of the system are internal joint positions, velocities and accelerations ( where Substituting this equations in equations of motions and assuming that the only external force on the system is the constraint force acting on the base as you are probably not interested in the part of the dynamics related to or: |
Can you open a separate issue for this problem, and provide in it the output of your script, and the exact version of the installed dependencies, in particular casadi if you are using the casadi backend? Thanks! As a preliminary comment, I suggest you to also print the input to the dynamics to verify that there are no NaN in the inputs. |
cc @Giulero |
I want to calculate the dynamics of robot
Where |
I'm sorry but the formula was ν˙ = M^-1(tau-h) |
Hi @tommasoandina1! As @traversaro said, adam, by default, returns the floating-base mass matrix. In order to help you, could you point us to the exact piece of code you're running with the output of your application? |
Hi, there seems to be an issue here: https://github.com/tommasoandina1/Doosan_h2515/blob/main/doosan.ipynb. When I attempted to print the mass matrix and bias force, I don't understand why I'm getting a NaN value |
Can you print |
Hi, it seems you are using at first symbolic types Try to remove |
Now I've updated the code |
I'm only receiving variable values, not numerical ones |
From https://github.com/tommasoandina1/Doosan_h2515/blob/main/doosan.ipynb the output is the expected one.
Since you are using If you want numerical values when calling |
But I'm using a robot model through a URDF file, so shouldn't I get a numerical value for my mass matrix? |
The mass matrix depends on the robot configuration, namely Have a look to
To inspect the mass matrix structure. These are for a manipulator, but for a floating-base robot the intuition is the same. |
In theory, I understood, so to calculate the values of the mass matrix and the mean error, do I have to calculate the heat from the Lagrangian or from the energy formula? |
Hi @tommasoandina1 ! I didn't get the question. What do you mean for mean error and heat from the Lagrangian? For getting the mass matrix for a manipulator you should implement what @traversaro suggested you in #77 (comment). Something like # P is the "selector matrix" in https://github.com/ami-iit/adam/issues/77#issuecomment-2100398149
P = cs.horzcat(cs.SX.zeros(6,6), cs.SX.eye(6))
H = cs.SX.eye(4)
s = cs.SX.sym(6)
M_fixed_base = P.T @ M(H,s) @ P
# if you want to wrap in a cs.Function
M_fixed_base_fun = cs.Function("m_fun", [s], [M_fixed_base])
# and call it
s_num = np.random.randn(6) # if you want numerical values, otherwise use s = cs.SX.sym
m = M_Fixed_base_fun(s_num) and to similar for the Coriolis and gravity term. I do not know if this answers your question. Note that I wrote this piece of code without testing it. So there might be errors |
I would like to compute the accelerations of the robot, starting from joint angles, velocities, and torques. To do this, I shouldn't |
Yup you can do it! Just pass numerical values to the functions ;) |
I managed to convert my values to numeric values but I don't understand why I don't convert to the desired location |
Hi @tommasoandina1, I didn't exactly get the problem. Can you elaborate more? |
Hi @Giulero, I want to control my robot with a PD control law tau, but I don’t understand why it doesn’t work. It does not go to the desired position when I calculate the real position using its dynamics |
Hi @tommasoandina1, sorry for the late reply. I did not get exactly. Can you elaborate more? |
I guess this can be closed! |
I tried an example from the library, but I didn't understand why the mass matrix has dimensions of 12x12. I'm confused about the significance of rows 7 through 12
The same thing happened with the bias force, as it also has dimensions of 12x1
The text was updated successfully, but these errors were encountered: