MockMTRotatorController#
- class lsst.ts.mtrotator.MockMTRotatorController(log, port=0, initial_state=ControllerState.STANDBY)#
Bases:
BaseMockControllerMock MT rotator controller that talks over TCP/IP.
- Parameters:
log (
logging.Logger) – Logger.port (
int(optional)) – Port for telemetry and configuration; if nonzero then the command port will be one larger. Specify 0 to choose random values for both ports; this is recommended for unit tests, to avoid collision with other tests. Do not specify 0 with host=None (see Raises section).initial_state (
ControllerState(optional)) – Initial state of mock controller.
- Raises:
ValueError – If host=None and port=0. See
CommandTelemetryServerfor details.
Notes
To start the mock controller:
ctrl = MockRotatorController(…) await ctrl.connect_task
To stop the server:
await ctrl.stop()
Known Limitations
Constant-velocity motion is not supported.
The odometer resets to zero each time the mock controller is constructed.
The motor current and torque are scaled versions of current acceleration, with a wild guess as to scale.
Motor current and torque exactly match for motors A and B.
Many telemetry fields are not set at all.
Attributes Summary
Methods Summary
close()Kill command and telemetry tasks and close the connections.
do_clearError(data)do_config_accel(command)do_config_accel_emergency(command)do_config_jerk(command)do_config_jerk_emergency(command)do_config_vel(command)do_constant_velocity(command)do_fault(command)do_move_point_to_point(command)do_position_set(command)do_set_constant_vel(command)do_stop(command)do_track(command)do_track_vel_cmd(command)end_run_command(command, cmd_method)Called when run_command is done.
set_state(state)Set the current state and substates.
If this times out then go into a FAULT state.
update_telemetry(curr_tai)Update self.client.telemetry.
Attributes Documentation
- current_per_acceleration = 5#
- torque_per_acceleration = 0.002#
Methods Documentation
- async close()#
Kill command and telemetry tasks and close the connections.
Always safe to call.
- Return type:
- async end_run_command(command, cmd_method)#
Called when run_command is done.
Can be used to clear the set position.
- set_state(state)#
Set the current state and substates.
- Parameters:
state (
lsst.ts.xml.enums.MTHexapod.ControllerStateorint) – New state.- Return type:
Notes
Sets the substates as follows:
lsst.ts.xml.enums.MTHexapod.EnabledSubstate.STATIONARYif state ==lsst.ts.xml.enums.MTHexapod.ControllerState.ENABLED
- async tracking_timer()#
If this times out then go into a FAULT state.
Used to make sure TRACK commands arrive often enough.
- Return type: