SimpleHexapod

class lsst.ts.mthexapod.SimpleHexapod(base_positions: list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]], mirror_positions: list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]], pivot: tuple[float, float, float], min_length: float, max_length: float, speed: float)

Bases: object

Simple model of a hexapod: 6 linear actuators in an arbitrary arrangement.

The intent is to support the mock hexapod controller; as such this model is somewhat simplistic. The actuators ends are assumed to be perfect point flexures. It is not (yet) possible to compute orientation given actuator lengths.

See make_zigzag_model to make a standard symmetrical zigzag hexapod.

Parameters:
base_positionslist [numpy.ndarray]

Position of the base end of each linear actuator, as a list of z,y,z tuples, one per actuator.

mirror_positionslist [numpy.ndarray]

Position of the mirror end of each actuator at zero orientation, as a list of z,y,z tuples, one per actuator.

pivottuple

The point whose orientation is set by the move command. For a mirror it will typically be the vertex of the mirror.

min_lengthfloat

Mininum actuator length.

max_lengthfloat

Maximum actuator length.

speedfloat

Actuator speed.

Methods Summary

assert_in_range(actuator_lengths)

Assert that all actuators would be in range if set to the specified length.

compute_actuator_lengths(mirror_positions, ...)

Compute actuator lengths, given mirror positions.

compute_mirror_positions(pos, xyzrot)

Compute the actuator mirror positions needed to move the pivot point to a specified orientation.

make_zigzag_model(base_radius, ...)

Make a SimpleHexapod of a typical hexapod with 6 actuators in a symmetrical zigzag arrangement.

move(pos, xyzrot)

Move the actuators so the pivot point is at the specified orientation.

moving([tai])

Is any actuator moving?

remaining_time([tai])

Remaining time for this move (sec).

stop()

Stop all actuators.

Methods Documentation

assert_in_range(actuator_lengths: ndarray[Any, dtype[float64]]) None

Assert that all actuators would be in range if set to the specified length.

compute_actuator_lengths(mirror_positions: list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]], absolute: bool) ndarray[Any, dtype[float64]]

Compute actuator lengths, given mirror positions.

Parameters:
mirror_positionslist [numpy.ndarray]

Position of the mirror end of each actuator.

absolutebool

If True then return end to end actuator lengths. If False then return lengths relative to neutral lengths; this requires self.neutral_actuator_lengths.

Returns:
lengthsnumpy.ndarray

End to end length of each actuator.

compute_mirror_positions(pos: tuple[float, float, float], xyzrot: tuple[float, float, float]) list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]

Compute the actuator mirror positions needed to move the pivot point to a specified orientation.

Parameters:
postuple

Desired x, y, z position of pivot point, relative to the neutral pivot point.

xyzrottuple

Orientation of translated pivot point, as a rotation about x, then y, then z (deg).

Returns:
mirror_positionslist [numpy.ndarray]

Resulting position of the mirror end of each actuator.

classmethod make_zigzag_model(base_radius: float, mirror_radius: float, mirror_z: float, base_angle0: float, pivot: tuple[float, float, float], min_length: float, max_length: float, speed: float) Self

Make a SimpleHexapod of a typical hexapod with 6 actuators in a symmetrical zigzag arrangement.

The base ends of the 6 actuators terminate at 3 points at z=0 evenly distributed about a circle of radius base_radius: actuators 0 and 5 terminate at base_angle0, actuators 1 and 2 terminate at base_angle0 + 120, and actuators 3 and 4 terminate at base_angle0 + 240. The mirror ends of the actuators are similarly arrayed, in a plane at z=mirror_z with attachment points rotated 60 degrees from the base attachment points: actuators 0 and 1 terminate at base_angle0 + 60, etc. This makes a zigzag pattern that is circularly symmetric about the z axis.

base_radiusfloat

Radius of base positions of actuators.

mirror_radiusfloat

Radius of mirror positions of actuators.

mirror_zfloat

z distance between the base ends and the mirror ends of the linear actuators.

base_angle0float

Angle of first base actuator point in x,y plane (deg).

pivottuple

The point whose orientation is set by the move command. For a mirror it will typically be the vertex of the mirror.

min_lengthfloat

Mininum actuator length.

max_lengthfloat

Maximum actuator length.

speedfloat

Actuator speed.

move(pos: tuple[float, float, float], xyzrot: tuple[float, float, float]) float

Move the actuators so the pivot point is at the specified orientation.

Parameters:
postuple

x, y, z position of pivot point.

xyzrottuple

Orientation of translated pivot point, as a rotation about x, then y, then z (deg).

Returns:
durationfloat

Duration of the move (second).

moving(tai: float | None = None) bool

Is any actuator moving?

remaining_time(tai: float | None = None) float

Remaining time for this move (sec).

stop() None

Stop all actuators.