artist.field.actuators_linear ============================= .. py:module:: artist.field.actuators_linear Classes ------- .. autoapisummary:: artist.field.actuators_linear.LinearActuators Module Contents --------------- .. py:class:: LinearActuators(non_optimizable_parameters: torch.Tensor, optimizable_parameters: torch.Tensor = torch.tensor([], requires_grad=True), device: torch.device | None = None) Bases: :py:obj:`artist.field.actuators.Actuators` Initialize linear actuators. A linear actuator describes movement within a 2D plane. One linear actuator has seven non optimizable parameters, that describe the geometry. Ordered by index, the first parameter describes the type of the actuator, i.e., linear, the second parameter describes the turning direction of the actuator. The third and fourth parameters are the minimum and maximum motor positions. The next five parameters are the increment, which stores the information about the stroke length change per motor step, an offset that describes the difference between the linear actuator's pivoting point and the point around which the actuator is allowed to pivot, and the actuator's pivot radius. A linear actuator also has two optimizable parameters, namely the initial angle which indicates the angle that the actuator introduces to the manipulated coordinate system at the initial stroke length, which is the second parameter. Parameters ---------- non_optimizable_parameters : torch.Tensor The seven non-optimizable actuator parameters, describing actuator geometry. Tensor of shape [number_of_heliostats, 7, 2]. optimizable_parameters : torch.Tensor The two optimizable actuator parameters, describing the initial actuator configuration. Tensor of shape [number_of_heliostats, 2, 2]. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. .. py:attribute:: epsilon :value: 1e-06 .. py:method:: _physics_informed_parameters(device: torch.device | None = None) -> tuple[torch.Tensor, torch.Tensor] Limit actuator parameters to their physically valid ranges. The four parameters: types, turning directions, min and max increments are not optimizable and do not need to be physics informed. The parameters increment, initial stroke lengths, offsets and pivot radii are defined to be strictly positive. Parameters ---------- device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor The physics-informed optimizable parameters. Tensor of shape [number_of_active_heliostats, 7, 2]. torch.Tensor The physics-informed non-optimizable parameters. Tensor of shape [number_of_active_heliostats, 2, 2]. .. py:method:: _motor_positions_to_absolute_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Convert motor steps into angles using actuator geometries. Calculate absolute angles based solely on the motors' current positions and the geometries of the actuators. This gives the angles of the actuators in a global sense. It does not consider the starting positions of the motors. Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor The calculated absolute angles. Tensor of shape [number_of_active_heliostats, 2]. .. py:method:: motor_positions_to_angles(motor_positions: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the joint angles for given motor positions. The absolute angles are adjusted to be relative to the initial angles. This accounts for the initial angles and the motors' directions (clockwise or counterclockwise). Parameters ---------- motor_positions : torch.Tensor The motor positions. Tensor of shape [number_of_active_heliostats, 2]. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor The joint angles corresponding to the motor positions. Tensor of shape [number_of_active_heliostats, 2]. .. py:method:: angles_to_motor_positions(angles: torch.Tensor, device: torch.device | None = None) -> torch.Tensor Calculate the motor positions for given joint angles. First the relative angular changes are calculated based on the given angles. Then the corresponding stroke lengths are determined using trigonometric relationships. These stroke lengths are converted into motor steps. Parameters ---------- angles : torch.Tensor The joint angles. Tensor of shape [number_of_active_heliostats, 2]. device : torch.device | None The device on which to perform computations or load tensors and models (default is None). If None, ``ARTIST`` will automatically select the most appropriate device (CUDA or CPU) based on availability and OS. Returns ------- torch.Tensor The motor steps. Tensor of shape [number_of_active_heliostats, 2].