basic_robotics.general.faser_screw module

Model a Screw.

class basic_robotics.general.faser_screw.Screw(data: ndarray[float] = array([[0.], [0.], [0.], [0.], [0.], [0.]]), frame_applied: tm = None)[source]

Bases: object

Model a Screw.

Emulates a Screw based on content in Modern Robotics Chapter 3.

Returns:

Screw – Screw object inheriting np ndarray functionality

__init__(data: ndarray[float] = array([[0.], [0.], [0.], [0.], [0.], [0.]]), frame_applied: tm = None)[source]

Create a new Screw.

Emulates a Screw based on content in Modern Robotics Chapter 3.

Parameters:
  • data (np.ndarray[Float]) – data representing a screw, of shape ((6,1))

  • frame_applied (tm, optional) – If not specified, assumes origin.

copy() → Screw[source]

Get a copy of this Screw.

Returns:

Copy (Screw) – Screw copy

flatten() → ndarray[float][source]

Get a flattened representation of the screw.

Returns:

flat_screw (np.ndarray[float]) – flattened screw.

changeFrame(new_frame: tm, old_frame: tm = None) → Screw[source]

Change a screw from one frame to another.

MR3.85 Sb = [Ad(T(b->a))](Sa)

Parameters:
  • new_frame (tm) – New base frame of reference.

  • old_frame (tm, optional) – Old base frame of reference.

Returns:

screw – reference to self, for compatibility and code-golfing reasons.

getData() → ndarray[float][source]

Get the data of this Screw for raw computation.

Returns:

data (np.ndarray[float]) – raw data of the Screw

getPitch() → float[source]

Get the pitch of a Screw.

Equal to magnitude of angular component / magnitude of linear component

Returns:

pitch (float) – Screw pitch.

cross(other_screw: Screw) → Screw[source]

Return cross product of this screw and another screw.

Returns (Screw): New crossed screw

dot(other_screw: Screw) → Screw[source]

Return dot product of this screw and another screw.

Returns (Screw): New crossed screw

dualScalarMultiply(dual_scalar: list) → Screw[source]

Perform multiplication of screw by a dual scalar.

Returns (Screw) : New scaled screw

reshape(new_shape) → ndarray[float][source]

Reshape the data field for legacy code support.

Parameters:

new_shape ((int, int)) – New shape

Returns:

np.ndarray[float] – Data reshaped according to user.