segment Module

Segment objects are used by the human module. A segment has a position, and an orientation. All constituent solids of a segment have the same orientation. That is to say that the base of the segment is at a joint in the human. The user does not interact with this module.

class yeadon.segment.Segment(label, pos, rot_mat, solids, color, build_toward_positive_z=True)[source]

Bases: object

calc_properties(self)[source]

Calculates the segment’s center of mass with respect to the bottm center of the pelvis (Ls0) and the segment’s inertia in the global frame but about the segment’s center of mass.

calc_rel_properties(self)[source]

Calculates the mass, relative/local center of mass, and relative/local inertia tensor (about the segment’s center of mass). Also computes the center of mass of each constituent solid with respect to the segment’s base in the segment’s reference frame.

center_of_mass

Center of mass of the segment, a np.ndarray, in units of m, expressed in the global frame, from the bottom center of the pelvis (Ls0).

draw_mayavi(self, mlabobj)[source]

Draws in a MayaVi window all the solids within this segment.

end_pos

Position of the center of the last (farthest from pelvis) stadium in this segment, a np.ndarray, in units of m, expressed in the global frame, from the bottom center of the pelvis (Ls0).

inertia

Inertia matrix of the segment, a np.matrix, in units of kg-m^2, about the center of mass of the human, expressed in the global frame.

mass

Mass of the segment, in units of kg.

pos

Position of the origin of the segment, a np.ndarray, in units of m, expressed in the global frame, from the bottom center of the pelvis (Ls0).

print_properties(self, precision=5, suppress=True)[source]

Prints mass, center of mass (in segment and global frames), and inertia (in solid and global frames).

Parameters:
precision : integer, default=5

The precision for floating point representation.

suppress : boolean, default=True

Print very small values as 0 instead of scientific notation.

Notes

See numpy.set_printoptions for more details on the optional arguments.

print_solid_properties(self, precision=5, suppress=True)[source]

Calls the print_properties() member method of each of this segment’s solids. See the solid class’s definition of print_properties(self) for more detail.

Parameters:
precision : integer, default=5

The precision for floating point representation.

suppress : boolean, default=True

Print very small values as 0 instead of scientific notation.

Notes

See numpy.set_printoptions for more details on the optional arguments.

rel_center_of_mass

Center of mass of the segment, a np.ndarray, in units of m, expressed in the frame of the segment, from the origin of the segment.

rel_inertia

Inertia matrix/dyadic of the segment, a np.matrix, in units of kg-m^2, about the center of mass of the segment, expressed in the frame of the segment.

rot_mat

Rotation matrix specifying the orientation of this segment relative to the orientation of the global frame, a np.matrix, unitless. Multiplying a vector expressed in this segment’s frame with this rotation matrix on the left gives that same vector, but expressed in the global frame.