_api-control:
Control API Referenceο
This page documents ManipulaPy.control, the module for manipulator control algorithms with GPU acceleration.
Tip
For conceptual explanations, see Control Module User Guide.
β
ManipulatorController Classο
- class ManipulaPy.control.ManipulatorController(dynamics)[source]ο
Bases:
objectMain class for control of robotic manipulators using CuPy-accelerated algorithms.
Constructor
- Parameters:
dynamics (Any) β
- __init__(dynamics)[source]ο
Initialize the ManipulatorController with the dynamics of the manipulator.
Note: Control algorithms now use CPU (NumPy) to avoid GPU-CPU transfer overhead, since the dynamics module operates on NumPy arrays.
- Parameters:
dynamics (ManipulatorDynamics) β An instance of ManipulatorDynamics.
- Return type:
None
Parameters:
dynamics (ManipulatorDynamics) β Instance providing dynamics computations
- computed_torque_control(thetalistd, dthetalistd, ddthetalistd, thetalist, dthetalist, g, dt, Kp, Ki, Kd)[source]ο
Computed Torque Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead. The dynamics module operates on NumPy arrays, so keeping everything on CPU is more efficient than repeated GPUβCPU transfers.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
ddthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
dt (float) β Time step.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Ki (ndarray[Any, dtype[float64]] | List[float]) β Integral gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Torque command (CPU-based NumPy array).
- Return type:
NDArray
- pd_control(desired_position, desired_velocity, current_position, current_velocity, Kp, Kd)[source]ο
PD Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
current_position (ndarray[Any, dtype[float64]] | List[float]) β Current joint positions.
current_velocity (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
PD control signal (CPU-based NumPy array).
- Return type:
NDArray
- pid_control(thetalistd, dthetalistd, thetalist, dthetalist, dt, Kp, Ki, Kd)[source]ο
PID Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
dt (float) β Time step.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Ki (ndarray[Any, dtype[float64]] | List[float]) β Integral gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
PID control signal (CPU-based NumPy array).
- Return type:
NDArray
- robust_control(thetalist, dthetalist, ddthetalist, g, Ftip, disturbance_estimate, adaptation_gain)[source]ο
Robust Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
ddthetalist (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
disturbance_estimate (ndarray[Any, dtype[float64]] | List[float]) β Estimate of disturbances.
adaptation_gain (float) β Gain for the adaptation term.
- Returns:
Robust control torque (CPU-based NumPy array).
- Return type:
NDArray
- adaptive_control(thetalist, dthetalist, ddthetalist, g, Ftip, measurement_error, adaptation_gain)[source]ο
Adaptive Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
ddthetalist (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
measurement_error (ndarray[Any, dtype[float64]] | List[float]) β Error in measurement.
adaptation_gain (float) β Gain for the adaptation term.
- Returns:
Adaptive control torque (CPU-based NumPy array).
- Return type:
NDArray
- kalman_filter_predict(thetalist, dthetalist, taulist, g, Ftip, dt, Q)[source]ο
Kalman Filter Prediction.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
taulist (ndarray[Any, dtype[float64]] | List[float]) β Applied torques.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
dt (float) β Time step.
Q (ndarray[Any, dtype[float64]]) β Process noise covariance.
- Returns:
None
- Return type:
None
- kalman_filter_update(z, R)[source]ο
Kalman Filter Update.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- kalman_filter_control(thetalistd, dthetalistd, thetalist, dthetalist, taulist, g, Ftip, dt, Q, R)[source]ο
Kalman Filter Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
taulist (ndarray[Any, dtype[float64]] | List[float]) β Applied torques.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
dt (float) β Time step.
Q (ndarray[Any, dtype[float64]]) β Process noise covariance.
R (ndarray[Any, dtype[float64]]) β Measurement noise covariance.
- Returns:
Estimated joint angles and velocities (CPU-based NumPy arrays).
- Return type:
- feedforward_control(desired_position, desired_velocity, desired_acceleration, g, Ftip)[source]ο
Feedforward Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
desired_acceleration (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
- Returns:
Feedforward torque (CPU-based NumPy array).
- Return type:
NDArray
- pd_feedforward_control(desired_position, desired_velocity, desired_acceleration, current_position, current_velocity, Kp, Kd, g, Ftip)[source]ο
PD Feedforward Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
desired_acceleration (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
current_position (ndarray[Any, dtype[float64]] | List[float]) β Current joint positions.
current_velocity (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
- Returns:
Control signal (CPU-based NumPy array).
- Return type:
NDArray
- static enforce_limits(thetalist, dthetalist, tau, joint_limits, torque_limits)[source]ο
Enforce joint and torque limits.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Joint velocities.
tau (ndarray[Any, dtype[float64]] | List[float]) β Torques.
joint_limits (<MagicMock id='130821614925088'> | ndarray[Any, dtype[float64]] | List[Tuple[float, float]]) β Joint angle limits.
torque_limits (<MagicMock id='130821614358976'> | ndarray[Any, dtype[float64]] | List[Tuple[float, float]]) β Torque limits.
- Returns:
Clipped joint angles, velocities, and torques (CPU-based NumPy arrays).
- Return type:
- plot_steady_state_response(time, response, set_point, title='Steady State Response')[source]ο
Plot the steady-state response of the controller.
- calculate_settling_time(time, response, set_point, tolerance=0.02)[source]ο
Calculate the settling time.
- joint_space_control(desired_joint_angles, current_joint_angles, current_joint_velocities, Kp, Kd)[source]ο
Joint Space Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
current_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
current_joint_velocities (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Control torque (CPU-based NumPy array).
- Return type:
NDArray
- cartesian_space_control(desired_position, current_joint_angles, current_joint_velocities, Kp, Kd)[source]ο
Cartesian Space Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired end-effector position.
current_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
current_joint_velocities (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Control torque (CPU-based NumPy array).
- Return type:
NDArray
- tune_controller(Ku, Tu, kind='PID')[source]ο
Convenience wrapper that logs and returns NumPy arrays (length = DOF).
- find_ultimate_gain_and_period(thetalist, desired_joint_angles, dt, max_steps=1000)[source]ο
Find the ultimate gain and period using the ZieglerβNichols method.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
- Returns:
ultimate_gain (float)
ultimate_period (float)
gain_history (list of float)
error_history (list of np.ndarray)
- Return type:
β
Control Strategiesο
Basic Controllersο
- ManipulatorController.pid_control(thetalistd, dthetalistd, thetalist, dthetalist, dt, Kp, Ki, Kd)[source]ο
PID Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
dt (float) β Time step.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Ki (ndarray[Any, dtype[float64]] | List[float]) β Integral gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
PID control signal (CPU-based NumPy array).
- Return type:
NDArray
- ManipulatorController.pd_control(desired_position, desired_velocity, current_position, current_velocity, Kp, Kd)[source]ο
PD Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
current_position (ndarray[Any, dtype[float64]] | List[float]) β Current joint positions.
current_velocity (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
PD control signal (CPU-based NumPy array).
- Return type:
NDArray
Advanced Controllersο
- ManipulatorController.computed_torque_control(thetalistd, dthetalistd, ddthetalistd, thetalist, dthetalist, g, dt, Kp, Ki, Kd)[source]ο
Computed Torque Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead. The dynamics module operates on NumPy arrays, so keeping everything on CPU is more efficient than repeated GPUβCPU transfers.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
ddthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
dt (float) β Time step.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Ki (ndarray[Any, dtype[float64]] | List[float]) β Integral gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Torque command (CPU-based NumPy array).
- Return type:
NDArray
- ManipulatorController.adaptive_control(thetalist, dthetalist, ddthetalist, g, Ftip, measurement_error, adaptation_gain)[source]ο
Adaptive Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
ddthetalist (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
measurement_error (ndarray[Any, dtype[float64]] | List[float]) β Error in measurement.
adaptation_gain (float) β Gain for the adaptation term.
- Returns:
Adaptive control torque (CPU-based NumPy array).
- Return type:
NDArray
- ManipulatorController.robust_control(thetalist, dthetalist, ddthetalist, g, Ftip, disturbance_estimate, adaptation_gain)[source]ο
Robust Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
ddthetalist (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
disturbance_estimate (ndarray[Any, dtype[float64]] | List[float]) β Estimate of disturbances.
adaptation_gain (float) β Gain for the adaptation term.
- Returns:
Robust control torque (CPU-based NumPy array).
- Return type:
NDArray
Feedforward Controlο
- ManipulatorController.feedforward_control(desired_position, desired_velocity, desired_acceleration, g, Ftip)[source]ο
Feedforward Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
desired_acceleration (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
- Returns:
Feedforward torque (CPU-based NumPy array).
- Return type:
NDArray
- ManipulatorController.pd_feedforward_control(desired_position, desired_velocity, desired_acceleration, current_position, current_velocity, Kp, Kd, g, Ftip)[source]ο
PD Feedforward Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired joint positions.
desired_velocity (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
desired_acceleration (ndarray[Any, dtype[float64]] | List[float]) β Desired joint accelerations.
current_position (ndarray[Any, dtype[float64]] | List[float]) β Current joint positions.
current_velocity (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
- Returns:
Control signal (CPU-based NumPy array).
- Return type:
NDArray
Space-Specific Controlο
- ManipulatorController.joint_space_control(desired_joint_angles, current_joint_angles, current_joint_velocities, Kp, Kd)[source]ο
Joint Space Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
current_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
current_joint_velocities (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Control torque (CPU-based NumPy array).
- Return type:
NDArray
- ManipulatorController.cartesian_space_control(desired_position, current_joint_angles, current_joint_velocities, Kp, Kd)[source]ο
Cartesian Space Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
desired_position (ndarray[Any, dtype[float64]] | List[float]) β Desired end-effector position.
current_joint_angles (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
current_joint_velocities (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
Kp (ndarray[Any, dtype[float64]] | List[float]) β Proportional gain.
Kd (ndarray[Any, dtype[float64]] | List[float]) β Derivative gain.
- Returns:
Control torque (CPU-based NumPy array).
- Return type:
NDArray
β
State Estimationο
- ManipulatorController.kalman_filter_predict(thetalist, dthetalist, taulist, g, Ftip, dt, Q)[source]ο
Kalman Filter Prediction.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
taulist (ndarray[Any, dtype[float64]] | List[float]) β Applied torques.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
dt (float) β Time step.
Q (ndarray[Any, dtype[float64]]) β Process noise covariance.
- Returns:
None
- Return type:
None
- ManipulatorController.kalman_filter_update(z, R)[source]ο
Kalman Filter Update.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- ManipulatorController.kalman_filter_control(thetalistd, dthetalistd, thetalist, dthetalist, taulist, g, Ftip, dt, Q, R)[source]ο
Kalman Filter Control.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint angles.
dthetalistd (ndarray[Any, dtype[float64]] | List[float]) β Desired joint velocities.
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Current joint velocities.
taulist (ndarray[Any, dtype[float64]] | List[float]) β Applied torques.
g (ndarray[Any, dtype[float64]] | List[float]) β Gravity vector.
Ftip (ndarray[Any, dtype[float64]] | List[float]) β External forces applied at the end effector.
dt (float) β Time step.
Q (ndarray[Any, dtype[float64]]) β Process noise covariance.
R (ndarray[Any, dtype[float64]]) β Measurement noise covariance.
- Returns:
Estimated joint angles and velocities (CPU-based NumPy arrays).
- Return type:
β
Performance Analysis Toolsο
- ManipulatorController.plot_steady_state_response(time, response, set_point, title='Steady State Response')[source]ο
Plot the steady-state response of the controller.
- ManipulatorController.calculate_rise_time(time, response, set_point)[source]ο
Calculate the rise time.
- ManipulatorController.calculate_percent_overshoot(response, set_point)[source]ο
Calculate the percent overshoot.
- ManipulatorController.calculate_settling_time(time, response, set_point, tolerance=0.02)[source]ο
Calculate the settling time.
- ManipulatorController.calculate_steady_state_error(response, set_point)[source]ο
Calculate the steady-state error.
β
Auto-Tuning and Limitsο
- ManipulatorController.tune_controller(Ku, Tu, kind='PID')[source]ο
Convenience wrapper that logs and returns NumPy arrays (length = DOF).
- ManipulatorController.find_ultimate_gain_and_period(thetalist, desired_joint_angles, dt, max_steps=1000)[source]ο
Find the ultimate gain and period using the ZieglerβNichols method.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
- Returns:
ultimate_gain (float)
ultimate_period (float)
gain_history (list of float)
error_history (list of np.ndarray)
- Return type:
- static ManipulatorController.enforce_limits(thetalist, dthetalist, tau, joint_limits, torque_limits)[source]ο
Enforce joint and torque limits.
Uses CPU-based computation to avoid GPU-CPU transfer overhead.
- Parameters:
thetalist (ndarray[Any, dtype[float64]] | List[float]) β Joint angles.
dthetalist (ndarray[Any, dtype[float64]] | List[float]) β Joint velocities.
tau (ndarray[Any, dtype[float64]] | List[float]) β Torques.
joint_limits (<MagicMock id='130821614925088'> | ndarray[Any, dtype[float64]] | List[Tuple[float, float]]) β Joint angle limits.
torque_limits (<MagicMock id='130821614358976'> | ndarray[Any, dtype[float64]] | List[Tuple[float, float]]) β Torque limits.
- Returns:
Clipped joint angles, velocities, and torques (CPU-based NumPy arrays).
- Return type:
β
See Alsoο
Dynamics API Reference β Robot dynamics for model-based control
Kinematics API Reference β Kinematic models for Cartesian control
Path Planning API Reference β Trajectory reference generation
Simulation API Reference β Simulator integration and testing tools