RTSX Help: gravity load


Compute gravity load in robot dynamics


  • Tg = gravload(robot, q, grav)

Input Arguments

  • robot — n-link robot data structure created with SerialLink( )
  • q — 1 x n joint position
  • grav* — gravity acceleration vector

* Optional inputs

Output Arguments

  • Tg — 1 x n joint torque from gravity loading


Tg = gravload(robot, q, grav) is the joint gravity loading for the robot in the joint configuration q. If gravity acceleration vector argument is omitted, the function uses the value given in robot data structure.


 ans  =
    0.    31.63988    6.035138    0.    0.0282528    0.

The following code plots the figures below (Corke, p 194). You may have to wait quite a while!

stepsize = 0.1;
[Q2,Q3] = meshgrid(-pi:stepsize:pi, -pi:stepsize:pi);
nloops = numcols(Q2)*numcols(Q3);
g2 = _zeros(size(Q2));
g3 = _zeros(size(Q3));
 for i=1:numcols(Q2),
     for j=1:numcols(Q3),
        g = gravload(p560,[0 Q2(i,j) Q3(i,j) 0 0 0]);
         g2(i,j) = g(2);
        g3(i,j) = g(3);
 figure; surf(Q2, Q3, g2); 
 figure; surf(Q2, Q3, g3);

Gravity load variation with manipulator pose

(a) Shoulder gravity load g2(q2, q3)

(b) Elbow gravity load g3(q2, q3)

See also