Body

This abstract class represents an abstract body.

class Body

Bases: handle

Abstract class modeling a generic body of a BodyTree.

Property Summary
Parameters

Vector of parameters for the body.

n

Number of DoF of the body.

Method Summary
D(q, dq)

Evaluate the generalized damping force.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

I(q)

Evaluate the body inertia matrix in the body distal end frame.

Parameters:

q ([double], [sym]) – Configuration variables

J(q, dq)

Evaluate the firs-order time derivative of the body inertia matrix in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

K(q)

Evaluate the generalized elastic force.

Parameters:

q ([double], [sym]) – Configuration variables

T(q)

Evaluate the relative transformation matrix from the body distal end frame to the body proximal end frame.

Parameters:

q ([double], [sym]) – Configuration variables

Update(q, dq, ddq, options)

Update the current state of the body.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

a_com_rel(q, dq, ddq)

Evaluate the second-order time derivative of the center of mass position in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

a_rel(q, dq, ddq)

Evaluate the relative linear acceleration of the body distal end frame in the body proximal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

domega_rel(q, dq, ddq)

Evaluate the relative angular acceleration of the body distal end frame in the body proximal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

grad_J(q)

Evaluate \frac{\partial \dot{J}}{\partial \dot{q}}, where J is the first-order time derivative of the body inertia.

Parameters:

q ([double], [sym]) – Configuration variables

grad_int_r_X_dr(q)

Evaluate \frac{\partial}{\partial q}\left(\int_{V} r \times \ddot{r} \,\, \mathrm{d}V\right)^{T}, where r is the relative position vector of the body particle in the body distal end frame.

Parameters:

q ([double], [sym]) – Configuration variables

grad_v_com(q)

Evaluate \frac{\partial p_{\mathrm{CoM}}}{\partial q}, where p_{\mathrm{CoM}} is the position of the center of mass in the body distal end frame.

Parameters:

q ([double], [sym]) – Configuration variables

int_dr_X_pv_r(q, dq)

Evaluate \int_{V} \left(\tilde{\dot{r}} \frac{\partial r}{\partial q}\right)^{T} \,\, \mathrm{d}V, where r is the relative position vector of the body particle in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

int_pv_r_O_dd_r(q, dq, ddq)

Evaluate \int_{V} \left(\frac{\partial r}{\partial q}\right)^{T} \ddot{r} \,\, \mathrm{d}V, where r is the relative position vector of the body particle in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

int_r_X_ddr(q, dq, ddq)

Evaluate \int_{V} r \times \ddot{r} \,\, \mathrm{d}V, where r is the relative position vector of the body particle in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

  • ddq ([double], [sym]) – Second-order time derivative of the configuration variables

int_r_X_dr(q, dq)

Evaluate \int_{V} r \times \dot{r} \,\, \mathrm{d}V, where r is the relative position vector of the body particle in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

m()

Evaluate the body mass.

omega_par(q)

Evaluate the Jacobian of the relative angular velocity of the body distal end frame in its frame.

Parameters:

q ([double], [sym]) – Configuration variables

omega_rel(q, dq)

Evaluate the relative angular velocity of the body distal end frame in the body proximal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

p_com(q)

Evaluate the center of mass position in the body distal end frame.

Parameters:

q ([double], [sym]) – Configuration variables

toStruct()

Convert the body object to a struct representation.

v_com_rel(q, dq)

Evaluate the first-order time derivative of the center of mass position in the body distal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables

v_par(q)

Evaluate the Jacobian of the relative linear velocity of the body distal end frame in its frame.

Parameters:

q ([double], [sym]) – Configuration variables

v_rel(q, dq)

Evaluate the relative linear velocity of the body distal end frame in the body proximal end frame.

Parameters:
  • q ([double], [sym]) – Configuration variables

  • dq ([double], [sym]) – First-order time derivative of the configuration variables