zaber-motion 7.13.0__py3-none-win32.whl → 7.15.0__py3-none-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zaber_motion/__init__.py +103 -103
- zaber_motion/ascii/__init__.py +73 -73
- zaber_motion/ascii/all_axes.py +352 -352
- zaber_motion/ascii/axis.py +1673 -1673
- zaber_motion/ascii/axis_group.py +391 -391
- zaber_motion/ascii/axis_settings.py +752 -752
- zaber_motion/ascii/connection.py +1174 -1174
- zaber_motion/ascii/device.py +908 -908
- zaber_motion/ascii/device_io.py +1170 -1170
- zaber_motion/ascii/device_settings.py +735 -735
- zaber_motion/ascii/lockstep.py +1184 -1184
- zaber_motion/ascii/oscilloscope.py +635 -635
- zaber_motion/ascii/oscilloscope_data.py +240 -240
- zaber_motion/ascii/pvt.py +105 -105
- zaber_motion/ascii/pvt_buffer.py +146 -146
- zaber_motion/ascii/pvt_io.py +630 -630
- zaber_motion/ascii/pvt_sequence.py +1530 -1530
- zaber_motion/ascii/servo_tuner.py +637 -637
- zaber_motion/ascii/setting_constants.py +1755 -1755
- zaber_motion/ascii/storage.py +905 -905
- zaber_motion/ascii/stream.py +2182 -2182
- zaber_motion/ascii/stream_buffer.py +101 -101
- zaber_motion/ascii/stream_io.py +700 -700
- zaber_motion/ascii/streams.py +105 -105
- zaber_motion/ascii/transport.py +202 -202
- zaber_motion/ascii/trigger.py +886 -886
- zaber_motion/ascii/triggers.py +241 -241
- zaber_motion/ascii/warning_flags.py +178 -178
- zaber_motion/ascii/warnings.py +152 -152
- zaber_motion/async_utils.py +46 -46
- zaber_motion/binary/__init__.py +14 -14
- zaber_motion/binary/connection.py +648 -648
- zaber_motion/binary/device.py +924 -924
- zaber_motion/binary/device_settings.py +121 -121
- zaber_motion/bindings.py +50 -50
- zaber_motion/call.py +198 -198
- zaber_motion/convert_exception.py +138 -138
- zaber_motion/dto/__init__.py +11 -11
- zaber_motion/dto/ascii/__init__.py +46 -46
- zaber_motion/dto/ascii/alert_event.py +110 -110
- zaber_motion/dto/ascii/axis_identity.py +134 -134
- zaber_motion/dto/ascii/axis_type.py +14 -14
- zaber_motion/dto/ascii/can_set_state_axis_response.py +69 -69
- zaber_motion/dto/ascii/can_set_state_device_response.py +75 -75
- zaber_motion/dto/ascii/conversion_factor.py +81 -81
- zaber_motion/dto/ascii/device_identity.py +136 -136
- zaber_motion/dto/ascii/device_io_info.py +108 -108
- zaber_motion/dto/ascii/digital_output_action.py +13 -13
- zaber_motion/dto/ascii/get_axis_setting.py +64 -64
- zaber_motion/dto/ascii/get_axis_setting_result.py +81 -81
- zaber_motion/dto/ascii/get_setting.py +88 -88
- zaber_motion/dto/ascii/get_setting_result.py +87 -87
- zaber_motion/dto/ascii/io_port_label.py +84 -84
- zaber_motion/dto/ascii/io_port_type.py +14 -14
- zaber_motion/dto/ascii/lockstep_axes.py +108 -108
- zaber_motion/dto/ascii/measurement_sequence.py +73 -73
- zaber_motion/dto/ascii/message_type.py +14 -14
- zaber_motion/dto/ascii/optional_measurement_sequence.py +71 -71
- zaber_motion/dto/ascii/oscilloscope_capture_properties.py +116 -116
- zaber_motion/dto/ascii/oscilloscope_data_source.py +11 -11
- zaber_motion/dto/ascii/paramset_info.py +92 -92
- zaber_motion/dto/ascii/pid_tuning.py +125 -125
- zaber_motion/dto/ascii/pvt_axis_definition.py +70 -70
- zaber_motion/dto/ascii/pvt_axis_type.py +11 -11
- zaber_motion/dto/ascii/pvt_csv_data.py +75 -75
- zaber_motion/dto/ascii/pvt_mode.py +12 -12
- zaber_motion/dto/ascii/pvt_sequence_data.py +99 -99
- zaber_motion/dto/ascii/response.py +137 -137
- zaber_motion/dto/ascii/servo_tuning_param.py +66 -66
- zaber_motion/dto/ascii/servo_tuning_paramset.py +21 -21
- zaber_motion/dto/ascii/set_state_axis_response.py +75 -75
- zaber_motion/dto/ascii/set_state_device_response.py +80 -80
- zaber_motion/dto/ascii/simple_tuning.py +118 -118
- zaber_motion/dto/ascii/simple_tuning_param_definition.py +100 -100
- zaber_motion/dto/ascii/stream_axis_definition.py +70 -70
- zaber_motion/dto/ascii/stream_axis_type.py +11 -11
- zaber_motion/dto/ascii/stream_mode.py +13 -13
- zaber_motion/dto/ascii/trigger_action.py +12 -12
- zaber_motion/dto/ascii/trigger_condition.py +15 -15
- zaber_motion/dto/ascii/trigger_enabled_state.py +68 -68
- zaber_motion/dto/ascii/trigger_operation.py +12 -12
- zaber_motion/dto/ascii/trigger_state.py +114 -114
- zaber_motion/dto/ascii/unknown_response_event.py +137 -137
- zaber_motion/dto/axis_address.py +74 -74
- zaber_motion/dto/binary/__init__.py +11 -11
- zaber_motion/dto/binary/binary_settings.py +74 -74
- zaber_motion/dto/binary/command_code.py +106 -106
- zaber_motion/dto/binary/device_identity.py +156 -156
- zaber_motion/dto/binary/device_type.py +12 -12
- zaber_motion/dto/binary/error_code.py +101 -101
- zaber_motion/dto/binary/message.py +91 -91
- zaber_motion/dto/binary/reply_code.py +16 -16
- zaber_motion/dto/binary/reply_only_event.py +91 -91
- zaber_motion/dto/binary/unknown_response_event.py +91 -91
- zaber_motion/dto/channel_address.py +74 -74
- zaber_motion/dto/device_db_source.py +66 -66
- zaber_motion/dto/device_db_source_type.py +11 -11
- zaber_motion/dto/exceptions/__init__.py +24 -24
- zaber_motion/dto/exceptions/binary_command_failed_exception_data.py +57 -57
- zaber_motion/dto/exceptions/command_failed_exception_data.py +151 -151
- zaber_motion/dto/exceptions/command_too_long_exception_data.py +98 -98
- zaber_motion/dto/exceptions/device_address_conflict_exception_data.py +63 -63
- zaber_motion/dto/exceptions/device_db_failed_exception_data.py +74 -74
- zaber_motion/dto/exceptions/device_db_inner_error.py +85 -85
- zaber_motion/dto/exceptions/g_code_execution_exception_data.py +75 -75
- zaber_motion/dto/exceptions/g_code_syntax_exception_data.py +75 -75
- zaber_motion/dto/exceptions/invalid_packet_exception_data.py +63 -63
- zaber_motion/dto/exceptions/invalid_pvt_point.py +69 -69
- zaber_motion/dto/exceptions/invalid_response_exception_data.py +51 -51
- zaber_motion/dto/exceptions/movement_failed_exception_data.py +104 -104
- zaber_motion/dto/exceptions/movement_interrupted_exception_data.py +104 -104
- zaber_motion/dto/exceptions/operation_failed_exception_data.py +104 -104
- zaber_motion/dto/exceptions/pvt_execution_exception_data.py +86 -86
- zaber_motion/dto/exceptions/pvt_movement_failed_exception_data.py +69 -69
- zaber_motion/dto/exceptions/pvt_movement_interrupted_exception_data.py +69 -69
- zaber_motion/dto/exceptions/set_device_state_exception_data.py +176 -176
- zaber_motion/dto/exceptions/set_peripheral_state_exception_data.py +121 -121
- zaber_motion/dto/exceptions/stream_execution_exception_data.py +63 -63
- zaber_motion/dto/exceptions/stream_movement_failed_exception_data.py +69 -69
- zaber_motion/dto/exceptions/stream_movement_interrupted_exception_data.py +69 -69
- zaber_motion/dto/firmware_version.py +91 -91
- zaber_motion/dto/gcode/__init__.py +9 -9
- zaber_motion/dto/gcode/axis_definition.py +74 -74
- zaber_motion/dto/gcode/axis_mapping.py +69 -69
- zaber_motion/dto/gcode/axis_transformation.py +79 -79
- zaber_motion/dto/gcode/device_definition.py +99 -99
- zaber_motion/dto/gcode/translate_message.py +87 -87
- zaber_motion/dto/gcode/translate_result.py +79 -79
- zaber_motion/dto/gcode/translator_config.py +84 -84
- zaber_motion/dto/log_output_mode.py +13 -13
- zaber_motion/dto/measurement.py +67 -67
- zaber_motion/dto/microscopy/__init__.py +6 -6
- zaber_motion/dto/microscopy/autofocus_status.py +57 -57
- zaber_motion/dto/microscopy/microscope_config.py +159 -159
- zaber_motion/dto/microscopy/third_party_components.py +55 -55
- zaber_motion/dto/microscopy/wdi_autofocus_provider_status.py +57 -57
- zaber_motion/dto/named_parameter.py +64 -64
- zaber_motion/dto/product/__init__.py +5 -5
- zaber_motion/dto/product/process_controller_mode.py +13 -13
- zaber_motion/dto/product/process_controller_source.py +72 -72
- zaber_motion/dto/product/process_controller_source_sensor.py +11 -11
- zaber_motion/dto/requests/__init__.py +256 -254
- zaber_motion/dto/requests/alert_event_wrapper.py +82 -82
- zaber_motion/dto/requests/autofocus_focus_request.py +131 -131
- zaber_motion/dto/requests/autofocus_get_objective_params_request.py +121 -121
- zaber_motion/dto/requests/autofocus_get_objective_params_response.py +56 -56
- zaber_motion/dto/requests/autofocus_get_status_response.py +50 -50
- zaber_motion/dto/requests/autofocus_set_objective_params_request.py +141 -141
- zaber_motion/dto/requests/axes_empty_request.py +95 -95
- zaber_motion/dto/requests/axes_get_setting_request.py +121 -121
- zaber_motion/dto/requests/axes_move_request.py +114 -114
- zaber_motion/dto/requests/axis_empty_request.py +79 -79
- zaber_motion/dto/requests/axis_move_type.py +12 -12
- zaber_motion/dto/requests/axis_to_string_request.py +88 -88
- zaber_motion/dto/requests/binary_device_detect_request.py +56 -56
- zaber_motion/dto/requests/binary_device_detect_response.py +57 -57
- zaber_motion/dto/requests/binary_device_get_setting_request.py +89 -89
- zaber_motion/dto/requests/binary_device_home_request.py +88 -88
- zaber_motion/dto/requests/binary_device_move_request.py +111 -111
- zaber_motion/dto/requests/binary_device_set_setting_request.py +100 -100
- zaber_motion/dto/requests/binary_device_stop_request.py +88 -88
- zaber_motion/dto/requests/binary_generic_with_units_request.py +122 -122
- zaber_motion/dto/requests/binary_message_collection.py +56 -56
- zaber_motion/dto/requests/binary_reply_only_event_wrapper.py +82 -82
- zaber_motion/dto/requests/bool_response.py +43 -43
- zaber_motion/dto/requests/can_set_state_axis_response.py +60 -60
- zaber_motion/dto/requests/can_set_state_request.py +100 -100
- zaber_motion/dto/requests/channel_on.py +96 -84
- zaber_motion/dto/requests/channel_set_intensity.py +90 -90
- zaber_motion/dto/requests/check_version_request.py +54 -54
- zaber_motion/dto/requests/custom_interface_close_request.py +60 -60
- zaber_motion/dto/requests/custom_interface_open_response.py +51 -51
- zaber_motion/dto/requests/custom_interface_read_request.py +51 -51
- zaber_motion/dto/requests/custom_interface_write_request.py +60 -60
- zaber_motion/dto/requests/device_cancel_all_outputs_schedule_request.py +80 -80
- zaber_motion/dto/requests/device_cancel_output_schedule_request.py +84 -84
- zaber_motion/dto/requests/device_convert_setting_request.py +116 -116
- zaber_motion/dto/requests/device_detect_request.py +68 -68
- zaber_motion/dto/requests/device_detect_response.py +57 -57
- zaber_motion/dto/requests/device_empty_request.py +65 -65
- zaber_motion/dto/requests/device_get_all_analog_io_request.py +74 -74
- zaber_motion/dto/requests/device_get_all_analog_io_response.py +54 -54
- zaber_motion/dto/requests/device_get_all_digital_io_request.py +74 -74
- zaber_motion/dto/requests/device_get_all_digital_io_response.py +46 -46
- zaber_motion/dto/requests/device_get_analog_io_request.py +88 -88
- zaber_motion/dto/requests/device_get_digital_io_request.py +88 -88
- zaber_motion/dto/requests/device_get_setting_request.py +100 -100
- zaber_motion/dto/requests/device_get_storage_request.py +93 -93
- zaber_motion/dto/requests/device_get_warnings_request.py +84 -84
- zaber_motion/dto/requests/device_get_warnings_response.py +51 -51
- zaber_motion/dto/requests/device_home_request.py +84 -84
- zaber_motion/dto/requests/device_identify_request.py +77 -77
- zaber_motion/dto/requests/device_move_request.py +177 -177
- zaber_motion/dto/requests/device_move_sin_request.py +140 -140
- zaber_motion/dto/requests/device_multi_get_setting_request.py +118 -118
- zaber_motion/dto/requests/device_on_all_request.py +56 -56
- zaber_motion/dto/requests/device_on_all_response.py +57 -57
- zaber_motion/dto/requests/device_restore_request.py +84 -84
- zaber_motion/dto/requests/device_set_all_analog_outputs_request.py +82 -82
- zaber_motion/dto/requests/device_set_all_analog_outputs_schedule_request.py +121 -121
- zaber_motion/dto/requests/device_set_all_digital_outputs_request.py +83 -83
- zaber_motion/dto/requests/device_set_all_digital_outputs_schedule_request.py +122 -122
- zaber_motion/dto/requests/device_set_analog_output_request.py +90 -90
- zaber_motion/dto/requests/device_set_analog_output_schedule_request.py +124 -124
- zaber_motion/dto/requests/device_set_digital_output_request.py +91 -91
- zaber_motion/dto/requests/device_set_digital_output_schedule_request.py +125 -125
- zaber_motion/dto/requests/device_set_lowpass_filter_request.py +102 -102
- zaber_motion/dto/requests/device_set_setting_bool_request.py +93 -93
- zaber_motion/dto/requests/device_set_setting_int_request.py +102 -102
- zaber_motion/dto/requests/device_set_setting_request.py +111 -111
- zaber_motion/dto/requests/device_set_setting_str_request.py +97 -97
- zaber_motion/dto/requests/device_set_storage_bool_request.py +93 -93
- zaber_motion/dto/requests/device_set_storage_number_request.py +99 -99
- zaber_motion/dto/requests/device_set_storage_request.py +102 -102
- zaber_motion/dto/requests/device_set_unit_conversions_request.py +108 -108
- zaber_motion/dto/requests/device_stop_request.py +84 -84
- zaber_motion/dto/requests/device_storage_list_keys_request.py +88 -88
- zaber_motion/dto/requests/device_storage_request.py +88 -88
- zaber_motion/dto/requests/device_type.py +8 -8
- zaber_motion/dto/requests/device_wait_until_idle_request.py +84 -84
- zaber_motion/dto/requests/disconnected_event.py +101 -101
- zaber_motion/dto/requests/double_array_response.py +54 -54
- zaber_motion/dto/requests/double_response.py +48 -48
- zaber_motion/dto/requests/driver_enable_request.py +90 -90
- zaber_motion/dto/requests/empty_autofocus_request.py +107 -107
- zaber_motion/dto/requests/empty_request.py +38 -38
- zaber_motion/dto/requests/errors.py +68 -68
- zaber_motion/dto/requests/find_device_request.py +65 -65
- zaber_motion/dto/requests/find_device_response.py +51 -51
- zaber_motion/dto/requests/forget_devices_request.py +71 -71
- zaber_motion/dto/requests/gateway_event.py +45 -45
- zaber_motion/dto/requests/gateway_request.py +45 -45
- zaber_motion/dto/requests/gateway_response.py +69 -69
- zaber_motion/dto/requests/generic_binary_request.py +107 -107
- zaber_motion/dto/requests/generic_command_request.py +107 -107
- zaber_motion/dto/requests/generic_command_response_collection.py +56 -56
- zaber_motion/dto/requests/get_all_io_port_labels_response.py +56 -56
- zaber_motion/dto/requests/get_axis_setting_results.py +56 -56
- zaber_motion/dto/requests/get_io_port_label_request.py +91 -91
- zaber_motion/dto/requests/get_setting_results.py +56 -56
- zaber_motion/dto/requests/get_simple_tuning_param_definition_response.py +56 -56
- zaber_motion/dto/requests/int_64_response.py +51 -51
- zaber_motion/dto/requests/int_array_response.py +57 -57
- zaber_motion/dto/requests/int_request.py +51 -51
- zaber_motion/dto/requests/int_response.py +51 -51
- zaber_motion/dto/requests/interface_empty_request.py +51 -51
- zaber_motion/dto/requests/interface_type.py +11 -11
- zaber_motion/dto/requests/load_paramset.py +102 -102
- zaber_motion/dto/requests/lockstep_disable_request.py +84 -84
- zaber_motion/dto/requests/lockstep_empty_request.py +79 -79
- zaber_motion/dto/requests/lockstep_enable_request.py +99 -99
- zaber_motion/dto/requests/lockstep_get_axis_numbers_response.py +57 -57
- zaber_motion/dto/requests/lockstep_get_request.py +91 -91
- zaber_motion/dto/requests/lockstep_home_request.py +84 -84
- zaber_motion/dto/requests/lockstep_move_request.py +163 -163
- zaber_motion/dto/requests/lockstep_move_sin_request.py +140 -140
- zaber_motion/dto/requests/lockstep_set_request.py +116 -116
- zaber_motion/dto/requests/lockstep_stop_request.py +84 -84
- zaber_motion/dto/requests/lockstep_wait_until_idle_request.py +84 -84
- zaber_motion/dto/requests/microscope_config_response.py +50 -50
- zaber_motion/dto/requests/microscope_empty_request.py +65 -65
- zaber_motion/dto/requests/microscope_find_request.py +63 -63
- zaber_motion/dto/requests/microscope_init_request.py +70 -70
- zaber_motion/dto/requests/microscope_trigger_camera_request.py +107 -107
- zaber_motion/dto/requests/objective_changer_change_request.py +119 -119
- zaber_motion/dto/requests/objective_changer_create_response.py +79 -79
- zaber_motion/dto/requests/objective_changer_get_current_response.py +51 -51
- zaber_motion/dto/requests/objective_changer_request.py +93 -93
- zaber_motion/dto/requests/objective_changer_set_request.py +116 -116
- zaber_motion/dto/requests/open_binary_interface_request.py +100 -100
- zaber_motion/dto/requests/open_interface_request.py +159 -159
- zaber_motion/dto/requests/open_interface_response.py +51 -51
- zaber_motion/dto/requests/oscilloscope_add_io_channel_request.py +91 -91
- zaber_motion/dto/requests/oscilloscope_add_setting_channel_request.py +88 -88
- zaber_motion/dto/requests/oscilloscope_data_get_request.py +63 -63
- zaber_motion/dto/requests/oscilloscope_data_get_sample_time_request.py +77 -77
- zaber_motion/dto/requests/oscilloscope_data_get_samples_response.py +54 -54
- zaber_motion/dto/requests/oscilloscope_data_identifier.py +51 -51
- zaber_motion/dto/requests/oscilloscope_read_response.py +57 -57
- zaber_motion/dto/requests/oscilloscope_request.py +65 -65
- zaber_motion/dto/requests/oscilloscope_start_request.py +79 -79
- zaber_motion/dto/requests/prepare_command_request.py +108 -108
- zaber_motion/dto/requests/process_on.py +107 -107
- zaber_motion/dto/requests/pvt_buffer_get_sequence_data_request.py +79 -79
- zaber_motion/dto/requests/pvt_csv_request.py +59 -59
- zaber_motion/dto/requests/pvt_generate_positions_request.py +74 -74
- zaber_motion/dto/requests/pvt_generate_velocities_and_times_request.py +96 -96
- zaber_motion/dto/requests/pvt_generate_velocities_request.py +93 -93
- zaber_motion/dto/requests/pvt_load_csv_request.py +45 -45
- zaber_motion/dto/requests/pvt_point_request.py +145 -145
- zaber_motion/dto/requests/pvt_points_request.py +147 -147
- zaber_motion/dto/requests/pvt_save_csv_request.py +74 -74
- zaber_motion/dto/requests/pvt_submit_sequence_data_request.py +93 -93
- zaber_motion/dto/requests/renumber_request.py +79 -79
- zaber_motion/dto/requests/response_type.py +8 -8
- zaber_motion/dto/requests/servo_tuning_paramset_response.py +48 -48
- zaber_motion/dto/requests/servo_tuning_request.py +91 -91
- zaber_motion/dto/requests/set_device_db_layered_sources_request.py +56 -56
- zaber_motion/dto/requests/set_device_db_source_request.py +63 -63
- zaber_motion/dto/requests/set_interface_checksum_enabled_request.py +56 -56
- zaber_motion/dto/requests/set_interface_timeout_request.py +65 -65
- zaber_motion/dto/requests/set_internal_mode_request.py +43 -43
- zaber_motion/dto/requests/set_io_port_label_request.py +100 -100
- zaber_motion/dto/requests/set_log_output_request.py +57 -57
- zaber_motion/dto/requests/set_process_controller_source.py +93 -93
- zaber_motion/dto/requests/set_servo_tuning_pid_request.py +135 -135
- zaber_motion/dto/requests/set_servo_tuning_request.py +116 -116
- zaber_motion/dto/requests/set_simple_tuning.py +174 -174
- zaber_motion/dto/requests/set_state_request.py +93 -93
- zaber_motion/dto/requests/stream_arc_request.py +199 -199
- zaber_motion/dto/requests/stream_buffer_erase_request.py +84 -84
- zaber_motion/dto/requests/stream_buffer_get_content_request.py +84 -84
- zaber_motion/dto/requests/stream_buffer_get_content_response.py +51 -51
- zaber_motion/dto/requests/stream_buffer_list.py +70 -70
- zaber_motion/dto/requests/stream_call_request.py +112 -112
- zaber_motion/dto/requests/stream_cancel_all_outputs_schedule_request.py +99 -99
- zaber_motion/dto/requests/stream_cancel_output_schedule_request.py +103 -103
- zaber_motion/dto/requests/stream_circle_request.py +155 -155
- zaber_motion/dto/requests/stream_empty_request.py +84 -84
- zaber_motion/dto/requests/stream_generic_command_batch_request.py +99 -99
- zaber_motion/dto/requests/stream_generic_command_request.py +93 -93
- zaber_motion/dto/requests/stream_get_axes_response.py +75 -75
- zaber_motion/dto/requests/stream_get_max_centripetal_acceleration_request.py +96 -96
- zaber_motion/dto/requests/stream_get_max_speed_request.py +96 -96
- zaber_motion/dto/requests/stream_get_max_tangential_acceleration_request.py +96 -96
- zaber_motion/dto/requests/stream_line_request.py +135 -135
- zaber_motion/dto/requests/stream_mode_response.py +60 -60
- zaber_motion/dto/requests/stream_segment_type.py +8 -8
- zaber_motion/dto/requests/stream_set_all_analog_outputs_request.py +101 -101
- zaber_motion/dto/requests/stream_set_all_analog_outputs_schedule_request.py +140 -140
- zaber_motion/dto/requests/stream_set_all_digital_outputs_request.py +102 -102
- zaber_motion/dto/requests/stream_set_all_digital_outputs_schedule_request.py +141 -141
- zaber_motion/dto/requests/stream_set_analog_output_request.py +109 -109
- zaber_motion/dto/requests/stream_set_analog_output_schedule_request.py +143 -143
- zaber_motion/dto/requests/stream_set_digital_output_request.py +110 -110
- zaber_motion/dto/requests/stream_set_digital_output_schedule_request.py +144 -144
- zaber_motion/dto/requests/stream_set_hold_request.py +89 -89
- zaber_motion/dto/requests/stream_set_max_centripetal_acceleration_request.py +107 -107
- zaber_motion/dto/requests/stream_set_max_speed_request.py +107 -107
- zaber_motion/dto/requests/stream_set_max_tangential_acceleration_request.py +107 -107
- zaber_motion/dto/requests/stream_setup_live_composite_request.py +123 -123
- zaber_motion/dto/requests/stream_setup_live_request.py +104 -104
- zaber_motion/dto/requests/stream_setup_store_arbitrary_axes_request.py +126 -126
- zaber_motion/dto/requests/stream_setup_store_composite_request.py +151 -151
- zaber_motion/dto/requests/stream_setup_store_request.py +132 -132
- zaber_motion/dto/requests/stream_wait_analog_input_request.py +118 -118
- zaber_motion/dto/requests/stream_wait_digital_input_request.py +103 -103
- zaber_motion/dto/requests/stream_wait_request.py +107 -107
- zaber_motion/dto/requests/stream_wait_until_idle_request.py +89 -89
- zaber_motion/dto/requests/string_array_response.py +51 -51
- zaber_motion/dto/requests/string_response.py +45 -45
- zaber_motion/dto/requests/test_event.py +45 -45
- zaber_motion/dto/requests/test_request.py +55 -55
- zaber_motion/dto/requests/test_request_complex.py +57 -0
- zaber_motion/dto/requests/test_response.py +45 -45
- zaber_motion/dto/requests/test_response_long.py +51 -51
- zaber_motion/dto/requests/toggle_device_db_store_request.py +50 -50
- zaber_motion/dto/requests/tools_list_serial_ports_response.py +51 -51
- zaber_motion/dto/requests/translator_create_from_device_request.py +97 -97
- zaber_motion/dto/requests/translator_create_live_request.py +91 -91
- zaber_motion/dto/requests/translator_create_request.py +62 -62
- zaber_motion/dto/requests/translator_create_response.py +51 -51
- zaber_motion/dto/requests/translator_empty_request.py +51 -51
- zaber_motion/dto/requests/translator_flush_live_request.py +56 -56
- zaber_motion/dto/requests/translator_flush_response.py +51 -51
- zaber_motion/dto/requests/translator_get_axis_offset_request.py +81 -81
- zaber_motion/dto/requests/translator_get_axis_position_request.py +72 -72
- zaber_motion/dto/requests/translator_set_axis_position_request.py +83 -83
- zaber_motion/dto/requests/translator_set_feed_rate_override_request.py +62 -62
- zaber_motion/dto/requests/translator_set_traverse_rate_request.py +74 -74
- zaber_motion/dto/requests/translator_translate_request.py +60 -60
- zaber_motion/dto/requests/trigger_clear_action_request.py +91 -91
- zaber_motion/dto/requests/trigger_empty_request.py +79 -79
- zaber_motion/dto/requests/trigger_enable_request.py +93 -93
- zaber_motion/dto/requests/trigger_enabled_states.py +56 -56
- zaber_motion/dto/requests/trigger_fire_at_interval_request.py +102 -102
- zaber_motion/dto/requests/trigger_fire_when_distance_travelled_request.py +116 -116
- zaber_motion/dto/requests/trigger_fire_when_io_request.py +128 -128
- zaber_motion/dto/requests/trigger_fire_when_request.py +88 -88
- zaber_motion/dto/requests/trigger_fire_when_setting_request.py +137 -137
- zaber_motion/dto/requests/trigger_on_fire_request.py +114 -114
- zaber_motion/dto/requests/trigger_on_fire_set_request.py +149 -149
- zaber_motion/dto/requests/trigger_on_fire_set_to_setting_request.py +149 -149
- zaber_motion/dto/requests/trigger_set_label_request.py +88 -88
- zaber_motion/dto/requests/trigger_states.py +56 -56
- zaber_motion/dto/requests/unit_convert_unit_request.py +71 -71
- zaber_motion/dto/requests/unit_get_enum_request.py +45 -45
- zaber_motion/dto/requests/unit_get_enum_response.py +48 -48
- zaber_motion/dto/requests/unit_get_symbol_request.py +48 -48
- zaber_motion/dto/requests/unit_get_symbol_response.py +45 -45
- zaber_motion/dto/requests/unknown_binary_response_event_wrapper.py +82 -82
- zaber_motion/dto/requests/unknown_response_event_wrapper.py +82 -82
- zaber_motion/dto/requests/wait_to_clear_warnings_request.py +105 -105
- zaber_motion/dto/requests/wait_to_respond_request.py +76 -76
- zaber_motion/dto/requests/wdi_generic_float_request.py +119 -0
- zaber_motion/dto/requests/wdi_generic_request.py +136 -136
- zaber_motion/dto/requests/wdi_get_status_response.py +50 -50
- zaber_motion/dto/rotation_direction.py +13 -13
- zaber_motion/dto_object.py +18 -18
- zaber_motion/events.py +112 -112
- zaber_motion/exceptions/__init__.py +87 -87
- zaber_motion/exceptions/bad_command_exception.py +10 -10
- zaber_motion/exceptions/bad_data_exception.py +10 -10
- zaber_motion/exceptions/binary_command_failed_exception.py +27 -27
- zaber_motion/exceptions/command_failed_exception.py +27 -27
- zaber_motion/exceptions/command_preempted_exception.py +10 -10
- zaber_motion/exceptions/command_too_long_exception.py +27 -27
- zaber_motion/exceptions/connection_closed_exception.py +10 -10
- zaber_motion/exceptions/connection_failed_exception.py +10 -10
- zaber_motion/exceptions/conversion_failed_exception.py +10 -10
- zaber_motion/exceptions/device_address_conflict_exception.py +27 -27
- zaber_motion/exceptions/device_busy_exception.py +10 -10
- zaber_motion/exceptions/device_db_failed_exception.py +27 -27
- zaber_motion/exceptions/device_detection_failed_exception.py +10 -10
- zaber_motion/exceptions/device_failed_exception.py +11 -11
- zaber_motion/exceptions/device_not_identified_exception.py +10 -10
- zaber_motion/exceptions/driver_disabled_exception.py +10 -10
- zaber_motion/exceptions/g_code_execution_exception.py +27 -27
- zaber_motion/exceptions/g_code_syntax_exception.py +27 -27
- zaber_motion/exceptions/incompatible_shared_library_exception.py +11 -11
- zaber_motion/exceptions/internal_error_exception.py +10 -10
- zaber_motion/exceptions/invalid_argument_exception.py +10 -10
- zaber_motion/exceptions/invalid_csv_data_exception.py +10 -10
- zaber_motion/exceptions/invalid_data_exception.py +10 -10
- zaber_motion/exceptions/invalid_operation_exception.py +10 -10
- zaber_motion/exceptions/invalid_packet_exception.py +27 -27
- zaber_motion/exceptions/invalid_park_state_exception.py +10 -10
- zaber_motion/exceptions/invalid_request_data_exception.py +11 -11
- zaber_motion/exceptions/invalid_response_exception.py +27 -27
- zaber_motion/exceptions/io_channel_out_of_range_exception.py +10 -10
- zaber_motion/exceptions/io_failed_exception.py +10 -10
- zaber_motion/exceptions/lockstep_enabled_exception.py +10 -10
- zaber_motion/exceptions/lockstep_not_enabled_exception.py +10 -10
- zaber_motion/exceptions/motion_lib_exception.py +18 -18
- zaber_motion/exceptions/movement_failed_exception.py +27 -27
- zaber_motion/exceptions/movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/no_device_found_exception.py +10 -10
- zaber_motion/exceptions/no_value_for_key_exception.py +10 -10
- zaber_motion/exceptions/not_supported_exception.py +10 -10
- zaber_motion/exceptions/operation_failed_exception.py +27 -27
- zaber_motion/exceptions/os_failed_exception.py +10 -10
- zaber_motion/exceptions/out_of_request_ids_exception.py +10 -10
- zaber_motion/exceptions/pvt_discontinuity_exception.py +10 -10
- zaber_motion/exceptions/pvt_execution_exception.py +27 -27
- zaber_motion/exceptions/pvt_mode_exception.py +10 -10
- zaber_motion/exceptions/pvt_movement_failed_exception.py +27 -27
- zaber_motion/exceptions/pvt_movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/pvt_sequence_generation_failed_exception.py +10 -10
- zaber_motion/exceptions/pvt_setup_failed_exception.py +10 -10
- zaber_motion/exceptions/remote_mode_exception.py +11 -11
- zaber_motion/exceptions/request_timeout_exception.py +10 -10
- zaber_motion/exceptions/serial_port_busy_exception.py +10 -10
- zaber_motion/exceptions/set_device_state_failed_exception.py +27 -27
- zaber_motion/exceptions/set_peripheral_state_failed_exception.py +27 -27
- zaber_motion/exceptions/setting_not_found_exception.py +10 -10
- zaber_motion/exceptions/stream_discontinuity_exception.py +10 -10
- zaber_motion/exceptions/stream_execution_exception.py +27 -27
- zaber_motion/exceptions/stream_mode_exception.py +10 -10
- zaber_motion/exceptions/stream_movement_failed_exception.py +27 -27
- zaber_motion/exceptions/stream_movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/stream_setup_failed_exception.py +10 -10
- zaber_motion/exceptions/timeout_exception.py +10 -10
- zaber_motion/exceptions/transport_already_used_exception.py +10 -10
- zaber_motion/exceptions/unknown_request_exception.py +10 -10
- zaber_motion/gcode/__init__.py +11 -11
- zaber_motion/gcode/offline_translator.py +401 -401
- zaber_motion/gcode/translator.py +424 -424
- zaber_motion/library.py +179 -179
- zaber_motion/microscopy/__init__.py +14 -14
- zaber_motion/microscopy/autofocus.py +645 -645
- zaber_motion/microscopy/camera_trigger.py +108 -108
- zaber_motion/microscopy/filter_changer.py +167 -167
- zaber_motion/microscopy/illuminator.py +163 -139
- zaber_motion/microscopy/illuminator_channel.py +629 -616
- zaber_motion/microscopy/microscope.py +315 -315
- zaber_motion/microscopy/objective_changer.py +403 -403
- zaber_motion/microscopy/wdi_autofocus_provider.py +536 -396
- zaber_motion/product/__init__.py +7 -7
- zaber_motion/product/process.py +818 -818
- zaber_motion/product/process_controller.py +134 -134
- zaber_motion/serialization.py +32 -32
- zaber_motion/tools.py +78 -78
- zaber_motion/unit_table.py +86 -86
- zaber_motion/units.py +206 -206
- zaber_motion/version.py +1 -1
- {zaber_motion-7.13.0.dist-info → zaber_motion-7.15.0.dist-info}/LICENSE.txt +2119 -2119
- {zaber_motion-7.13.0.dist-info → zaber_motion-7.15.0.dist-info}/METADATA +1 -1
- zaber_motion-7.15.0.dist-info/RECORD +496 -0
- zaber_motion_bindings/zaber-motion-core-windows-386.dll +0 -0
- zaber_motion-7.13.0.dist-info/RECORD +0 -494
- {zaber_motion-7.13.0.dist-info → zaber_motion-7.15.0.dist-info}/WHEEL +0 -0
- {zaber_motion-7.13.0.dist-info → zaber_motion-7.15.0.dist-info}/top_level.txt +0 -0
|
@@ -1,1530 +1,1530 @@
|
|
|
1
|
-
# pylint: disable=too-many-arguments, too-many-lines
|
|
2
|
-
|
|
3
|
-
# ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== #
|
|
4
|
-
# ============== DO NOT EDIT DIRECTLY ============== #
|
|
5
|
-
from typing import TYPE_CHECKING, List, Optional
|
|
6
|
-
from ..dto import requests as dto
|
|
7
|
-
from ..call import call, call_async, call_sync
|
|
8
|
-
from ..dto.measurement import Measurement
|
|
9
|
-
from .pvt_buffer import PvtBuffer
|
|
10
|
-
from ..dto.ascii.pvt_mode import PvtMode
|
|
11
|
-
from ..dto.ascii.pvt_axis_definition import PvtAxisDefinition
|
|
12
|
-
from ..dto.ascii.pvt_sequence_data import PvtSequenceData
|
|
13
|
-
from ..dto.ascii.pvt_csv_data import PvtCsvData
|
|
14
|
-
from ..dto.ascii.measurement_sequence import MeasurementSequence
|
|
15
|
-
from ..dto.ascii.optional_measurement_sequence import OptionalMeasurementSequence
|
|
16
|
-
|
|
17
|
-
from .pvt_io import PvtIo
|
|
18
|
-
from ..dto.ascii.digital_output_action import DigitalOutputAction
|
|
19
|
-
|
|
20
|
-
if TYPE_CHECKING:
|
|
21
|
-
from .device import Device
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class PvtSequence:
|
|
25
|
-
"""
|
|
26
|
-
A handle for a PVT sequence with this number on the device.
|
|
27
|
-
PVT sequences provide a way execute or store trajectory
|
|
28
|
-
consisting of points with defined position, velocity, and time.
|
|
29
|
-
PVT sequence methods append actions to a queue which executes
|
|
30
|
-
or stores actions in a first in, first out order.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def device(self) -> 'Device':
|
|
35
|
-
"""
|
|
36
|
-
Device that controls this PVT sequence.
|
|
37
|
-
"""
|
|
38
|
-
return self._device
|
|
39
|
-
|
|
40
|
-
@property
|
|
41
|
-
def pvt_id(self) -> int:
|
|
42
|
-
"""
|
|
43
|
-
The number that identifies the PVT sequence on the device.
|
|
44
|
-
"""
|
|
45
|
-
return self._pvt_id
|
|
46
|
-
|
|
47
|
-
@property
|
|
48
|
-
def mode(self) -> PvtMode:
|
|
49
|
-
"""
|
|
50
|
-
Current mode of the PVT sequence.
|
|
51
|
-
"""
|
|
52
|
-
return self.__retrieve_mode()
|
|
53
|
-
|
|
54
|
-
@property
|
|
55
|
-
def axes(self) -> List[PvtAxisDefinition]:
|
|
56
|
-
"""
|
|
57
|
-
An array of axes definitions the PVT sequence is set up to control.
|
|
58
|
-
"""
|
|
59
|
-
return self.__retrieve_axes()
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def io(self) -> PvtIo:
|
|
63
|
-
"""
|
|
64
|
-
Gets an object that provides access to I/O for this sequence.
|
|
65
|
-
"""
|
|
66
|
-
return self._io
|
|
67
|
-
|
|
68
|
-
def __init__(self, device: 'Device', pvt_id: int):
|
|
69
|
-
self._device: 'Device' = device
|
|
70
|
-
self._pvt_id: int = pvt_id
|
|
71
|
-
self._io: PvtIo = PvtIo(device, pvt_id)
|
|
72
|
-
|
|
73
|
-
def setup_live_composite(
|
|
74
|
-
self,
|
|
75
|
-
*pvt_axes: PvtAxisDefinition
|
|
76
|
-
) -> None:
|
|
77
|
-
"""
|
|
78
|
-
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
79
|
-
Allows use of lockstep axes in a PVT sequence.
|
|
80
|
-
|
|
81
|
-
Args:
|
|
82
|
-
pvt_axes: Definition of the PVT sequence axes.
|
|
83
|
-
"""
|
|
84
|
-
request = dto.StreamSetupLiveCompositeRequest(
|
|
85
|
-
interface_id=self.device.connection.interface_id,
|
|
86
|
-
device=self.device.device_address,
|
|
87
|
-
stream_id=self.pvt_id,
|
|
88
|
-
pvt=True,
|
|
89
|
-
pvt_axes=list(pvt_axes),
|
|
90
|
-
)
|
|
91
|
-
call("device/stream_setup_live_composite", request)
|
|
92
|
-
|
|
93
|
-
async def setup_live_composite_async(
|
|
94
|
-
self,
|
|
95
|
-
*pvt_axes: PvtAxisDefinition
|
|
96
|
-
) -> None:
|
|
97
|
-
"""
|
|
98
|
-
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
99
|
-
Allows use of lockstep axes in a PVT sequence.
|
|
100
|
-
|
|
101
|
-
Args:
|
|
102
|
-
pvt_axes: Definition of the PVT sequence axes.
|
|
103
|
-
"""
|
|
104
|
-
request = dto.StreamSetupLiveCompositeRequest(
|
|
105
|
-
interface_id=self.device.connection.interface_id,
|
|
106
|
-
device=self.device.device_address,
|
|
107
|
-
stream_id=self.pvt_id,
|
|
108
|
-
pvt=True,
|
|
109
|
-
pvt_axes=list(pvt_axes),
|
|
110
|
-
)
|
|
111
|
-
await call_async("device/stream_setup_live_composite", request)
|
|
112
|
-
|
|
113
|
-
def setup_live(
|
|
114
|
-
self,
|
|
115
|
-
*axes: int
|
|
116
|
-
) -> None:
|
|
117
|
-
"""
|
|
118
|
-
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
119
|
-
|
|
120
|
-
Args:
|
|
121
|
-
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
122
|
-
"""
|
|
123
|
-
request = dto.StreamSetupLiveRequest(
|
|
124
|
-
interface_id=self.device.connection.interface_id,
|
|
125
|
-
device=self.device.device_address,
|
|
126
|
-
stream_id=self.pvt_id,
|
|
127
|
-
pvt=True,
|
|
128
|
-
axes=list(axes),
|
|
129
|
-
)
|
|
130
|
-
call("device/stream_setup_live", request)
|
|
131
|
-
|
|
132
|
-
async def setup_live_async(
|
|
133
|
-
self,
|
|
134
|
-
*axes: int
|
|
135
|
-
) -> None:
|
|
136
|
-
"""
|
|
137
|
-
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
138
|
-
|
|
139
|
-
Args:
|
|
140
|
-
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
141
|
-
"""
|
|
142
|
-
request = dto.StreamSetupLiveRequest(
|
|
143
|
-
interface_id=self.device.connection.interface_id,
|
|
144
|
-
device=self.device.device_address,
|
|
145
|
-
stream_id=self.pvt_id,
|
|
146
|
-
pvt=True,
|
|
147
|
-
axes=list(axes),
|
|
148
|
-
)
|
|
149
|
-
await call_async("device/stream_setup_live", request)
|
|
150
|
-
|
|
151
|
-
def setup_store_composite(
|
|
152
|
-
self,
|
|
153
|
-
pvt_buffer: PvtBuffer,
|
|
154
|
-
*pvt_axes: PvtAxisDefinition
|
|
155
|
-
) -> None:
|
|
156
|
-
"""
|
|
157
|
-
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
158
|
-
Allows use of lockstep axes in a PVT sequence.
|
|
159
|
-
|
|
160
|
-
Args:
|
|
161
|
-
pvt_buffer: The PVT buffer to queue actions in.
|
|
162
|
-
pvt_axes: Definition of the PVT sequence axes.
|
|
163
|
-
"""
|
|
164
|
-
request = dto.StreamSetupStoreCompositeRequest(
|
|
165
|
-
interface_id=self.device.connection.interface_id,
|
|
166
|
-
device=self.device.device_address,
|
|
167
|
-
stream_id=self.pvt_id,
|
|
168
|
-
pvt=True,
|
|
169
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
170
|
-
pvt_axes=list(pvt_axes),
|
|
171
|
-
)
|
|
172
|
-
call("device/stream_setup_store_composite", request)
|
|
173
|
-
|
|
174
|
-
async def setup_store_composite_async(
|
|
175
|
-
self,
|
|
176
|
-
pvt_buffer: PvtBuffer,
|
|
177
|
-
*pvt_axes: PvtAxisDefinition
|
|
178
|
-
) -> None:
|
|
179
|
-
"""
|
|
180
|
-
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
181
|
-
Allows use of lockstep axes in a PVT sequence.
|
|
182
|
-
|
|
183
|
-
Args:
|
|
184
|
-
pvt_buffer: The PVT buffer to queue actions in.
|
|
185
|
-
pvt_axes: Definition of the PVT sequence axes.
|
|
186
|
-
"""
|
|
187
|
-
request = dto.StreamSetupStoreCompositeRequest(
|
|
188
|
-
interface_id=self.device.connection.interface_id,
|
|
189
|
-
device=self.device.device_address,
|
|
190
|
-
stream_id=self.pvt_id,
|
|
191
|
-
pvt=True,
|
|
192
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
193
|
-
pvt_axes=list(pvt_axes),
|
|
194
|
-
)
|
|
195
|
-
await call_async("device/stream_setup_store_composite", request)
|
|
196
|
-
|
|
197
|
-
def setup_store(
|
|
198
|
-
self,
|
|
199
|
-
pvt_buffer: PvtBuffer,
|
|
200
|
-
*axes: int
|
|
201
|
-
) -> None:
|
|
202
|
-
"""
|
|
203
|
-
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
204
|
-
|
|
205
|
-
Args:
|
|
206
|
-
pvt_buffer: The PVT buffer to queue actions in.
|
|
207
|
-
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
208
|
-
"""
|
|
209
|
-
request = dto.StreamSetupStoreRequest(
|
|
210
|
-
interface_id=self.device.connection.interface_id,
|
|
211
|
-
device=self.device.device_address,
|
|
212
|
-
stream_id=self.pvt_id,
|
|
213
|
-
pvt=True,
|
|
214
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
215
|
-
axes=list(axes),
|
|
216
|
-
)
|
|
217
|
-
call("device/stream_setup_store", request)
|
|
218
|
-
|
|
219
|
-
async def setup_store_async(
|
|
220
|
-
self,
|
|
221
|
-
pvt_buffer: PvtBuffer,
|
|
222
|
-
*axes: int
|
|
223
|
-
) -> None:
|
|
224
|
-
"""
|
|
225
|
-
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
226
|
-
|
|
227
|
-
Args:
|
|
228
|
-
pvt_buffer: The PVT buffer to queue actions in.
|
|
229
|
-
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
230
|
-
"""
|
|
231
|
-
request = dto.StreamSetupStoreRequest(
|
|
232
|
-
interface_id=self.device.connection.interface_id,
|
|
233
|
-
device=self.device.device_address,
|
|
234
|
-
stream_id=self.pvt_id,
|
|
235
|
-
pvt=True,
|
|
236
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
237
|
-
axes=list(axes),
|
|
238
|
-
)
|
|
239
|
-
await call_async("device/stream_setup_store", request)
|
|
240
|
-
|
|
241
|
-
def call(
|
|
242
|
-
self,
|
|
243
|
-
pvt_buffer: PvtBuffer
|
|
244
|
-
) -> None:
|
|
245
|
-
"""
|
|
246
|
-
Append the actions in a PVT buffer to the sequence's queue.
|
|
247
|
-
|
|
248
|
-
Args:
|
|
249
|
-
pvt_buffer: The PVT buffer to call.
|
|
250
|
-
"""
|
|
251
|
-
request = dto.StreamCallRequest(
|
|
252
|
-
interface_id=self.device.connection.interface_id,
|
|
253
|
-
device=self.device.device_address,
|
|
254
|
-
stream_id=self.pvt_id,
|
|
255
|
-
pvt=True,
|
|
256
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
257
|
-
)
|
|
258
|
-
call("device/stream_call", request)
|
|
259
|
-
|
|
260
|
-
async def call_async(
|
|
261
|
-
self,
|
|
262
|
-
pvt_buffer: PvtBuffer
|
|
263
|
-
) -> None:
|
|
264
|
-
"""
|
|
265
|
-
Append the actions in a PVT buffer to the sequence's queue.
|
|
266
|
-
|
|
267
|
-
Args:
|
|
268
|
-
pvt_buffer: The PVT buffer to call.
|
|
269
|
-
"""
|
|
270
|
-
request = dto.StreamCallRequest(
|
|
271
|
-
interface_id=self.device.connection.interface_id,
|
|
272
|
-
device=self.device.device_address,
|
|
273
|
-
stream_id=self.pvt_id,
|
|
274
|
-
pvt=True,
|
|
275
|
-
pvt_buffer=pvt_buffer.buffer_id,
|
|
276
|
-
)
|
|
277
|
-
await call_async("device/stream_call", request)
|
|
278
|
-
|
|
279
|
-
def point(
|
|
280
|
-
self,
|
|
281
|
-
positions: List[Measurement],
|
|
282
|
-
velocities: List[Optional[Measurement]],
|
|
283
|
-
time: Measurement
|
|
284
|
-
) -> None:
|
|
285
|
-
"""
|
|
286
|
-
Queues a point with absolute coordinates in the PVT sequence.
|
|
287
|
-
If some or all velocities are not provided, the sequence calculates the velocities
|
|
288
|
-
from surrounding points using finite difference.
|
|
289
|
-
The last point of the sequence must have defined velocity (likely zero).
|
|
290
|
-
|
|
291
|
-
Args:
|
|
292
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
293
|
-
velocities: The axes velocities at the given point.
|
|
294
|
-
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
295
|
-
time: The duration between the previous point in the sequence and this one.
|
|
296
|
-
"""
|
|
297
|
-
request = dto.PvtPointRequest(
|
|
298
|
-
interface_id=self.device.connection.interface_id,
|
|
299
|
-
device=self.device.device_address,
|
|
300
|
-
stream_id=self.pvt_id,
|
|
301
|
-
pvt=True,
|
|
302
|
-
type=dto.StreamSegmentType.ABS,
|
|
303
|
-
positions=positions,
|
|
304
|
-
velocities=velocities,
|
|
305
|
-
time=time,
|
|
306
|
-
)
|
|
307
|
-
call("device/stream_point", request)
|
|
308
|
-
|
|
309
|
-
async def point_async(
|
|
310
|
-
self,
|
|
311
|
-
positions: List[Measurement],
|
|
312
|
-
velocities: List[Optional[Measurement]],
|
|
313
|
-
time: Measurement
|
|
314
|
-
) -> None:
|
|
315
|
-
"""
|
|
316
|
-
Queues a point with absolute coordinates in the PVT sequence.
|
|
317
|
-
If some or all velocities are not provided, the sequence calculates the velocities
|
|
318
|
-
from surrounding points using finite difference.
|
|
319
|
-
The last point of the sequence must have defined velocity (likely zero).
|
|
320
|
-
|
|
321
|
-
Args:
|
|
322
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
323
|
-
velocities: The axes velocities at the given point.
|
|
324
|
-
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
325
|
-
time: The duration between the previous point in the sequence and this one.
|
|
326
|
-
"""
|
|
327
|
-
request = dto.PvtPointRequest(
|
|
328
|
-
interface_id=self.device.connection.interface_id,
|
|
329
|
-
device=self.device.device_address,
|
|
330
|
-
stream_id=self.pvt_id,
|
|
331
|
-
pvt=True,
|
|
332
|
-
type=dto.StreamSegmentType.ABS,
|
|
333
|
-
positions=positions,
|
|
334
|
-
velocities=velocities,
|
|
335
|
-
time=time,
|
|
336
|
-
)
|
|
337
|
-
await call_async("device/stream_point", request)
|
|
338
|
-
|
|
339
|
-
def points(
|
|
340
|
-
self,
|
|
341
|
-
positions: List[MeasurementSequence],
|
|
342
|
-
velocities: List[MeasurementSequence],
|
|
343
|
-
times: MeasurementSequence
|
|
344
|
-
) -> None:
|
|
345
|
-
"""
|
|
346
|
-
Queues points with absolute coordinates in the PVT sequence.
|
|
347
|
-
|
|
348
|
-
Args:
|
|
349
|
-
positions: Per-axis sequences of positions.
|
|
350
|
-
velocities: Per-axis sequences of velocities.
|
|
351
|
-
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
352
|
-
times: Segment times from one point to another.
|
|
353
|
-
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
354
|
-
"""
|
|
355
|
-
request = dto.PvtPointsRequest(
|
|
356
|
-
interface_id=self.device.connection.interface_id,
|
|
357
|
-
device=self.device.device_address,
|
|
358
|
-
stream_id=self.pvt_id,
|
|
359
|
-
pvt=True,
|
|
360
|
-
type=dto.StreamSegmentType.ABS,
|
|
361
|
-
positions=positions,
|
|
362
|
-
velocities=velocities,
|
|
363
|
-
times=times,
|
|
364
|
-
)
|
|
365
|
-
call("device/stream_points", request)
|
|
366
|
-
|
|
367
|
-
async def points_async(
|
|
368
|
-
self,
|
|
369
|
-
positions: List[MeasurementSequence],
|
|
370
|
-
velocities: List[MeasurementSequence],
|
|
371
|
-
times: MeasurementSequence
|
|
372
|
-
) -> None:
|
|
373
|
-
"""
|
|
374
|
-
Queues points with absolute coordinates in the PVT sequence.
|
|
375
|
-
|
|
376
|
-
Args:
|
|
377
|
-
positions: Per-axis sequences of positions.
|
|
378
|
-
velocities: Per-axis sequences of velocities.
|
|
379
|
-
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
380
|
-
times: Segment times from one point to another.
|
|
381
|
-
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
382
|
-
"""
|
|
383
|
-
request = dto.PvtPointsRequest(
|
|
384
|
-
interface_id=self.device.connection.interface_id,
|
|
385
|
-
device=self.device.device_address,
|
|
386
|
-
stream_id=self.pvt_id,
|
|
387
|
-
pvt=True,
|
|
388
|
-
type=dto.StreamSegmentType.ABS,
|
|
389
|
-
positions=positions,
|
|
390
|
-
velocities=velocities,
|
|
391
|
-
times=times,
|
|
392
|
-
)
|
|
393
|
-
await call_async("device/stream_points", request)
|
|
394
|
-
|
|
395
|
-
def point_relative(
|
|
396
|
-
self,
|
|
397
|
-
positions: List[Measurement],
|
|
398
|
-
velocities: List[Optional[Measurement]],
|
|
399
|
-
time: Measurement
|
|
400
|
-
) -> None:
|
|
401
|
-
"""
|
|
402
|
-
Queues a point with coordinates relative to the previous point in the PVT sequence.
|
|
403
|
-
If some or all velocities are not provided, the sequence calculates the velocities
|
|
404
|
-
from surrounding points using finite difference.
|
|
405
|
-
The last point of the sequence must have defined velocity (likely zero).
|
|
406
|
-
|
|
407
|
-
Args:
|
|
408
|
-
positions: Positions for the axes to move through, relative to the previous point.
|
|
409
|
-
velocities: The axes velocities at the given point.
|
|
410
|
-
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
411
|
-
time: The duration between the previous point in the sequence and this one.
|
|
412
|
-
"""
|
|
413
|
-
request = dto.PvtPointRequest(
|
|
414
|
-
interface_id=self.device.connection.interface_id,
|
|
415
|
-
device=self.device.device_address,
|
|
416
|
-
stream_id=self.pvt_id,
|
|
417
|
-
pvt=True,
|
|
418
|
-
type=dto.StreamSegmentType.REL,
|
|
419
|
-
positions=positions,
|
|
420
|
-
velocities=velocities,
|
|
421
|
-
time=time,
|
|
422
|
-
)
|
|
423
|
-
call("device/stream_point", request)
|
|
424
|
-
|
|
425
|
-
async def point_relative_async(
|
|
426
|
-
self,
|
|
427
|
-
positions: List[Measurement],
|
|
428
|
-
velocities: List[Optional[Measurement]],
|
|
429
|
-
time: Measurement
|
|
430
|
-
) -> None:
|
|
431
|
-
"""
|
|
432
|
-
Queues a point with coordinates relative to the previous point in the PVT sequence.
|
|
433
|
-
If some or all velocities are not provided, the sequence calculates the velocities
|
|
434
|
-
from surrounding points using finite difference.
|
|
435
|
-
The last point of the sequence must have defined velocity (likely zero).
|
|
436
|
-
|
|
437
|
-
Args:
|
|
438
|
-
positions: Positions for the axes to move through, relative to the previous point.
|
|
439
|
-
velocities: The axes velocities at the given point.
|
|
440
|
-
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
441
|
-
time: The duration between the previous point in the sequence and this one.
|
|
442
|
-
"""
|
|
443
|
-
request = dto.PvtPointRequest(
|
|
444
|
-
interface_id=self.device.connection.interface_id,
|
|
445
|
-
device=self.device.device_address,
|
|
446
|
-
stream_id=self.pvt_id,
|
|
447
|
-
pvt=True,
|
|
448
|
-
type=dto.StreamSegmentType.REL,
|
|
449
|
-
positions=positions,
|
|
450
|
-
velocities=velocities,
|
|
451
|
-
time=time,
|
|
452
|
-
)
|
|
453
|
-
await call_async("device/stream_point", request)
|
|
454
|
-
|
|
455
|
-
def points_relative(
|
|
456
|
-
self,
|
|
457
|
-
positions: List[MeasurementSequence],
|
|
458
|
-
velocities: List[MeasurementSequence],
|
|
459
|
-
times: MeasurementSequence
|
|
460
|
-
) -> None:
|
|
461
|
-
"""
|
|
462
|
-
Queues points with coordinates relative to the previous point in the PVT sequence.
|
|
463
|
-
|
|
464
|
-
Args:
|
|
465
|
-
positions: Per-axis sequences of positions.
|
|
466
|
-
velocities: Per-axis sequences of velocities.
|
|
467
|
-
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
468
|
-
times: Segment times from one point to another.
|
|
469
|
-
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
470
|
-
"""
|
|
471
|
-
request = dto.PvtPointsRequest(
|
|
472
|
-
interface_id=self.device.connection.interface_id,
|
|
473
|
-
device=self.device.device_address,
|
|
474
|
-
stream_id=self.pvt_id,
|
|
475
|
-
pvt=True,
|
|
476
|
-
type=dto.StreamSegmentType.REL,
|
|
477
|
-
positions=positions,
|
|
478
|
-
velocities=velocities,
|
|
479
|
-
times=times,
|
|
480
|
-
)
|
|
481
|
-
call("device/stream_points", request)
|
|
482
|
-
|
|
483
|
-
async def points_relative_async(
|
|
484
|
-
self,
|
|
485
|
-
positions: List[MeasurementSequence],
|
|
486
|
-
velocities: List[MeasurementSequence],
|
|
487
|
-
times: MeasurementSequence
|
|
488
|
-
) -> None:
|
|
489
|
-
"""
|
|
490
|
-
Queues points with coordinates relative to the previous point in the PVT sequence.
|
|
491
|
-
|
|
492
|
-
Args:
|
|
493
|
-
positions: Per-axis sequences of positions.
|
|
494
|
-
velocities: Per-axis sequences of velocities.
|
|
495
|
-
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
496
|
-
times: Segment times from one point to another.
|
|
497
|
-
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
498
|
-
"""
|
|
499
|
-
request = dto.PvtPointsRequest(
|
|
500
|
-
interface_id=self.device.connection.interface_id,
|
|
501
|
-
device=self.device.device_address,
|
|
502
|
-
stream_id=self.pvt_id,
|
|
503
|
-
pvt=True,
|
|
504
|
-
type=dto.StreamSegmentType.REL,
|
|
505
|
-
positions=positions,
|
|
506
|
-
velocities=velocities,
|
|
507
|
-
times=times,
|
|
508
|
-
)
|
|
509
|
-
await call_async("device/stream_points", request)
|
|
510
|
-
|
|
511
|
-
@staticmethod
|
|
512
|
-
def generate_velocities(
|
|
513
|
-
positions: List[MeasurementSequence],
|
|
514
|
-
times: MeasurementSequence,
|
|
515
|
-
velocities: Optional[List[OptionalMeasurementSequence]] = None,
|
|
516
|
-
times_relative: bool = True
|
|
517
|
-
) -> PvtSequenceData:
|
|
518
|
-
"""
|
|
519
|
-
Generates velocities for a sequence of positions and times, and (optionally) a partially defined sequence
|
|
520
|
-
of velocities. Note that if some velocities are defined, the solver will NOT modify them in any way.
|
|
521
|
-
If all velocities are defined, the solver will simply return the same velocities.
|
|
522
|
-
This function calculates velocities by enforcing that acceleration be continuous at each segment transition.
|
|
523
|
-
|
|
524
|
-
Also note that if generating a path for multiple axes, the user must provide a position measurement sequence
|
|
525
|
-
per axis, And the values arrays for each sequence must be equal in length to each other and also to the
|
|
526
|
-
times sequence.
|
|
527
|
-
|
|
528
|
-
Does not support native units.
|
|
529
|
-
|
|
530
|
-
Args:
|
|
531
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
532
|
-
Each MeasurementSequence represents a sequence of positions along a particular dimension.
|
|
533
|
-
For example, a 2D path sequence would contain two MeasurementSequence objects,
|
|
534
|
-
one representing positions along X and one for those along Y.
|
|
535
|
-
times: The relative or absolute time of each position in the PVT sequence.
|
|
536
|
-
velocities: Optional velocities corresponding to each point in the position sequences.
|
|
537
|
-
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
538
|
-
they are interpreted as absolute. Note that the values of the returned time
|
|
539
|
-
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
540
|
-
points to have relative times.
|
|
541
|
-
|
|
542
|
-
Returns:
|
|
543
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
544
|
-
"""
|
|
545
|
-
request = dto.PvtGenerateVelocitiesRequest(
|
|
546
|
-
positions=positions,
|
|
547
|
-
times=times,
|
|
548
|
-
velocities=velocities,
|
|
549
|
-
times_relative=times_relative,
|
|
550
|
-
)
|
|
551
|
-
response = call(
|
|
552
|
-
"device/pvt_generate_velocities",
|
|
553
|
-
request,
|
|
554
|
-
PvtSequenceData.from_binary)
|
|
555
|
-
return response
|
|
556
|
-
|
|
557
|
-
@staticmethod
|
|
558
|
-
async def generate_velocities_async(
|
|
559
|
-
positions: List[MeasurementSequence],
|
|
560
|
-
times: MeasurementSequence,
|
|
561
|
-
velocities: Optional[List[OptionalMeasurementSequence]] = None,
|
|
562
|
-
times_relative: bool = True
|
|
563
|
-
) -> PvtSequenceData:
|
|
564
|
-
"""
|
|
565
|
-
Generates velocities for a sequence of positions and times, and (optionally) a partially defined sequence
|
|
566
|
-
of velocities. Note that if some velocities are defined, the solver will NOT modify them in any way.
|
|
567
|
-
If all velocities are defined, the solver will simply return the same velocities.
|
|
568
|
-
This function calculates velocities by enforcing that acceleration be continuous at each segment transition.
|
|
569
|
-
|
|
570
|
-
Also note that if generating a path for multiple axes, the user must provide a position measurement sequence
|
|
571
|
-
per axis, And the values arrays for each sequence must be equal in length to each other and also to the
|
|
572
|
-
times sequence.
|
|
573
|
-
|
|
574
|
-
Does not support native units.
|
|
575
|
-
|
|
576
|
-
Args:
|
|
577
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
578
|
-
Each MeasurementSequence represents a sequence of positions along a particular dimension.
|
|
579
|
-
For example, a 2D path sequence would contain two MeasurementSequence objects,
|
|
580
|
-
one representing positions along X and one for those along Y.
|
|
581
|
-
times: The relative or absolute time of each position in the PVT sequence.
|
|
582
|
-
velocities: Optional velocities corresponding to each point in the position sequences.
|
|
583
|
-
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
584
|
-
they are interpreted as absolute. Note that the values of the returned time
|
|
585
|
-
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
586
|
-
points to have relative times.
|
|
587
|
-
|
|
588
|
-
Returns:
|
|
589
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
590
|
-
"""
|
|
591
|
-
request = dto.PvtGenerateVelocitiesRequest(
|
|
592
|
-
positions=positions,
|
|
593
|
-
times=times,
|
|
594
|
-
velocities=velocities,
|
|
595
|
-
times_relative=times_relative,
|
|
596
|
-
)
|
|
597
|
-
response = await call_async(
|
|
598
|
-
"device/pvt_generate_velocities",
|
|
599
|
-
request,
|
|
600
|
-
PvtSequenceData.from_binary)
|
|
601
|
-
return response
|
|
602
|
-
|
|
603
|
-
@staticmethod
|
|
604
|
-
def generate_positions(
|
|
605
|
-
velocities: List[MeasurementSequence],
|
|
606
|
-
times: MeasurementSequence,
|
|
607
|
-
times_relative: bool = True
|
|
608
|
-
) -> PvtSequenceData:
|
|
609
|
-
"""
|
|
610
|
-
Generates positions for a sequence of velocities and times. This function calculates
|
|
611
|
-
positions by enforcing that acceleration be continuous at each segment transition.
|
|
612
|
-
|
|
613
|
-
Note that if generating a path for multiple axes, the user must provide a
|
|
614
|
-
velocity measurement sequence per axis, and the values arrays for each sequence
|
|
615
|
-
must be equal in length to each other and also to the times sequence.
|
|
616
|
-
|
|
617
|
-
Does not support native units.
|
|
618
|
-
|
|
619
|
-
Args:
|
|
620
|
-
velocities: The sequence of velocities for each axis.
|
|
621
|
-
Each MeasurementSequence represents a sequence of velocities along particular dimension.
|
|
622
|
-
times: The relative or absolute time of each position in the PVT sequence.
|
|
623
|
-
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
624
|
-
they are interpreted as absolute. Note that the values of the returned time
|
|
625
|
-
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
626
|
-
points to have relative times.
|
|
627
|
-
|
|
628
|
-
Returns:
|
|
629
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
630
|
-
"""
|
|
631
|
-
request = dto.PvtGeneratePositionsRequest(
|
|
632
|
-
velocities=velocities,
|
|
633
|
-
times=times,
|
|
634
|
-
times_relative=times_relative,
|
|
635
|
-
)
|
|
636
|
-
response = call(
|
|
637
|
-
"device/pvt_generate_positions",
|
|
638
|
-
request,
|
|
639
|
-
PvtSequenceData.from_binary)
|
|
640
|
-
return response
|
|
641
|
-
|
|
642
|
-
@staticmethod
|
|
643
|
-
async def generate_positions_async(
|
|
644
|
-
velocities: List[MeasurementSequence],
|
|
645
|
-
times: MeasurementSequence,
|
|
646
|
-
times_relative: bool = True
|
|
647
|
-
) -> PvtSequenceData:
|
|
648
|
-
"""
|
|
649
|
-
Generates positions for a sequence of velocities and times. This function calculates
|
|
650
|
-
positions by enforcing that acceleration be continuous at each segment transition.
|
|
651
|
-
|
|
652
|
-
Note that if generating a path for multiple axes, the user must provide a
|
|
653
|
-
velocity measurement sequence per axis, and the values arrays for each sequence
|
|
654
|
-
must be equal in length to each other and also to the times sequence.
|
|
655
|
-
|
|
656
|
-
Does not support native units.
|
|
657
|
-
|
|
658
|
-
Args:
|
|
659
|
-
velocities: The sequence of velocities for each axis.
|
|
660
|
-
Each MeasurementSequence represents a sequence of velocities along particular dimension.
|
|
661
|
-
times: The relative or absolute time of each position in the PVT sequence.
|
|
662
|
-
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
663
|
-
they are interpreted as absolute. Note that the values of the returned time
|
|
664
|
-
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
665
|
-
points to have relative times.
|
|
666
|
-
|
|
667
|
-
Returns:
|
|
668
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
669
|
-
"""
|
|
670
|
-
request = dto.PvtGeneratePositionsRequest(
|
|
671
|
-
velocities=velocities,
|
|
672
|
-
times=times,
|
|
673
|
-
times_relative=times_relative,
|
|
674
|
-
)
|
|
675
|
-
response = await call_async(
|
|
676
|
-
"device/pvt_generate_positions",
|
|
677
|
-
request,
|
|
678
|
-
PvtSequenceData.from_binary)
|
|
679
|
-
return response
|
|
680
|
-
|
|
681
|
-
@staticmethod
|
|
682
|
-
def generate_velocities_and_times(
|
|
683
|
-
positions: List[MeasurementSequence],
|
|
684
|
-
target_speed: Measurement,
|
|
685
|
-
target_acceleration: Measurement,
|
|
686
|
-
resample_number: Optional[int] = None
|
|
687
|
-
) -> PvtSequenceData:
|
|
688
|
-
"""
|
|
689
|
-
Generates sequences of velocities and times for a sequence of positions.
|
|
690
|
-
This function fits a geometric spline (not-a-knot cubic for sequences of >3 points,
|
|
691
|
-
natural cubic for 3, and a straight line for 2) over the position sequence
|
|
692
|
-
and then calculates the velocity and time information by traversing it using a
|
|
693
|
-
trapezoidal motion profile.
|
|
694
|
-
|
|
695
|
-
This generation scheme attempts to keep speed and acceleration less than the
|
|
696
|
-
specified target values, but does not guarantee it. Generally speaking, a higher
|
|
697
|
-
resample number will bring the generated trajectory closer to respecting these
|
|
698
|
-
limits.
|
|
699
|
-
|
|
700
|
-
Note that consecutive duplicate points will be automatically removed as they
|
|
701
|
-
have no geometric significance without additional time information. Also note that
|
|
702
|
-
for multi-dimensional paths this function expects axes to be linear and orthogonal,
|
|
703
|
-
however for paths of a single dimension rotary units are accepted.
|
|
704
|
-
|
|
705
|
-
Does not support native units.
|
|
706
|
-
|
|
707
|
-
Args:
|
|
708
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
709
|
-
target_speed: The target speed used to generate positions and times.
|
|
710
|
-
target_acceleration: The target acceleration used to generate positions and times.
|
|
711
|
-
resample_number: The number of points to resample the sequence by.
|
|
712
|
-
Leave undefined to use the specified points.
|
|
713
|
-
|
|
714
|
-
Returns:
|
|
715
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
716
|
-
"""
|
|
717
|
-
if target_speed.value <= 0 or target_acceleration.value <= 0:
|
|
718
|
-
raise ValueError('Target speed and acceleration values must be greater than zero.')
|
|
719
|
-
|
|
720
|
-
request = dto.PvtGenerateVelocitiesAndTimesRequest(
|
|
721
|
-
positions=positions,
|
|
722
|
-
target_speed=target_speed,
|
|
723
|
-
target_acceleration=target_acceleration,
|
|
724
|
-
resample_number=resample_number,
|
|
725
|
-
)
|
|
726
|
-
response = call(
|
|
727
|
-
"device/pvt_generate_velocities_and_times",
|
|
728
|
-
request,
|
|
729
|
-
PvtSequenceData.from_binary)
|
|
730
|
-
return response
|
|
731
|
-
|
|
732
|
-
@staticmethod
|
|
733
|
-
async def generate_velocities_and_times_async(
|
|
734
|
-
positions: List[MeasurementSequence],
|
|
735
|
-
target_speed: Measurement,
|
|
736
|
-
target_acceleration: Measurement,
|
|
737
|
-
resample_number: Optional[int] = None
|
|
738
|
-
) -> PvtSequenceData:
|
|
739
|
-
"""
|
|
740
|
-
Generates sequences of velocities and times for a sequence of positions.
|
|
741
|
-
This function fits a geometric spline (not-a-knot cubic for sequences of >3 points,
|
|
742
|
-
natural cubic for 3, and a straight line for 2) over the position sequence
|
|
743
|
-
and then calculates the velocity and time information by traversing it using a
|
|
744
|
-
trapezoidal motion profile.
|
|
745
|
-
|
|
746
|
-
This generation scheme attempts to keep speed and acceleration less than the
|
|
747
|
-
specified target values, but does not guarantee it. Generally speaking, a higher
|
|
748
|
-
resample number will bring the generated trajectory closer to respecting these
|
|
749
|
-
limits.
|
|
750
|
-
|
|
751
|
-
Note that consecutive duplicate points will be automatically removed as they
|
|
752
|
-
have no geometric significance without additional time information. Also note that
|
|
753
|
-
for multi-dimensional paths this function expects axes to be linear and orthogonal,
|
|
754
|
-
however for paths of a single dimension rotary units are accepted.
|
|
755
|
-
|
|
756
|
-
Does not support native units.
|
|
757
|
-
|
|
758
|
-
Args:
|
|
759
|
-
positions: Positions for the axes to move through, relative to their home positions.
|
|
760
|
-
target_speed: The target speed used to generate positions and times.
|
|
761
|
-
target_acceleration: The target acceleration used to generate positions and times.
|
|
762
|
-
resample_number: The number of points to resample the sequence by.
|
|
763
|
-
Leave undefined to use the specified points.
|
|
764
|
-
|
|
765
|
-
Returns:
|
|
766
|
-
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
767
|
-
"""
|
|
768
|
-
if target_speed.value <= 0 or target_acceleration.value <= 0:
|
|
769
|
-
raise ValueError('Target speed and acceleration values must be greater than zero.')
|
|
770
|
-
|
|
771
|
-
request = dto.PvtGenerateVelocitiesAndTimesRequest(
|
|
772
|
-
positions=positions,
|
|
773
|
-
target_speed=target_speed,
|
|
774
|
-
target_acceleration=target_acceleration,
|
|
775
|
-
resample_number=resample_number,
|
|
776
|
-
)
|
|
777
|
-
response = await call_async(
|
|
778
|
-
"device/pvt_generate_velocities_and_times",
|
|
779
|
-
request,
|
|
780
|
-
PvtSequenceData.from_binary)
|
|
781
|
-
return response
|
|
782
|
-
|
|
783
|
-
def wait_until_idle(
|
|
784
|
-
self,
|
|
785
|
-
throw_error_on_fault: bool = True
|
|
786
|
-
) -> None:
|
|
787
|
-
"""
|
|
788
|
-
Waits until the live PVT sequence executes all queued actions.
|
|
789
|
-
|
|
790
|
-
Args:
|
|
791
|
-
throw_error_on_fault: Determines whether to throw error when fault is observed.
|
|
792
|
-
"""
|
|
793
|
-
request = dto.StreamWaitUntilIdleRequest(
|
|
794
|
-
interface_id=self.device.connection.interface_id,
|
|
795
|
-
device=self.device.device_address,
|
|
796
|
-
stream_id=self.pvt_id,
|
|
797
|
-
pvt=True,
|
|
798
|
-
throw_error_on_fault=throw_error_on_fault,
|
|
799
|
-
)
|
|
800
|
-
call("device/stream_wait_until_idle", request)
|
|
801
|
-
|
|
802
|
-
async def wait_until_idle_async(
|
|
803
|
-
self,
|
|
804
|
-
throw_error_on_fault: bool = True
|
|
805
|
-
) -> None:
|
|
806
|
-
"""
|
|
807
|
-
Waits until the live PVT sequence executes all queued actions.
|
|
808
|
-
|
|
809
|
-
Args:
|
|
810
|
-
throw_error_on_fault: Determines whether to throw error when fault is observed.
|
|
811
|
-
"""
|
|
812
|
-
request = dto.StreamWaitUntilIdleRequest(
|
|
813
|
-
interface_id=self.device.connection.interface_id,
|
|
814
|
-
device=self.device.device_address,
|
|
815
|
-
stream_id=self.pvt_id,
|
|
816
|
-
pvt=True,
|
|
817
|
-
throw_error_on_fault=throw_error_on_fault,
|
|
818
|
-
)
|
|
819
|
-
await call_async("device/stream_wait_until_idle", request)
|
|
820
|
-
|
|
821
|
-
def cork(
|
|
822
|
-
self
|
|
823
|
-
) -> None:
|
|
824
|
-
"""
|
|
825
|
-
Cork the front of the PVT sequences's action queue, blocking execution.
|
|
826
|
-
Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
|
|
827
|
-
Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
|
|
828
|
-
You can only cork an idle live PVT sequence.
|
|
829
|
-
"""
|
|
830
|
-
request = dto.StreamEmptyRequest(
|
|
831
|
-
interface_id=self.device.connection.interface_id,
|
|
832
|
-
device=self.device.device_address,
|
|
833
|
-
stream_id=self.pvt_id,
|
|
834
|
-
pvt=True,
|
|
835
|
-
)
|
|
836
|
-
call("device/stream_cork", request)
|
|
837
|
-
|
|
838
|
-
async def cork_async(
|
|
839
|
-
self
|
|
840
|
-
) -> None:
|
|
841
|
-
"""
|
|
842
|
-
Cork the front of the PVT sequences's action queue, blocking execution.
|
|
843
|
-
Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
|
|
844
|
-
Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
|
|
845
|
-
You can only cork an idle live PVT sequence.
|
|
846
|
-
"""
|
|
847
|
-
request = dto.StreamEmptyRequest(
|
|
848
|
-
interface_id=self.device.connection.interface_id,
|
|
849
|
-
device=self.device.device_address,
|
|
850
|
-
stream_id=self.pvt_id,
|
|
851
|
-
pvt=True,
|
|
852
|
-
)
|
|
853
|
-
await call_async("device/stream_cork", request)
|
|
854
|
-
|
|
855
|
-
def uncork(
|
|
856
|
-
self
|
|
857
|
-
) -> None:
|
|
858
|
-
"""
|
|
859
|
-
Uncork the front of the queue, unblocking command execution.
|
|
860
|
-
You can only uncork an idle live PVT sequence that is corked.
|
|
861
|
-
"""
|
|
862
|
-
request = dto.StreamEmptyRequest(
|
|
863
|
-
interface_id=self.device.connection.interface_id,
|
|
864
|
-
device=self.device.device_address,
|
|
865
|
-
stream_id=self.pvt_id,
|
|
866
|
-
pvt=True,
|
|
867
|
-
)
|
|
868
|
-
call("device/stream_uncork", request)
|
|
869
|
-
|
|
870
|
-
async def uncork_async(
|
|
871
|
-
self
|
|
872
|
-
) -> None:
|
|
873
|
-
"""
|
|
874
|
-
Uncork the front of the queue, unblocking command execution.
|
|
875
|
-
You can only uncork an idle live PVT sequence that is corked.
|
|
876
|
-
"""
|
|
877
|
-
request = dto.StreamEmptyRequest(
|
|
878
|
-
interface_id=self.device.connection.interface_id,
|
|
879
|
-
device=self.device.device_address,
|
|
880
|
-
stream_id=self.pvt_id,
|
|
881
|
-
pvt=True,
|
|
882
|
-
)
|
|
883
|
-
await call_async("device/stream_uncork", request)
|
|
884
|
-
|
|
885
|
-
def is_busy(
|
|
886
|
-
self
|
|
887
|
-
) -> bool:
|
|
888
|
-
"""
|
|
889
|
-
Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
|
|
890
|
-
|
|
891
|
-
Returns:
|
|
892
|
-
True if the PVT sequence is executing a queued action.
|
|
893
|
-
"""
|
|
894
|
-
request = dto.StreamEmptyRequest(
|
|
895
|
-
interface_id=self.device.connection.interface_id,
|
|
896
|
-
device=self.device.device_address,
|
|
897
|
-
stream_id=self.pvt_id,
|
|
898
|
-
pvt=True,
|
|
899
|
-
)
|
|
900
|
-
response = call(
|
|
901
|
-
"device/stream_is_busy",
|
|
902
|
-
request,
|
|
903
|
-
dto.BoolResponse.from_binary)
|
|
904
|
-
return response.value
|
|
905
|
-
|
|
906
|
-
async def is_busy_async(
|
|
907
|
-
self
|
|
908
|
-
) -> bool:
|
|
909
|
-
"""
|
|
910
|
-
Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
|
|
911
|
-
|
|
912
|
-
Returns:
|
|
913
|
-
True if the PVT sequence is executing a queued action.
|
|
914
|
-
"""
|
|
915
|
-
request = dto.StreamEmptyRequest(
|
|
916
|
-
interface_id=self.device.connection.interface_id,
|
|
917
|
-
device=self.device.device_address,
|
|
918
|
-
stream_id=self.pvt_id,
|
|
919
|
-
pvt=True,
|
|
920
|
-
)
|
|
921
|
-
response = await call_async(
|
|
922
|
-
"device/stream_is_busy",
|
|
923
|
-
request,
|
|
924
|
-
dto.BoolResponse.from_binary)
|
|
925
|
-
return response.value
|
|
926
|
-
|
|
927
|
-
def __repr__(
|
|
928
|
-
self
|
|
929
|
-
) -> str:
|
|
930
|
-
"""
|
|
931
|
-
Returns a string which represents the PVT sequence.
|
|
932
|
-
|
|
933
|
-
Returns:
|
|
934
|
-
String which represents the PVT sequence.
|
|
935
|
-
"""
|
|
936
|
-
request = dto.StreamEmptyRequest(
|
|
937
|
-
interface_id=self.device.connection.interface_id,
|
|
938
|
-
device=self.device.device_address,
|
|
939
|
-
stream_id=self.pvt_id,
|
|
940
|
-
pvt=True,
|
|
941
|
-
)
|
|
942
|
-
response = call_sync(
|
|
943
|
-
"device/stream_to_string",
|
|
944
|
-
request,
|
|
945
|
-
dto.StringResponse.from_binary)
|
|
946
|
-
return response.value
|
|
947
|
-
|
|
948
|
-
def disable(
|
|
949
|
-
self
|
|
950
|
-
) -> None:
|
|
951
|
-
"""
|
|
952
|
-
Disables the PVT sequence.
|
|
953
|
-
If the PVT sequence is not setup, this command does nothing.
|
|
954
|
-
Once disabled, the PVT sequence will no longer accept PVT commands.
|
|
955
|
-
The PVT sequence will process the rest of the commands in the queue until it is empty.
|
|
956
|
-
"""
|
|
957
|
-
request = dto.StreamEmptyRequest(
|
|
958
|
-
interface_id=self.device.connection.interface_id,
|
|
959
|
-
device=self.device.device_address,
|
|
960
|
-
stream_id=self.pvt_id,
|
|
961
|
-
pvt=True,
|
|
962
|
-
)
|
|
963
|
-
call("device/stream_disable", request)
|
|
964
|
-
|
|
965
|
-
async def disable_async(
|
|
966
|
-
self
|
|
967
|
-
) -> None:
|
|
968
|
-
"""
|
|
969
|
-
Disables the PVT sequence.
|
|
970
|
-
If the PVT sequence is not setup, this command does nothing.
|
|
971
|
-
Once disabled, the PVT sequence will no longer accept PVT commands.
|
|
972
|
-
The PVT sequence will process the rest of the commands in the queue until it is empty.
|
|
973
|
-
"""
|
|
974
|
-
request = dto.StreamEmptyRequest(
|
|
975
|
-
interface_id=self.device.connection.interface_id,
|
|
976
|
-
device=self.device.device_address,
|
|
977
|
-
stream_id=self.pvt_id,
|
|
978
|
-
pvt=True,
|
|
979
|
-
)
|
|
980
|
-
await call_async("device/stream_disable", request)
|
|
981
|
-
|
|
982
|
-
def generic_command(
|
|
983
|
-
self,
|
|
984
|
-
command: str
|
|
985
|
-
) -> None:
|
|
986
|
-
"""
|
|
987
|
-
Sends a generic ASCII command to the PVT sequence.
|
|
988
|
-
Keeps resending the command while the device rejects with AGAIN reason.
|
|
989
|
-
|
|
990
|
-
Args:
|
|
991
|
-
command: Command and its parameters.
|
|
992
|
-
"""
|
|
993
|
-
request = dto.StreamGenericCommandRequest(
|
|
994
|
-
interface_id=self.device.connection.interface_id,
|
|
995
|
-
device=self.device.device_address,
|
|
996
|
-
stream_id=self.pvt_id,
|
|
997
|
-
pvt=True,
|
|
998
|
-
command=command,
|
|
999
|
-
)
|
|
1000
|
-
call("device/stream_generic_command", request)
|
|
1001
|
-
|
|
1002
|
-
async def generic_command_async(
|
|
1003
|
-
self,
|
|
1004
|
-
command: str
|
|
1005
|
-
) -> None:
|
|
1006
|
-
"""
|
|
1007
|
-
Sends a generic ASCII command to the PVT sequence.
|
|
1008
|
-
Keeps resending the command while the device rejects with AGAIN reason.
|
|
1009
|
-
|
|
1010
|
-
Args:
|
|
1011
|
-
command: Command and its parameters.
|
|
1012
|
-
"""
|
|
1013
|
-
request = dto.StreamGenericCommandRequest(
|
|
1014
|
-
interface_id=self.device.connection.interface_id,
|
|
1015
|
-
device=self.device.device_address,
|
|
1016
|
-
stream_id=self.pvt_id,
|
|
1017
|
-
pvt=True,
|
|
1018
|
-
command=command,
|
|
1019
|
-
)
|
|
1020
|
-
await call_async("device/stream_generic_command", request)
|
|
1021
|
-
|
|
1022
|
-
def generic_command_batch(
|
|
1023
|
-
self,
|
|
1024
|
-
batch: List[str]
|
|
1025
|
-
) -> None:
|
|
1026
|
-
"""
|
|
1027
|
-
Sends a batch of generic ASCII commands to the PVT sequence.
|
|
1028
|
-
Keeps resending command while the device rejects with AGAIN reason.
|
|
1029
|
-
The batch is atomic in terms of thread safety.
|
|
1030
|
-
|
|
1031
|
-
Args:
|
|
1032
|
-
batch: Array of commands.
|
|
1033
|
-
"""
|
|
1034
|
-
request = dto.StreamGenericCommandBatchRequest(
|
|
1035
|
-
interface_id=self.device.connection.interface_id,
|
|
1036
|
-
device=self.device.device_address,
|
|
1037
|
-
stream_id=self.pvt_id,
|
|
1038
|
-
pvt=True,
|
|
1039
|
-
batch=batch,
|
|
1040
|
-
)
|
|
1041
|
-
call("device/stream_generic_command_batch", request)
|
|
1042
|
-
|
|
1043
|
-
async def generic_command_batch_async(
|
|
1044
|
-
self,
|
|
1045
|
-
batch: List[str]
|
|
1046
|
-
) -> None:
|
|
1047
|
-
"""
|
|
1048
|
-
Sends a batch of generic ASCII commands to the PVT sequence.
|
|
1049
|
-
Keeps resending command while the device rejects with AGAIN reason.
|
|
1050
|
-
The batch is atomic in terms of thread safety.
|
|
1051
|
-
|
|
1052
|
-
Args:
|
|
1053
|
-
batch: Array of commands.
|
|
1054
|
-
"""
|
|
1055
|
-
request = dto.StreamGenericCommandBatchRequest(
|
|
1056
|
-
interface_id=self.device.connection.interface_id,
|
|
1057
|
-
device=self.device.device_address,
|
|
1058
|
-
stream_id=self.pvt_id,
|
|
1059
|
-
pvt=True,
|
|
1060
|
-
batch=batch,
|
|
1061
|
-
)
|
|
1062
|
-
await call_async("device/stream_generic_command_batch", request)
|
|
1063
|
-
|
|
1064
|
-
def check_disabled(
|
|
1065
|
-
self
|
|
1066
|
-
) -> bool:
|
|
1067
|
-
"""
|
|
1068
|
-
Queries the PVT sequence status from the device
|
|
1069
|
-
and returns boolean indicating whether the PVT sequence is disabled.
|
|
1070
|
-
Useful to determine if execution was interrupted by other movements.
|
|
1071
|
-
|
|
1072
|
-
Returns:
|
|
1073
|
-
True if the PVT sequence is disabled.
|
|
1074
|
-
"""
|
|
1075
|
-
request = dto.StreamEmptyRequest(
|
|
1076
|
-
interface_id=self.device.connection.interface_id,
|
|
1077
|
-
device=self.device.device_address,
|
|
1078
|
-
stream_id=self.pvt_id,
|
|
1079
|
-
pvt=True,
|
|
1080
|
-
)
|
|
1081
|
-
response = call(
|
|
1082
|
-
"device/stream_check_disabled",
|
|
1083
|
-
request,
|
|
1084
|
-
dto.BoolResponse.from_binary)
|
|
1085
|
-
return response.value
|
|
1086
|
-
|
|
1087
|
-
async def check_disabled_async(
|
|
1088
|
-
self
|
|
1089
|
-
) -> bool:
|
|
1090
|
-
"""
|
|
1091
|
-
Queries the PVT sequence status from the device
|
|
1092
|
-
and returns boolean indicating whether the PVT sequence is disabled.
|
|
1093
|
-
Useful to determine if execution was interrupted by other movements.
|
|
1094
|
-
|
|
1095
|
-
Returns:
|
|
1096
|
-
True if the PVT sequence is disabled.
|
|
1097
|
-
"""
|
|
1098
|
-
request = dto.StreamEmptyRequest(
|
|
1099
|
-
interface_id=self.device.connection.interface_id,
|
|
1100
|
-
device=self.device.device_address,
|
|
1101
|
-
stream_id=self.pvt_id,
|
|
1102
|
-
pvt=True,
|
|
1103
|
-
)
|
|
1104
|
-
response = await call_async(
|
|
1105
|
-
"device/stream_check_disabled",
|
|
1106
|
-
request,
|
|
1107
|
-
dto.BoolResponse.from_binary)
|
|
1108
|
-
return response.value
|
|
1109
|
-
|
|
1110
|
-
def treat_discontinuities_as_error(
|
|
1111
|
-
self
|
|
1112
|
-
) -> None:
|
|
1113
|
-
"""
|
|
1114
|
-
Makes the PVT sequence throw PvtDiscontinuityException when it encounters discontinuities (ND warning flag).
|
|
1115
|
-
"""
|
|
1116
|
-
request = dto.StreamEmptyRequest(
|
|
1117
|
-
interface_id=self.device.connection.interface_id,
|
|
1118
|
-
device=self.device.device_address,
|
|
1119
|
-
stream_id=self.pvt_id,
|
|
1120
|
-
pvt=True,
|
|
1121
|
-
)
|
|
1122
|
-
call_sync("device/stream_treat_discontinuities", request)
|
|
1123
|
-
|
|
1124
|
-
def ignore_current_discontinuity(
|
|
1125
|
-
self
|
|
1126
|
-
) -> None:
|
|
1127
|
-
"""
|
|
1128
|
-
Prevents PvtDiscontinuityException as a result of expected discontinuity when resuming the sequence.
|
|
1129
|
-
"""
|
|
1130
|
-
request = dto.StreamEmptyRequest(
|
|
1131
|
-
interface_id=self.device.connection.interface_id,
|
|
1132
|
-
device=self.device.device_address,
|
|
1133
|
-
stream_id=self.pvt_id,
|
|
1134
|
-
pvt=True,
|
|
1135
|
-
)
|
|
1136
|
-
call_sync("device/stream_ignore_discontinuity", request)
|
|
1137
|
-
|
|
1138
|
-
def __retrieve_axes(
|
|
1139
|
-
self
|
|
1140
|
-
) -> List[PvtAxisDefinition]:
|
|
1141
|
-
"""
|
|
1142
|
-
Gets the axes of the PVT sequence.
|
|
1143
|
-
|
|
1144
|
-
Returns:
|
|
1145
|
-
An array of axis numbers of the axes the PVT sequence is set up to control.
|
|
1146
|
-
"""
|
|
1147
|
-
request = dto.StreamEmptyRequest(
|
|
1148
|
-
interface_id=self.device.connection.interface_id,
|
|
1149
|
-
device=self.device.device_address,
|
|
1150
|
-
stream_id=self.pvt_id,
|
|
1151
|
-
pvt=True,
|
|
1152
|
-
)
|
|
1153
|
-
response = call_sync(
|
|
1154
|
-
"device/stream_get_axes",
|
|
1155
|
-
request,
|
|
1156
|
-
dto.StreamGetAxesResponse.from_binary)
|
|
1157
|
-
return response.pvt_axes
|
|
1158
|
-
|
|
1159
|
-
def __retrieve_mode(
|
|
1160
|
-
self
|
|
1161
|
-
) -> PvtMode:
|
|
1162
|
-
"""
|
|
1163
|
-
Get the mode of the PVT sequence.
|
|
1164
|
-
|
|
1165
|
-
Returns:
|
|
1166
|
-
Mode of the PVT sequence.
|
|
1167
|
-
"""
|
|
1168
|
-
request = dto.StreamEmptyRequest(
|
|
1169
|
-
interface_id=self.device.connection.interface_id,
|
|
1170
|
-
device=self.device.device_address,
|
|
1171
|
-
stream_id=self.pvt_id,
|
|
1172
|
-
pvt=True,
|
|
1173
|
-
)
|
|
1174
|
-
response = call_sync(
|
|
1175
|
-
"device/stream_get_mode",
|
|
1176
|
-
request,
|
|
1177
|
-
dto.StreamModeResponse.from_binary)
|
|
1178
|
-
return response.pvt_mode
|
|
1179
|
-
|
|
1180
|
-
@staticmethod
|
|
1181
|
-
def save_sequence_data(
|
|
1182
|
-
sequence_data: PvtSequenceData,
|
|
1183
|
-
path: str,
|
|
1184
|
-
dimension_names: Optional[List[str]] = None
|
|
1185
|
-
) -> None:
|
|
1186
|
-
"""
|
|
1187
|
-
Saves PvtSequenceData object as csv file.
|
|
1188
|
-
Save format is compatible with Zaber Launcher PVT Editor App.
|
|
1189
|
-
|
|
1190
|
-
Throws InvalidArgumentException if fields are undefined or inconsistent.
|
|
1191
|
-
For example, position and velocity arrays must have the same dimensions.
|
|
1192
|
-
Sequence lengths must be consistent for positions, velocities and times.
|
|
1193
|
-
|
|
1194
|
-
Args:
|
|
1195
|
-
sequence_data: The PVT sequence data to save.
|
|
1196
|
-
path: The path to save the file to.
|
|
1197
|
-
dimension_names: Optional csv column names for each series.
|
|
1198
|
-
If not provided, the default names will be used: Series 1, Series 2, etc..
|
|
1199
|
-
Length of this array must be equal to number of dimensions in sequence data.
|
|
1200
|
-
"""
|
|
1201
|
-
request = dto.PvtSaveCsvRequest(
|
|
1202
|
-
sequence_data=sequence_data,
|
|
1203
|
-
path=path,
|
|
1204
|
-
dimension_names=dimension_names,
|
|
1205
|
-
)
|
|
1206
|
-
call("device/stream_pvt_save_csv", request)
|
|
1207
|
-
|
|
1208
|
-
@staticmethod
|
|
1209
|
-
async def save_sequence_data_async(
|
|
1210
|
-
sequence_data: PvtSequenceData,
|
|
1211
|
-
path: str,
|
|
1212
|
-
dimension_names: Optional[List[str]] = None
|
|
1213
|
-
) -> None:
|
|
1214
|
-
"""
|
|
1215
|
-
Saves PvtSequenceData object as csv file.
|
|
1216
|
-
Save format is compatible with Zaber Launcher PVT Editor App.
|
|
1217
|
-
|
|
1218
|
-
Throws InvalidArgumentException if fields are undefined or inconsistent.
|
|
1219
|
-
For example, position and velocity arrays must have the same dimensions.
|
|
1220
|
-
Sequence lengths must be consistent for positions, velocities and times.
|
|
1221
|
-
|
|
1222
|
-
Args:
|
|
1223
|
-
sequence_data: The PVT sequence data to save.
|
|
1224
|
-
path: The path to save the file to.
|
|
1225
|
-
dimension_names: Optional csv column names for each series.
|
|
1226
|
-
If not provided, the default names will be used: Series 1, Series 2, etc..
|
|
1227
|
-
Length of this array must be equal to number of dimensions in sequence data.
|
|
1228
|
-
"""
|
|
1229
|
-
request = dto.PvtSaveCsvRequest(
|
|
1230
|
-
sequence_data=sequence_data,
|
|
1231
|
-
path=path,
|
|
1232
|
-
dimension_names=dimension_names,
|
|
1233
|
-
)
|
|
1234
|
-
await call_async("device/stream_pvt_save_csv", request)
|
|
1235
|
-
|
|
1236
|
-
@staticmethod
|
|
1237
|
-
def load_sequence_data(
|
|
1238
|
-
path: str
|
|
1239
|
-
) -> PvtCsvData:
|
|
1240
|
-
"""
|
|
1241
|
-
Load PVT Sequence data from CSV file.
|
|
1242
|
-
The CSV data can include a header (recommended).
|
|
1243
|
-
There are two possible header formats:
|
|
1244
|
-
|
|
1245
|
-
1. A time column with named position and velocity columns.
|
|
1246
|
-
For example, "Time (ms),X Position (cm),X Velocity (cm/s),...".
|
|
1247
|
-
In this case, position, velocity and time columns are all optional.
|
|
1248
|
-
Also, order does not matter, but position and velocity names must be consistent.
|
|
1249
|
-
This is our recommended CSV format.
|
|
1250
|
-
|
|
1251
|
-
2. A time column with alternating position and velocity columns.
|
|
1252
|
-
For example, "Time (ms),Position (cm),Velocity (cm/s),...".
|
|
1253
|
-
In this case, only the time column is optional and order does matter.
|
|
1254
|
-
|
|
1255
|
-
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1256
|
-
Additionally, native units are the default if no units are specified.
|
|
1257
|
-
Time values default to milliseconds if no units are provided.
|
|
1258
|
-
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1259
|
-
In this case the number of columns must be odd.
|
|
1260
|
-
|
|
1261
|
-
Args:
|
|
1262
|
-
path: The path to the csv file to load.
|
|
1263
|
-
|
|
1264
|
-
Returns:
|
|
1265
|
-
The PVT csv data loaded from the file.
|
|
1266
|
-
"""
|
|
1267
|
-
request = dto.PvtLoadCsvRequest(
|
|
1268
|
-
path=path,
|
|
1269
|
-
)
|
|
1270
|
-
response = call(
|
|
1271
|
-
"device/stream_pvt_load_csv",
|
|
1272
|
-
request,
|
|
1273
|
-
PvtCsvData.from_binary)
|
|
1274
|
-
return response
|
|
1275
|
-
|
|
1276
|
-
@staticmethod
|
|
1277
|
-
async def load_sequence_data_async(
|
|
1278
|
-
path: str
|
|
1279
|
-
) -> PvtCsvData:
|
|
1280
|
-
"""
|
|
1281
|
-
Load PVT Sequence data from CSV file.
|
|
1282
|
-
The CSV data can include a header (recommended).
|
|
1283
|
-
There are two possible header formats:
|
|
1284
|
-
|
|
1285
|
-
1. A time column with named position and velocity columns.
|
|
1286
|
-
For example, "Time (ms),X Position (cm),X Velocity (cm/s),...".
|
|
1287
|
-
In this case, position, velocity and time columns are all optional.
|
|
1288
|
-
Also, order does not matter, but position and velocity names must be consistent.
|
|
1289
|
-
This is our recommended CSV format.
|
|
1290
|
-
|
|
1291
|
-
2. A time column with alternating position and velocity columns.
|
|
1292
|
-
For example, "Time (ms),Position (cm),Velocity (cm/s),...".
|
|
1293
|
-
In this case, only the time column is optional and order does matter.
|
|
1294
|
-
|
|
1295
|
-
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1296
|
-
Additionally, native units are the default if no units are specified.
|
|
1297
|
-
Time values default to milliseconds if no units are provided.
|
|
1298
|
-
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1299
|
-
In this case the number of columns must be odd.
|
|
1300
|
-
|
|
1301
|
-
Args:
|
|
1302
|
-
path: The path to the csv file to load.
|
|
1303
|
-
|
|
1304
|
-
Returns:
|
|
1305
|
-
The PVT csv data loaded from the file.
|
|
1306
|
-
"""
|
|
1307
|
-
request = dto.PvtLoadCsvRequest(
|
|
1308
|
-
path=path,
|
|
1309
|
-
)
|
|
1310
|
-
response = await call_async(
|
|
1311
|
-
"device/stream_pvt_load_csv",
|
|
1312
|
-
request,
|
|
1313
|
-
PvtCsvData.from_binary)
|
|
1314
|
-
return response
|
|
1315
|
-
|
|
1316
|
-
def submit_sequence_data(
|
|
1317
|
-
self,
|
|
1318
|
-
sequence_data: PvtSequenceData
|
|
1319
|
-
) -> None:
|
|
1320
|
-
"""
|
|
1321
|
-
Writes the contents of a PvtSequenceData object to the sequence.
|
|
1322
|
-
|
|
1323
|
-
Args:
|
|
1324
|
-
sequence_data: The PVT sequence data to submit.
|
|
1325
|
-
"""
|
|
1326
|
-
request = dto.PvtSubmitSequenceDataRequest(
|
|
1327
|
-
interface_id=self.device.connection.interface_id,
|
|
1328
|
-
device=self.device.device_address,
|
|
1329
|
-
stream_id=self.pvt_id,
|
|
1330
|
-
sequence_data=sequence_data,
|
|
1331
|
-
)
|
|
1332
|
-
call("device/stream_pvt_submit_data", request)
|
|
1333
|
-
|
|
1334
|
-
async def submit_sequence_data_async(
|
|
1335
|
-
self,
|
|
1336
|
-
sequence_data: PvtSequenceData
|
|
1337
|
-
) -> None:
|
|
1338
|
-
"""
|
|
1339
|
-
Writes the contents of a PvtSequenceData object to the sequence.
|
|
1340
|
-
|
|
1341
|
-
Args:
|
|
1342
|
-
sequence_data: The PVT sequence data to submit.
|
|
1343
|
-
"""
|
|
1344
|
-
request = dto.PvtSubmitSequenceDataRequest(
|
|
1345
|
-
interface_id=self.device.connection.interface_id,
|
|
1346
|
-
device=self.device.device_address,
|
|
1347
|
-
stream_id=self.pvt_id,
|
|
1348
|
-
sequence_data=sequence_data,
|
|
1349
|
-
)
|
|
1350
|
-
await call_async("device/stream_pvt_submit_data", request)
|
|
1351
|
-
|
|
1352
|
-
def set_digital_output(
|
|
1353
|
-
self,
|
|
1354
|
-
channel_number: int,
|
|
1355
|
-
value: DigitalOutputAction
|
|
1356
|
-
) -> None:
|
|
1357
|
-
"""
|
|
1358
|
-
Deprecated: Use PvtSequence.Io.SetDigitalOutput instead.
|
|
1359
|
-
|
|
1360
|
-
Sets value for the specified digital output channel.
|
|
1361
|
-
|
|
1362
|
-
Args:
|
|
1363
|
-
channel_number: Channel number starting at 1.
|
|
1364
|
-
value: The type of action to perform on the channel.
|
|
1365
|
-
"""
|
|
1366
|
-
request = dto.StreamSetDigitalOutputRequest(
|
|
1367
|
-
interface_id=self.device.connection.interface_id,
|
|
1368
|
-
device=self.device.device_address,
|
|
1369
|
-
stream_id=self.pvt_id,
|
|
1370
|
-
pvt=True,
|
|
1371
|
-
channel_number=channel_number,
|
|
1372
|
-
value=value,
|
|
1373
|
-
)
|
|
1374
|
-
call("device/stream_set_digital_output", request)
|
|
1375
|
-
|
|
1376
|
-
async def set_digital_output_async(
|
|
1377
|
-
self,
|
|
1378
|
-
channel_number: int,
|
|
1379
|
-
value: DigitalOutputAction
|
|
1380
|
-
) -> None:
|
|
1381
|
-
"""
|
|
1382
|
-
Deprecated: Use PvtSequence.Io.SetDigitalOutput instead.
|
|
1383
|
-
|
|
1384
|
-
Sets value for the specified digital output channel.
|
|
1385
|
-
|
|
1386
|
-
Args:
|
|
1387
|
-
channel_number: Channel number starting at 1.
|
|
1388
|
-
value: The type of action to perform on the channel.
|
|
1389
|
-
"""
|
|
1390
|
-
request = dto.StreamSetDigitalOutputRequest(
|
|
1391
|
-
interface_id=self.device.connection.interface_id,
|
|
1392
|
-
device=self.device.device_address,
|
|
1393
|
-
stream_id=self.pvt_id,
|
|
1394
|
-
pvt=True,
|
|
1395
|
-
channel_number=channel_number,
|
|
1396
|
-
value=value,
|
|
1397
|
-
)
|
|
1398
|
-
await call_async("device/stream_set_digital_output", request)
|
|
1399
|
-
|
|
1400
|
-
def set_all_digital_outputs(
|
|
1401
|
-
self,
|
|
1402
|
-
values: List[DigitalOutputAction]
|
|
1403
|
-
) -> None:
|
|
1404
|
-
"""
|
|
1405
|
-
Deprecated: Use PvtSequence.Io.SetAllDigitalOutputs instead.
|
|
1406
|
-
|
|
1407
|
-
Sets values for all digital output channels.
|
|
1408
|
-
|
|
1409
|
-
Args:
|
|
1410
|
-
values: The type of action to perform on the channel.
|
|
1411
|
-
"""
|
|
1412
|
-
request = dto.StreamSetAllDigitalOutputsRequest(
|
|
1413
|
-
interface_id=self.device.connection.interface_id,
|
|
1414
|
-
device=self.device.device_address,
|
|
1415
|
-
stream_id=self.pvt_id,
|
|
1416
|
-
pvt=True,
|
|
1417
|
-
values=values,
|
|
1418
|
-
)
|
|
1419
|
-
call("device/stream_set_all_digital_outputs", request)
|
|
1420
|
-
|
|
1421
|
-
async def set_all_digital_outputs_async(
|
|
1422
|
-
self,
|
|
1423
|
-
values: List[DigitalOutputAction]
|
|
1424
|
-
) -> None:
|
|
1425
|
-
"""
|
|
1426
|
-
Deprecated: Use PvtSequence.Io.SetAllDigitalOutputs instead.
|
|
1427
|
-
|
|
1428
|
-
Sets values for all digital output channels.
|
|
1429
|
-
|
|
1430
|
-
Args:
|
|
1431
|
-
values: The type of action to perform on the channel.
|
|
1432
|
-
"""
|
|
1433
|
-
request = dto.StreamSetAllDigitalOutputsRequest(
|
|
1434
|
-
interface_id=self.device.connection.interface_id,
|
|
1435
|
-
device=self.device.device_address,
|
|
1436
|
-
stream_id=self.pvt_id,
|
|
1437
|
-
pvt=True,
|
|
1438
|
-
values=values,
|
|
1439
|
-
)
|
|
1440
|
-
await call_async("device/stream_set_all_digital_outputs", request)
|
|
1441
|
-
|
|
1442
|
-
def set_analog_output(
|
|
1443
|
-
self,
|
|
1444
|
-
channel_number: int,
|
|
1445
|
-
value: float
|
|
1446
|
-
) -> None:
|
|
1447
|
-
"""
|
|
1448
|
-
Deprecated: Use PvtSequence.Io.SetAnalogOutput instead.
|
|
1449
|
-
|
|
1450
|
-
Sets value for the specified analog output channel.
|
|
1451
|
-
|
|
1452
|
-
Args:
|
|
1453
|
-
channel_number: Channel number starting at 1.
|
|
1454
|
-
value: Value to set the output channel voltage to.
|
|
1455
|
-
"""
|
|
1456
|
-
request = dto.StreamSetAnalogOutputRequest(
|
|
1457
|
-
interface_id=self.device.connection.interface_id,
|
|
1458
|
-
device=self.device.device_address,
|
|
1459
|
-
stream_id=self.pvt_id,
|
|
1460
|
-
pvt=True,
|
|
1461
|
-
channel_number=channel_number,
|
|
1462
|
-
value=value,
|
|
1463
|
-
)
|
|
1464
|
-
call("device/stream_set_analog_output", request)
|
|
1465
|
-
|
|
1466
|
-
async def set_analog_output_async(
|
|
1467
|
-
self,
|
|
1468
|
-
channel_number: int,
|
|
1469
|
-
value: float
|
|
1470
|
-
) -> None:
|
|
1471
|
-
"""
|
|
1472
|
-
Deprecated: Use PvtSequence.Io.SetAnalogOutput instead.
|
|
1473
|
-
|
|
1474
|
-
Sets value for the specified analog output channel.
|
|
1475
|
-
|
|
1476
|
-
Args:
|
|
1477
|
-
channel_number: Channel number starting at 1.
|
|
1478
|
-
value: Value to set the output channel voltage to.
|
|
1479
|
-
"""
|
|
1480
|
-
request = dto.StreamSetAnalogOutputRequest(
|
|
1481
|
-
interface_id=self.device.connection.interface_id,
|
|
1482
|
-
device=self.device.device_address,
|
|
1483
|
-
stream_id=self.pvt_id,
|
|
1484
|
-
pvt=True,
|
|
1485
|
-
channel_number=channel_number,
|
|
1486
|
-
value=value,
|
|
1487
|
-
)
|
|
1488
|
-
await call_async("device/stream_set_analog_output", request)
|
|
1489
|
-
|
|
1490
|
-
def set_all_analog_outputs(
|
|
1491
|
-
self,
|
|
1492
|
-
values: List[float]
|
|
1493
|
-
) -> None:
|
|
1494
|
-
"""
|
|
1495
|
-
Deprecated: Use PvtSequence.Io.SetAllAnalogOutputs instead.
|
|
1496
|
-
|
|
1497
|
-
Sets values for all analog output channels.
|
|
1498
|
-
|
|
1499
|
-
Args:
|
|
1500
|
-
values: Voltage values to set the output channels to.
|
|
1501
|
-
"""
|
|
1502
|
-
request = dto.StreamSetAllAnalogOutputsRequest(
|
|
1503
|
-
interface_id=self.device.connection.interface_id,
|
|
1504
|
-
device=self.device.device_address,
|
|
1505
|
-
stream_id=self.pvt_id,
|
|
1506
|
-
pvt=True,
|
|
1507
|
-
values=values,
|
|
1508
|
-
)
|
|
1509
|
-
call("device/stream_set_all_analog_outputs", request)
|
|
1510
|
-
|
|
1511
|
-
async def set_all_analog_outputs_async(
|
|
1512
|
-
self,
|
|
1513
|
-
values: List[float]
|
|
1514
|
-
) -> None:
|
|
1515
|
-
"""
|
|
1516
|
-
Deprecated: Use PvtSequence.Io.SetAllAnalogOutputs instead.
|
|
1517
|
-
|
|
1518
|
-
Sets values for all analog output channels.
|
|
1519
|
-
|
|
1520
|
-
Args:
|
|
1521
|
-
values: Voltage values to set the output channels to.
|
|
1522
|
-
"""
|
|
1523
|
-
request = dto.StreamSetAllAnalogOutputsRequest(
|
|
1524
|
-
interface_id=self.device.connection.interface_id,
|
|
1525
|
-
device=self.device.device_address,
|
|
1526
|
-
stream_id=self.pvt_id,
|
|
1527
|
-
pvt=True,
|
|
1528
|
-
values=values,
|
|
1529
|
-
)
|
|
1530
|
-
await call_async("device/stream_set_all_analog_outputs", request)
|
|
1
|
+
# pylint: disable=too-many-arguments, too-many-lines
|
|
2
|
+
|
|
3
|
+
# ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== #
|
|
4
|
+
# ============== DO NOT EDIT DIRECTLY ============== #
|
|
5
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
6
|
+
from ..dto import requests as dto
|
|
7
|
+
from ..call import call, call_async, call_sync
|
|
8
|
+
from ..dto.measurement import Measurement
|
|
9
|
+
from .pvt_buffer import PvtBuffer
|
|
10
|
+
from ..dto.ascii.pvt_mode import PvtMode
|
|
11
|
+
from ..dto.ascii.pvt_axis_definition import PvtAxisDefinition
|
|
12
|
+
from ..dto.ascii.pvt_sequence_data import PvtSequenceData
|
|
13
|
+
from ..dto.ascii.pvt_csv_data import PvtCsvData
|
|
14
|
+
from ..dto.ascii.measurement_sequence import MeasurementSequence
|
|
15
|
+
from ..dto.ascii.optional_measurement_sequence import OptionalMeasurementSequence
|
|
16
|
+
|
|
17
|
+
from .pvt_io import PvtIo
|
|
18
|
+
from ..dto.ascii.digital_output_action import DigitalOutputAction
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from .device import Device
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class PvtSequence:
|
|
25
|
+
"""
|
|
26
|
+
A handle for a PVT sequence with this number on the device.
|
|
27
|
+
PVT sequences provide a way execute or store trajectory
|
|
28
|
+
consisting of points with defined position, velocity, and time.
|
|
29
|
+
PVT sequence methods append actions to a queue which executes
|
|
30
|
+
or stores actions in a first in, first out order.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def device(self) -> 'Device':
|
|
35
|
+
"""
|
|
36
|
+
Device that controls this PVT sequence.
|
|
37
|
+
"""
|
|
38
|
+
return self._device
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def pvt_id(self) -> int:
|
|
42
|
+
"""
|
|
43
|
+
The number that identifies the PVT sequence on the device.
|
|
44
|
+
"""
|
|
45
|
+
return self._pvt_id
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def mode(self) -> PvtMode:
|
|
49
|
+
"""
|
|
50
|
+
Current mode of the PVT sequence.
|
|
51
|
+
"""
|
|
52
|
+
return self.__retrieve_mode()
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def axes(self) -> List[PvtAxisDefinition]:
|
|
56
|
+
"""
|
|
57
|
+
An array of axes definitions the PVT sequence is set up to control.
|
|
58
|
+
"""
|
|
59
|
+
return self.__retrieve_axes()
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def io(self) -> PvtIo:
|
|
63
|
+
"""
|
|
64
|
+
Gets an object that provides access to I/O for this sequence.
|
|
65
|
+
"""
|
|
66
|
+
return self._io
|
|
67
|
+
|
|
68
|
+
def __init__(self, device: 'Device', pvt_id: int):
|
|
69
|
+
self._device: 'Device' = device
|
|
70
|
+
self._pvt_id: int = pvt_id
|
|
71
|
+
self._io: PvtIo = PvtIo(device, pvt_id)
|
|
72
|
+
|
|
73
|
+
def setup_live_composite(
|
|
74
|
+
self,
|
|
75
|
+
*pvt_axes: PvtAxisDefinition
|
|
76
|
+
) -> None:
|
|
77
|
+
"""
|
|
78
|
+
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
79
|
+
Allows use of lockstep axes in a PVT sequence.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
pvt_axes: Definition of the PVT sequence axes.
|
|
83
|
+
"""
|
|
84
|
+
request = dto.StreamSetupLiveCompositeRequest(
|
|
85
|
+
interface_id=self.device.connection.interface_id,
|
|
86
|
+
device=self.device.device_address,
|
|
87
|
+
stream_id=self.pvt_id,
|
|
88
|
+
pvt=True,
|
|
89
|
+
pvt_axes=list(pvt_axes),
|
|
90
|
+
)
|
|
91
|
+
call("device/stream_setup_live_composite", request)
|
|
92
|
+
|
|
93
|
+
async def setup_live_composite_async(
|
|
94
|
+
self,
|
|
95
|
+
*pvt_axes: PvtAxisDefinition
|
|
96
|
+
) -> None:
|
|
97
|
+
"""
|
|
98
|
+
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
99
|
+
Allows use of lockstep axes in a PVT sequence.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
pvt_axes: Definition of the PVT sequence axes.
|
|
103
|
+
"""
|
|
104
|
+
request = dto.StreamSetupLiveCompositeRequest(
|
|
105
|
+
interface_id=self.device.connection.interface_id,
|
|
106
|
+
device=self.device.device_address,
|
|
107
|
+
stream_id=self.pvt_id,
|
|
108
|
+
pvt=True,
|
|
109
|
+
pvt_axes=list(pvt_axes),
|
|
110
|
+
)
|
|
111
|
+
await call_async("device/stream_setup_live_composite", request)
|
|
112
|
+
|
|
113
|
+
def setup_live(
|
|
114
|
+
self,
|
|
115
|
+
*axes: int
|
|
116
|
+
) -> None:
|
|
117
|
+
"""
|
|
118
|
+
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
122
|
+
"""
|
|
123
|
+
request = dto.StreamSetupLiveRequest(
|
|
124
|
+
interface_id=self.device.connection.interface_id,
|
|
125
|
+
device=self.device.device_address,
|
|
126
|
+
stream_id=self.pvt_id,
|
|
127
|
+
pvt=True,
|
|
128
|
+
axes=list(axes),
|
|
129
|
+
)
|
|
130
|
+
call("device/stream_setup_live", request)
|
|
131
|
+
|
|
132
|
+
async def setup_live_async(
|
|
133
|
+
self,
|
|
134
|
+
*axes: int
|
|
135
|
+
) -> None:
|
|
136
|
+
"""
|
|
137
|
+
Setup the PVT sequence to control the specified axes and to queue actions on the device.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
141
|
+
"""
|
|
142
|
+
request = dto.StreamSetupLiveRequest(
|
|
143
|
+
interface_id=self.device.connection.interface_id,
|
|
144
|
+
device=self.device.device_address,
|
|
145
|
+
stream_id=self.pvt_id,
|
|
146
|
+
pvt=True,
|
|
147
|
+
axes=list(axes),
|
|
148
|
+
)
|
|
149
|
+
await call_async("device/stream_setup_live", request)
|
|
150
|
+
|
|
151
|
+
def setup_store_composite(
|
|
152
|
+
self,
|
|
153
|
+
pvt_buffer: PvtBuffer,
|
|
154
|
+
*pvt_axes: PvtAxisDefinition
|
|
155
|
+
) -> None:
|
|
156
|
+
"""
|
|
157
|
+
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
158
|
+
Allows use of lockstep axes in a PVT sequence.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
pvt_buffer: The PVT buffer to queue actions in.
|
|
162
|
+
pvt_axes: Definition of the PVT sequence axes.
|
|
163
|
+
"""
|
|
164
|
+
request = dto.StreamSetupStoreCompositeRequest(
|
|
165
|
+
interface_id=self.device.connection.interface_id,
|
|
166
|
+
device=self.device.device_address,
|
|
167
|
+
stream_id=self.pvt_id,
|
|
168
|
+
pvt=True,
|
|
169
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
170
|
+
pvt_axes=list(pvt_axes),
|
|
171
|
+
)
|
|
172
|
+
call("device/stream_setup_store_composite", request)
|
|
173
|
+
|
|
174
|
+
async def setup_store_composite_async(
|
|
175
|
+
self,
|
|
176
|
+
pvt_buffer: PvtBuffer,
|
|
177
|
+
*pvt_axes: PvtAxisDefinition
|
|
178
|
+
) -> None:
|
|
179
|
+
"""
|
|
180
|
+
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
181
|
+
Allows use of lockstep axes in a PVT sequence.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
pvt_buffer: The PVT buffer to queue actions in.
|
|
185
|
+
pvt_axes: Definition of the PVT sequence axes.
|
|
186
|
+
"""
|
|
187
|
+
request = dto.StreamSetupStoreCompositeRequest(
|
|
188
|
+
interface_id=self.device.connection.interface_id,
|
|
189
|
+
device=self.device.device_address,
|
|
190
|
+
stream_id=self.pvt_id,
|
|
191
|
+
pvt=True,
|
|
192
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
193
|
+
pvt_axes=list(pvt_axes),
|
|
194
|
+
)
|
|
195
|
+
await call_async("device/stream_setup_store_composite", request)
|
|
196
|
+
|
|
197
|
+
def setup_store(
|
|
198
|
+
self,
|
|
199
|
+
pvt_buffer: PvtBuffer,
|
|
200
|
+
*axes: int
|
|
201
|
+
) -> None:
|
|
202
|
+
"""
|
|
203
|
+
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
pvt_buffer: The PVT buffer to queue actions in.
|
|
207
|
+
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
208
|
+
"""
|
|
209
|
+
request = dto.StreamSetupStoreRequest(
|
|
210
|
+
interface_id=self.device.connection.interface_id,
|
|
211
|
+
device=self.device.device_address,
|
|
212
|
+
stream_id=self.pvt_id,
|
|
213
|
+
pvt=True,
|
|
214
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
215
|
+
axes=list(axes),
|
|
216
|
+
)
|
|
217
|
+
call("device/stream_setup_store", request)
|
|
218
|
+
|
|
219
|
+
async def setup_store_async(
|
|
220
|
+
self,
|
|
221
|
+
pvt_buffer: PvtBuffer,
|
|
222
|
+
*axes: int
|
|
223
|
+
) -> None:
|
|
224
|
+
"""
|
|
225
|
+
Setup the PVT sequence to use the specified axes and queue actions into a PVT buffer.
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
pvt_buffer: The PVT buffer to queue actions in.
|
|
229
|
+
axes: Numbers of physical axes to setup the PVT sequence on.
|
|
230
|
+
"""
|
|
231
|
+
request = dto.StreamSetupStoreRequest(
|
|
232
|
+
interface_id=self.device.connection.interface_id,
|
|
233
|
+
device=self.device.device_address,
|
|
234
|
+
stream_id=self.pvt_id,
|
|
235
|
+
pvt=True,
|
|
236
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
237
|
+
axes=list(axes),
|
|
238
|
+
)
|
|
239
|
+
await call_async("device/stream_setup_store", request)
|
|
240
|
+
|
|
241
|
+
def call(
|
|
242
|
+
self,
|
|
243
|
+
pvt_buffer: PvtBuffer
|
|
244
|
+
) -> None:
|
|
245
|
+
"""
|
|
246
|
+
Append the actions in a PVT buffer to the sequence's queue.
|
|
247
|
+
|
|
248
|
+
Args:
|
|
249
|
+
pvt_buffer: The PVT buffer to call.
|
|
250
|
+
"""
|
|
251
|
+
request = dto.StreamCallRequest(
|
|
252
|
+
interface_id=self.device.connection.interface_id,
|
|
253
|
+
device=self.device.device_address,
|
|
254
|
+
stream_id=self.pvt_id,
|
|
255
|
+
pvt=True,
|
|
256
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
257
|
+
)
|
|
258
|
+
call("device/stream_call", request)
|
|
259
|
+
|
|
260
|
+
async def call_async(
|
|
261
|
+
self,
|
|
262
|
+
pvt_buffer: PvtBuffer
|
|
263
|
+
) -> None:
|
|
264
|
+
"""
|
|
265
|
+
Append the actions in a PVT buffer to the sequence's queue.
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
pvt_buffer: The PVT buffer to call.
|
|
269
|
+
"""
|
|
270
|
+
request = dto.StreamCallRequest(
|
|
271
|
+
interface_id=self.device.connection.interface_id,
|
|
272
|
+
device=self.device.device_address,
|
|
273
|
+
stream_id=self.pvt_id,
|
|
274
|
+
pvt=True,
|
|
275
|
+
pvt_buffer=pvt_buffer.buffer_id,
|
|
276
|
+
)
|
|
277
|
+
await call_async("device/stream_call", request)
|
|
278
|
+
|
|
279
|
+
def point(
|
|
280
|
+
self,
|
|
281
|
+
positions: List[Measurement],
|
|
282
|
+
velocities: List[Optional[Measurement]],
|
|
283
|
+
time: Measurement
|
|
284
|
+
) -> None:
|
|
285
|
+
"""
|
|
286
|
+
Queues a point with absolute coordinates in the PVT sequence.
|
|
287
|
+
If some or all velocities are not provided, the sequence calculates the velocities
|
|
288
|
+
from surrounding points using finite difference.
|
|
289
|
+
The last point of the sequence must have defined velocity (likely zero).
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
293
|
+
velocities: The axes velocities at the given point.
|
|
294
|
+
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
295
|
+
time: The duration between the previous point in the sequence and this one.
|
|
296
|
+
"""
|
|
297
|
+
request = dto.PvtPointRequest(
|
|
298
|
+
interface_id=self.device.connection.interface_id,
|
|
299
|
+
device=self.device.device_address,
|
|
300
|
+
stream_id=self.pvt_id,
|
|
301
|
+
pvt=True,
|
|
302
|
+
type=dto.StreamSegmentType.ABS,
|
|
303
|
+
positions=positions,
|
|
304
|
+
velocities=velocities,
|
|
305
|
+
time=time,
|
|
306
|
+
)
|
|
307
|
+
call("device/stream_point", request)
|
|
308
|
+
|
|
309
|
+
async def point_async(
|
|
310
|
+
self,
|
|
311
|
+
positions: List[Measurement],
|
|
312
|
+
velocities: List[Optional[Measurement]],
|
|
313
|
+
time: Measurement
|
|
314
|
+
) -> None:
|
|
315
|
+
"""
|
|
316
|
+
Queues a point with absolute coordinates in the PVT sequence.
|
|
317
|
+
If some or all velocities are not provided, the sequence calculates the velocities
|
|
318
|
+
from surrounding points using finite difference.
|
|
319
|
+
The last point of the sequence must have defined velocity (likely zero).
|
|
320
|
+
|
|
321
|
+
Args:
|
|
322
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
323
|
+
velocities: The axes velocities at the given point.
|
|
324
|
+
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
325
|
+
time: The duration between the previous point in the sequence and this one.
|
|
326
|
+
"""
|
|
327
|
+
request = dto.PvtPointRequest(
|
|
328
|
+
interface_id=self.device.connection.interface_id,
|
|
329
|
+
device=self.device.device_address,
|
|
330
|
+
stream_id=self.pvt_id,
|
|
331
|
+
pvt=True,
|
|
332
|
+
type=dto.StreamSegmentType.ABS,
|
|
333
|
+
positions=positions,
|
|
334
|
+
velocities=velocities,
|
|
335
|
+
time=time,
|
|
336
|
+
)
|
|
337
|
+
await call_async("device/stream_point", request)
|
|
338
|
+
|
|
339
|
+
def points(
|
|
340
|
+
self,
|
|
341
|
+
positions: List[MeasurementSequence],
|
|
342
|
+
velocities: List[MeasurementSequence],
|
|
343
|
+
times: MeasurementSequence
|
|
344
|
+
) -> None:
|
|
345
|
+
"""
|
|
346
|
+
Queues points with absolute coordinates in the PVT sequence.
|
|
347
|
+
|
|
348
|
+
Args:
|
|
349
|
+
positions: Per-axis sequences of positions.
|
|
350
|
+
velocities: Per-axis sequences of velocities.
|
|
351
|
+
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
352
|
+
times: Segment times from one point to another.
|
|
353
|
+
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
354
|
+
"""
|
|
355
|
+
request = dto.PvtPointsRequest(
|
|
356
|
+
interface_id=self.device.connection.interface_id,
|
|
357
|
+
device=self.device.device_address,
|
|
358
|
+
stream_id=self.pvt_id,
|
|
359
|
+
pvt=True,
|
|
360
|
+
type=dto.StreamSegmentType.ABS,
|
|
361
|
+
positions=positions,
|
|
362
|
+
velocities=velocities,
|
|
363
|
+
times=times,
|
|
364
|
+
)
|
|
365
|
+
call("device/stream_points", request)
|
|
366
|
+
|
|
367
|
+
async def points_async(
|
|
368
|
+
self,
|
|
369
|
+
positions: List[MeasurementSequence],
|
|
370
|
+
velocities: List[MeasurementSequence],
|
|
371
|
+
times: MeasurementSequence
|
|
372
|
+
) -> None:
|
|
373
|
+
"""
|
|
374
|
+
Queues points with absolute coordinates in the PVT sequence.
|
|
375
|
+
|
|
376
|
+
Args:
|
|
377
|
+
positions: Per-axis sequences of positions.
|
|
378
|
+
velocities: Per-axis sequences of velocities.
|
|
379
|
+
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
380
|
+
times: Segment times from one point to another.
|
|
381
|
+
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
382
|
+
"""
|
|
383
|
+
request = dto.PvtPointsRequest(
|
|
384
|
+
interface_id=self.device.connection.interface_id,
|
|
385
|
+
device=self.device.device_address,
|
|
386
|
+
stream_id=self.pvt_id,
|
|
387
|
+
pvt=True,
|
|
388
|
+
type=dto.StreamSegmentType.ABS,
|
|
389
|
+
positions=positions,
|
|
390
|
+
velocities=velocities,
|
|
391
|
+
times=times,
|
|
392
|
+
)
|
|
393
|
+
await call_async("device/stream_points", request)
|
|
394
|
+
|
|
395
|
+
def point_relative(
|
|
396
|
+
self,
|
|
397
|
+
positions: List[Measurement],
|
|
398
|
+
velocities: List[Optional[Measurement]],
|
|
399
|
+
time: Measurement
|
|
400
|
+
) -> None:
|
|
401
|
+
"""
|
|
402
|
+
Queues a point with coordinates relative to the previous point in the PVT sequence.
|
|
403
|
+
If some or all velocities are not provided, the sequence calculates the velocities
|
|
404
|
+
from surrounding points using finite difference.
|
|
405
|
+
The last point of the sequence must have defined velocity (likely zero).
|
|
406
|
+
|
|
407
|
+
Args:
|
|
408
|
+
positions: Positions for the axes to move through, relative to the previous point.
|
|
409
|
+
velocities: The axes velocities at the given point.
|
|
410
|
+
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
411
|
+
time: The duration between the previous point in the sequence and this one.
|
|
412
|
+
"""
|
|
413
|
+
request = dto.PvtPointRequest(
|
|
414
|
+
interface_id=self.device.connection.interface_id,
|
|
415
|
+
device=self.device.device_address,
|
|
416
|
+
stream_id=self.pvt_id,
|
|
417
|
+
pvt=True,
|
|
418
|
+
type=dto.StreamSegmentType.REL,
|
|
419
|
+
positions=positions,
|
|
420
|
+
velocities=velocities,
|
|
421
|
+
time=time,
|
|
422
|
+
)
|
|
423
|
+
call("device/stream_point", request)
|
|
424
|
+
|
|
425
|
+
async def point_relative_async(
|
|
426
|
+
self,
|
|
427
|
+
positions: List[Measurement],
|
|
428
|
+
velocities: List[Optional[Measurement]],
|
|
429
|
+
time: Measurement
|
|
430
|
+
) -> None:
|
|
431
|
+
"""
|
|
432
|
+
Queues a point with coordinates relative to the previous point in the PVT sequence.
|
|
433
|
+
If some or all velocities are not provided, the sequence calculates the velocities
|
|
434
|
+
from surrounding points using finite difference.
|
|
435
|
+
The last point of the sequence must have defined velocity (likely zero).
|
|
436
|
+
|
|
437
|
+
Args:
|
|
438
|
+
positions: Positions for the axes to move through, relative to the previous point.
|
|
439
|
+
velocities: The axes velocities at the given point.
|
|
440
|
+
Specify an empty array or null for specific axes to make the sequence calculate the velocity.
|
|
441
|
+
time: The duration between the previous point in the sequence and this one.
|
|
442
|
+
"""
|
|
443
|
+
request = dto.PvtPointRequest(
|
|
444
|
+
interface_id=self.device.connection.interface_id,
|
|
445
|
+
device=self.device.device_address,
|
|
446
|
+
stream_id=self.pvt_id,
|
|
447
|
+
pvt=True,
|
|
448
|
+
type=dto.StreamSegmentType.REL,
|
|
449
|
+
positions=positions,
|
|
450
|
+
velocities=velocities,
|
|
451
|
+
time=time,
|
|
452
|
+
)
|
|
453
|
+
await call_async("device/stream_point", request)
|
|
454
|
+
|
|
455
|
+
def points_relative(
|
|
456
|
+
self,
|
|
457
|
+
positions: List[MeasurementSequence],
|
|
458
|
+
velocities: List[MeasurementSequence],
|
|
459
|
+
times: MeasurementSequence
|
|
460
|
+
) -> None:
|
|
461
|
+
"""
|
|
462
|
+
Queues points with coordinates relative to the previous point in the PVT sequence.
|
|
463
|
+
|
|
464
|
+
Args:
|
|
465
|
+
positions: Per-axis sequences of positions.
|
|
466
|
+
velocities: Per-axis sequences of velocities.
|
|
467
|
+
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
468
|
+
times: Segment times from one point to another.
|
|
469
|
+
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
470
|
+
"""
|
|
471
|
+
request = dto.PvtPointsRequest(
|
|
472
|
+
interface_id=self.device.connection.interface_id,
|
|
473
|
+
device=self.device.device_address,
|
|
474
|
+
stream_id=self.pvt_id,
|
|
475
|
+
pvt=True,
|
|
476
|
+
type=dto.StreamSegmentType.REL,
|
|
477
|
+
positions=positions,
|
|
478
|
+
velocities=velocities,
|
|
479
|
+
times=times,
|
|
480
|
+
)
|
|
481
|
+
call("device/stream_points", request)
|
|
482
|
+
|
|
483
|
+
async def points_relative_async(
|
|
484
|
+
self,
|
|
485
|
+
positions: List[MeasurementSequence],
|
|
486
|
+
velocities: List[MeasurementSequence],
|
|
487
|
+
times: MeasurementSequence
|
|
488
|
+
) -> None:
|
|
489
|
+
"""
|
|
490
|
+
Queues points with coordinates relative to the previous point in the PVT sequence.
|
|
491
|
+
|
|
492
|
+
Args:
|
|
493
|
+
positions: Per-axis sequences of positions.
|
|
494
|
+
velocities: Per-axis sequences of velocities.
|
|
495
|
+
For velocities [v0, v1, ...] and positions [p0, p1, ...], v1 is the target velocity at point p1.
|
|
496
|
+
times: Segment times from one point to another.
|
|
497
|
+
For times [t0, t1, ...] and positions [p0, p1, ...], t1 is the time it takes to move from p0 to p1.
|
|
498
|
+
"""
|
|
499
|
+
request = dto.PvtPointsRequest(
|
|
500
|
+
interface_id=self.device.connection.interface_id,
|
|
501
|
+
device=self.device.device_address,
|
|
502
|
+
stream_id=self.pvt_id,
|
|
503
|
+
pvt=True,
|
|
504
|
+
type=dto.StreamSegmentType.REL,
|
|
505
|
+
positions=positions,
|
|
506
|
+
velocities=velocities,
|
|
507
|
+
times=times,
|
|
508
|
+
)
|
|
509
|
+
await call_async("device/stream_points", request)
|
|
510
|
+
|
|
511
|
+
@staticmethod
|
|
512
|
+
def generate_velocities(
|
|
513
|
+
positions: List[MeasurementSequence],
|
|
514
|
+
times: MeasurementSequence,
|
|
515
|
+
velocities: Optional[List[OptionalMeasurementSequence]] = None,
|
|
516
|
+
times_relative: bool = True
|
|
517
|
+
) -> PvtSequenceData:
|
|
518
|
+
"""
|
|
519
|
+
Generates velocities for a sequence of positions and times, and (optionally) a partially defined sequence
|
|
520
|
+
of velocities. Note that if some velocities are defined, the solver will NOT modify them in any way.
|
|
521
|
+
If all velocities are defined, the solver will simply return the same velocities.
|
|
522
|
+
This function calculates velocities by enforcing that acceleration be continuous at each segment transition.
|
|
523
|
+
|
|
524
|
+
Also note that if generating a path for multiple axes, the user must provide a position measurement sequence
|
|
525
|
+
per axis, And the values arrays for each sequence must be equal in length to each other and also to the
|
|
526
|
+
times sequence.
|
|
527
|
+
|
|
528
|
+
Does not support native units.
|
|
529
|
+
|
|
530
|
+
Args:
|
|
531
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
532
|
+
Each MeasurementSequence represents a sequence of positions along a particular dimension.
|
|
533
|
+
For example, a 2D path sequence would contain two MeasurementSequence objects,
|
|
534
|
+
one representing positions along X and one for those along Y.
|
|
535
|
+
times: The relative or absolute time of each position in the PVT sequence.
|
|
536
|
+
velocities: Optional velocities corresponding to each point in the position sequences.
|
|
537
|
+
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
538
|
+
they are interpreted as absolute. Note that the values of the returned time
|
|
539
|
+
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
540
|
+
points to have relative times.
|
|
541
|
+
|
|
542
|
+
Returns:
|
|
543
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
544
|
+
"""
|
|
545
|
+
request = dto.PvtGenerateVelocitiesRequest(
|
|
546
|
+
positions=positions,
|
|
547
|
+
times=times,
|
|
548
|
+
velocities=velocities,
|
|
549
|
+
times_relative=times_relative,
|
|
550
|
+
)
|
|
551
|
+
response = call(
|
|
552
|
+
"device/pvt_generate_velocities",
|
|
553
|
+
request,
|
|
554
|
+
PvtSequenceData.from_binary)
|
|
555
|
+
return response
|
|
556
|
+
|
|
557
|
+
@staticmethod
|
|
558
|
+
async def generate_velocities_async(
|
|
559
|
+
positions: List[MeasurementSequence],
|
|
560
|
+
times: MeasurementSequence,
|
|
561
|
+
velocities: Optional[List[OptionalMeasurementSequence]] = None,
|
|
562
|
+
times_relative: bool = True
|
|
563
|
+
) -> PvtSequenceData:
|
|
564
|
+
"""
|
|
565
|
+
Generates velocities for a sequence of positions and times, and (optionally) a partially defined sequence
|
|
566
|
+
of velocities. Note that if some velocities are defined, the solver will NOT modify them in any way.
|
|
567
|
+
If all velocities are defined, the solver will simply return the same velocities.
|
|
568
|
+
This function calculates velocities by enforcing that acceleration be continuous at each segment transition.
|
|
569
|
+
|
|
570
|
+
Also note that if generating a path for multiple axes, the user must provide a position measurement sequence
|
|
571
|
+
per axis, And the values arrays for each sequence must be equal in length to each other and also to the
|
|
572
|
+
times sequence.
|
|
573
|
+
|
|
574
|
+
Does not support native units.
|
|
575
|
+
|
|
576
|
+
Args:
|
|
577
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
578
|
+
Each MeasurementSequence represents a sequence of positions along a particular dimension.
|
|
579
|
+
For example, a 2D path sequence would contain two MeasurementSequence objects,
|
|
580
|
+
one representing positions along X and one for those along Y.
|
|
581
|
+
times: The relative or absolute time of each position in the PVT sequence.
|
|
582
|
+
velocities: Optional velocities corresponding to each point in the position sequences.
|
|
583
|
+
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
584
|
+
they are interpreted as absolute. Note that the values of the returned time
|
|
585
|
+
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
586
|
+
points to have relative times.
|
|
587
|
+
|
|
588
|
+
Returns:
|
|
589
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
590
|
+
"""
|
|
591
|
+
request = dto.PvtGenerateVelocitiesRequest(
|
|
592
|
+
positions=positions,
|
|
593
|
+
times=times,
|
|
594
|
+
velocities=velocities,
|
|
595
|
+
times_relative=times_relative,
|
|
596
|
+
)
|
|
597
|
+
response = await call_async(
|
|
598
|
+
"device/pvt_generate_velocities",
|
|
599
|
+
request,
|
|
600
|
+
PvtSequenceData.from_binary)
|
|
601
|
+
return response
|
|
602
|
+
|
|
603
|
+
@staticmethod
|
|
604
|
+
def generate_positions(
|
|
605
|
+
velocities: List[MeasurementSequence],
|
|
606
|
+
times: MeasurementSequence,
|
|
607
|
+
times_relative: bool = True
|
|
608
|
+
) -> PvtSequenceData:
|
|
609
|
+
"""
|
|
610
|
+
Generates positions for a sequence of velocities and times. This function calculates
|
|
611
|
+
positions by enforcing that acceleration be continuous at each segment transition.
|
|
612
|
+
|
|
613
|
+
Note that if generating a path for multiple axes, the user must provide a
|
|
614
|
+
velocity measurement sequence per axis, and the values arrays for each sequence
|
|
615
|
+
must be equal in length to each other and also to the times sequence.
|
|
616
|
+
|
|
617
|
+
Does not support native units.
|
|
618
|
+
|
|
619
|
+
Args:
|
|
620
|
+
velocities: The sequence of velocities for each axis.
|
|
621
|
+
Each MeasurementSequence represents a sequence of velocities along particular dimension.
|
|
622
|
+
times: The relative or absolute time of each position in the PVT sequence.
|
|
623
|
+
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
624
|
+
they are interpreted as absolute. Note that the values of the returned time
|
|
625
|
+
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
626
|
+
points to have relative times.
|
|
627
|
+
|
|
628
|
+
Returns:
|
|
629
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
630
|
+
"""
|
|
631
|
+
request = dto.PvtGeneratePositionsRequest(
|
|
632
|
+
velocities=velocities,
|
|
633
|
+
times=times,
|
|
634
|
+
times_relative=times_relative,
|
|
635
|
+
)
|
|
636
|
+
response = call(
|
|
637
|
+
"device/pvt_generate_positions",
|
|
638
|
+
request,
|
|
639
|
+
PvtSequenceData.from_binary)
|
|
640
|
+
return response
|
|
641
|
+
|
|
642
|
+
@staticmethod
|
|
643
|
+
async def generate_positions_async(
|
|
644
|
+
velocities: List[MeasurementSequence],
|
|
645
|
+
times: MeasurementSequence,
|
|
646
|
+
times_relative: bool = True
|
|
647
|
+
) -> PvtSequenceData:
|
|
648
|
+
"""
|
|
649
|
+
Generates positions for a sequence of velocities and times. This function calculates
|
|
650
|
+
positions by enforcing that acceleration be continuous at each segment transition.
|
|
651
|
+
|
|
652
|
+
Note that if generating a path for multiple axes, the user must provide a
|
|
653
|
+
velocity measurement sequence per axis, and the values arrays for each sequence
|
|
654
|
+
must be equal in length to each other and also to the times sequence.
|
|
655
|
+
|
|
656
|
+
Does not support native units.
|
|
657
|
+
|
|
658
|
+
Args:
|
|
659
|
+
velocities: The sequence of velocities for each axis.
|
|
660
|
+
Each MeasurementSequence represents a sequence of velocities along particular dimension.
|
|
661
|
+
times: The relative or absolute time of each position in the PVT sequence.
|
|
662
|
+
times_relative: If true, the times sequence values are interpreted as relative. Otherwise,
|
|
663
|
+
they are interpreted as absolute. Note that the values of the returned time
|
|
664
|
+
sequence are ALWAYS relative. This is because the PVT sequence API expects
|
|
665
|
+
points to have relative times.
|
|
666
|
+
|
|
667
|
+
Returns:
|
|
668
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
669
|
+
"""
|
|
670
|
+
request = dto.PvtGeneratePositionsRequest(
|
|
671
|
+
velocities=velocities,
|
|
672
|
+
times=times,
|
|
673
|
+
times_relative=times_relative,
|
|
674
|
+
)
|
|
675
|
+
response = await call_async(
|
|
676
|
+
"device/pvt_generate_positions",
|
|
677
|
+
request,
|
|
678
|
+
PvtSequenceData.from_binary)
|
|
679
|
+
return response
|
|
680
|
+
|
|
681
|
+
@staticmethod
|
|
682
|
+
def generate_velocities_and_times(
|
|
683
|
+
positions: List[MeasurementSequence],
|
|
684
|
+
target_speed: Measurement,
|
|
685
|
+
target_acceleration: Measurement,
|
|
686
|
+
resample_number: Optional[int] = None
|
|
687
|
+
) -> PvtSequenceData:
|
|
688
|
+
"""
|
|
689
|
+
Generates sequences of velocities and times for a sequence of positions.
|
|
690
|
+
This function fits a geometric spline (not-a-knot cubic for sequences of >3 points,
|
|
691
|
+
natural cubic for 3, and a straight line for 2) over the position sequence
|
|
692
|
+
and then calculates the velocity and time information by traversing it using a
|
|
693
|
+
trapezoidal motion profile.
|
|
694
|
+
|
|
695
|
+
This generation scheme attempts to keep speed and acceleration less than the
|
|
696
|
+
specified target values, but does not guarantee it. Generally speaking, a higher
|
|
697
|
+
resample number will bring the generated trajectory closer to respecting these
|
|
698
|
+
limits.
|
|
699
|
+
|
|
700
|
+
Note that consecutive duplicate points will be automatically removed as they
|
|
701
|
+
have no geometric significance without additional time information. Also note that
|
|
702
|
+
for multi-dimensional paths this function expects axes to be linear and orthogonal,
|
|
703
|
+
however for paths of a single dimension rotary units are accepted.
|
|
704
|
+
|
|
705
|
+
Does not support native units.
|
|
706
|
+
|
|
707
|
+
Args:
|
|
708
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
709
|
+
target_speed: The target speed used to generate positions and times.
|
|
710
|
+
target_acceleration: The target acceleration used to generate positions and times.
|
|
711
|
+
resample_number: The number of points to resample the sequence by.
|
|
712
|
+
Leave undefined to use the specified points.
|
|
713
|
+
|
|
714
|
+
Returns:
|
|
715
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
716
|
+
"""
|
|
717
|
+
if target_speed.value <= 0 or target_acceleration.value <= 0:
|
|
718
|
+
raise ValueError('Target speed and acceleration values must be greater than zero.')
|
|
719
|
+
|
|
720
|
+
request = dto.PvtGenerateVelocitiesAndTimesRequest(
|
|
721
|
+
positions=positions,
|
|
722
|
+
target_speed=target_speed,
|
|
723
|
+
target_acceleration=target_acceleration,
|
|
724
|
+
resample_number=resample_number,
|
|
725
|
+
)
|
|
726
|
+
response = call(
|
|
727
|
+
"device/pvt_generate_velocities_and_times",
|
|
728
|
+
request,
|
|
729
|
+
PvtSequenceData.from_binary)
|
|
730
|
+
return response
|
|
731
|
+
|
|
732
|
+
@staticmethod
|
|
733
|
+
async def generate_velocities_and_times_async(
|
|
734
|
+
positions: List[MeasurementSequence],
|
|
735
|
+
target_speed: Measurement,
|
|
736
|
+
target_acceleration: Measurement,
|
|
737
|
+
resample_number: Optional[int] = None
|
|
738
|
+
) -> PvtSequenceData:
|
|
739
|
+
"""
|
|
740
|
+
Generates sequences of velocities and times for a sequence of positions.
|
|
741
|
+
This function fits a geometric spline (not-a-knot cubic for sequences of >3 points,
|
|
742
|
+
natural cubic for 3, and a straight line for 2) over the position sequence
|
|
743
|
+
and then calculates the velocity and time information by traversing it using a
|
|
744
|
+
trapezoidal motion profile.
|
|
745
|
+
|
|
746
|
+
This generation scheme attempts to keep speed and acceleration less than the
|
|
747
|
+
specified target values, but does not guarantee it. Generally speaking, a higher
|
|
748
|
+
resample number will bring the generated trajectory closer to respecting these
|
|
749
|
+
limits.
|
|
750
|
+
|
|
751
|
+
Note that consecutive duplicate points will be automatically removed as they
|
|
752
|
+
have no geometric significance without additional time information. Also note that
|
|
753
|
+
for multi-dimensional paths this function expects axes to be linear and orthogonal,
|
|
754
|
+
however for paths of a single dimension rotary units are accepted.
|
|
755
|
+
|
|
756
|
+
Does not support native units.
|
|
757
|
+
|
|
758
|
+
Args:
|
|
759
|
+
positions: Positions for the axes to move through, relative to their home positions.
|
|
760
|
+
target_speed: The target speed used to generate positions and times.
|
|
761
|
+
target_acceleration: The target acceleration used to generate positions and times.
|
|
762
|
+
resample_number: The number of points to resample the sequence by.
|
|
763
|
+
Leave undefined to use the specified points.
|
|
764
|
+
|
|
765
|
+
Returns:
|
|
766
|
+
Object containing the generated PVT sequence. Note that returned time sequence is always relative.
|
|
767
|
+
"""
|
|
768
|
+
if target_speed.value <= 0 or target_acceleration.value <= 0:
|
|
769
|
+
raise ValueError('Target speed and acceleration values must be greater than zero.')
|
|
770
|
+
|
|
771
|
+
request = dto.PvtGenerateVelocitiesAndTimesRequest(
|
|
772
|
+
positions=positions,
|
|
773
|
+
target_speed=target_speed,
|
|
774
|
+
target_acceleration=target_acceleration,
|
|
775
|
+
resample_number=resample_number,
|
|
776
|
+
)
|
|
777
|
+
response = await call_async(
|
|
778
|
+
"device/pvt_generate_velocities_and_times",
|
|
779
|
+
request,
|
|
780
|
+
PvtSequenceData.from_binary)
|
|
781
|
+
return response
|
|
782
|
+
|
|
783
|
+
def wait_until_idle(
|
|
784
|
+
self,
|
|
785
|
+
throw_error_on_fault: bool = True
|
|
786
|
+
) -> None:
|
|
787
|
+
"""
|
|
788
|
+
Waits until the live PVT sequence executes all queued actions.
|
|
789
|
+
|
|
790
|
+
Args:
|
|
791
|
+
throw_error_on_fault: Determines whether to throw error when fault is observed.
|
|
792
|
+
"""
|
|
793
|
+
request = dto.StreamWaitUntilIdleRequest(
|
|
794
|
+
interface_id=self.device.connection.interface_id,
|
|
795
|
+
device=self.device.device_address,
|
|
796
|
+
stream_id=self.pvt_id,
|
|
797
|
+
pvt=True,
|
|
798
|
+
throw_error_on_fault=throw_error_on_fault,
|
|
799
|
+
)
|
|
800
|
+
call("device/stream_wait_until_idle", request)
|
|
801
|
+
|
|
802
|
+
async def wait_until_idle_async(
|
|
803
|
+
self,
|
|
804
|
+
throw_error_on_fault: bool = True
|
|
805
|
+
) -> None:
|
|
806
|
+
"""
|
|
807
|
+
Waits until the live PVT sequence executes all queued actions.
|
|
808
|
+
|
|
809
|
+
Args:
|
|
810
|
+
throw_error_on_fault: Determines whether to throw error when fault is observed.
|
|
811
|
+
"""
|
|
812
|
+
request = dto.StreamWaitUntilIdleRequest(
|
|
813
|
+
interface_id=self.device.connection.interface_id,
|
|
814
|
+
device=self.device.device_address,
|
|
815
|
+
stream_id=self.pvt_id,
|
|
816
|
+
pvt=True,
|
|
817
|
+
throw_error_on_fault=throw_error_on_fault,
|
|
818
|
+
)
|
|
819
|
+
await call_async("device/stream_wait_until_idle", request)
|
|
820
|
+
|
|
821
|
+
def cork(
|
|
822
|
+
self
|
|
823
|
+
) -> None:
|
|
824
|
+
"""
|
|
825
|
+
Cork the front of the PVT sequences's action queue, blocking execution.
|
|
826
|
+
Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
|
|
827
|
+
Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
|
|
828
|
+
You can only cork an idle live PVT sequence.
|
|
829
|
+
"""
|
|
830
|
+
request = dto.StreamEmptyRequest(
|
|
831
|
+
interface_id=self.device.connection.interface_id,
|
|
832
|
+
device=self.device.device_address,
|
|
833
|
+
stream_id=self.pvt_id,
|
|
834
|
+
pvt=True,
|
|
835
|
+
)
|
|
836
|
+
call("device/stream_cork", request)
|
|
837
|
+
|
|
838
|
+
async def cork_async(
|
|
839
|
+
self
|
|
840
|
+
) -> None:
|
|
841
|
+
"""
|
|
842
|
+
Cork the front of the PVT sequences's action queue, blocking execution.
|
|
843
|
+
Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit.
|
|
844
|
+
Corking eliminates discontinuities in motion due to subsequent PVT commands reaching the device late.
|
|
845
|
+
You can only cork an idle live PVT sequence.
|
|
846
|
+
"""
|
|
847
|
+
request = dto.StreamEmptyRequest(
|
|
848
|
+
interface_id=self.device.connection.interface_id,
|
|
849
|
+
device=self.device.device_address,
|
|
850
|
+
stream_id=self.pvt_id,
|
|
851
|
+
pvt=True,
|
|
852
|
+
)
|
|
853
|
+
await call_async("device/stream_cork", request)
|
|
854
|
+
|
|
855
|
+
def uncork(
|
|
856
|
+
self
|
|
857
|
+
) -> None:
|
|
858
|
+
"""
|
|
859
|
+
Uncork the front of the queue, unblocking command execution.
|
|
860
|
+
You can only uncork an idle live PVT sequence that is corked.
|
|
861
|
+
"""
|
|
862
|
+
request = dto.StreamEmptyRequest(
|
|
863
|
+
interface_id=self.device.connection.interface_id,
|
|
864
|
+
device=self.device.device_address,
|
|
865
|
+
stream_id=self.pvt_id,
|
|
866
|
+
pvt=True,
|
|
867
|
+
)
|
|
868
|
+
call("device/stream_uncork", request)
|
|
869
|
+
|
|
870
|
+
async def uncork_async(
|
|
871
|
+
self
|
|
872
|
+
) -> None:
|
|
873
|
+
"""
|
|
874
|
+
Uncork the front of the queue, unblocking command execution.
|
|
875
|
+
You can only uncork an idle live PVT sequence that is corked.
|
|
876
|
+
"""
|
|
877
|
+
request = dto.StreamEmptyRequest(
|
|
878
|
+
interface_id=self.device.connection.interface_id,
|
|
879
|
+
device=self.device.device_address,
|
|
880
|
+
stream_id=self.pvt_id,
|
|
881
|
+
pvt=True,
|
|
882
|
+
)
|
|
883
|
+
await call_async("device/stream_uncork", request)
|
|
884
|
+
|
|
885
|
+
def is_busy(
|
|
886
|
+
self
|
|
887
|
+
) -> bool:
|
|
888
|
+
"""
|
|
889
|
+
Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
|
|
890
|
+
|
|
891
|
+
Returns:
|
|
892
|
+
True if the PVT sequence is executing a queued action.
|
|
893
|
+
"""
|
|
894
|
+
request = dto.StreamEmptyRequest(
|
|
895
|
+
interface_id=self.device.connection.interface_id,
|
|
896
|
+
device=self.device.device_address,
|
|
897
|
+
stream_id=self.pvt_id,
|
|
898
|
+
pvt=True,
|
|
899
|
+
)
|
|
900
|
+
response = call(
|
|
901
|
+
"device/stream_is_busy",
|
|
902
|
+
request,
|
|
903
|
+
dto.BoolResponse.from_binary)
|
|
904
|
+
return response.value
|
|
905
|
+
|
|
906
|
+
async def is_busy_async(
|
|
907
|
+
self
|
|
908
|
+
) -> bool:
|
|
909
|
+
"""
|
|
910
|
+
Returns a boolean value indicating whether the live PVT sequence is executing a queued action.
|
|
911
|
+
|
|
912
|
+
Returns:
|
|
913
|
+
True if the PVT sequence is executing a queued action.
|
|
914
|
+
"""
|
|
915
|
+
request = dto.StreamEmptyRequest(
|
|
916
|
+
interface_id=self.device.connection.interface_id,
|
|
917
|
+
device=self.device.device_address,
|
|
918
|
+
stream_id=self.pvt_id,
|
|
919
|
+
pvt=True,
|
|
920
|
+
)
|
|
921
|
+
response = await call_async(
|
|
922
|
+
"device/stream_is_busy",
|
|
923
|
+
request,
|
|
924
|
+
dto.BoolResponse.from_binary)
|
|
925
|
+
return response.value
|
|
926
|
+
|
|
927
|
+
def __repr__(
|
|
928
|
+
self
|
|
929
|
+
) -> str:
|
|
930
|
+
"""
|
|
931
|
+
Returns a string which represents the PVT sequence.
|
|
932
|
+
|
|
933
|
+
Returns:
|
|
934
|
+
String which represents the PVT sequence.
|
|
935
|
+
"""
|
|
936
|
+
request = dto.StreamEmptyRequest(
|
|
937
|
+
interface_id=self.device.connection.interface_id,
|
|
938
|
+
device=self.device.device_address,
|
|
939
|
+
stream_id=self.pvt_id,
|
|
940
|
+
pvt=True,
|
|
941
|
+
)
|
|
942
|
+
response = call_sync(
|
|
943
|
+
"device/stream_to_string",
|
|
944
|
+
request,
|
|
945
|
+
dto.StringResponse.from_binary)
|
|
946
|
+
return response.value
|
|
947
|
+
|
|
948
|
+
def disable(
|
|
949
|
+
self
|
|
950
|
+
) -> None:
|
|
951
|
+
"""
|
|
952
|
+
Disables the PVT sequence.
|
|
953
|
+
If the PVT sequence is not setup, this command does nothing.
|
|
954
|
+
Once disabled, the PVT sequence will no longer accept PVT commands.
|
|
955
|
+
The PVT sequence will process the rest of the commands in the queue until it is empty.
|
|
956
|
+
"""
|
|
957
|
+
request = dto.StreamEmptyRequest(
|
|
958
|
+
interface_id=self.device.connection.interface_id,
|
|
959
|
+
device=self.device.device_address,
|
|
960
|
+
stream_id=self.pvt_id,
|
|
961
|
+
pvt=True,
|
|
962
|
+
)
|
|
963
|
+
call("device/stream_disable", request)
|
|
964
|
+
|
|
965
|
+
async def disable_async(
|
|
966
|
+
self
|
|
967
|
+
) -> None:
|
|
968
|
+
"""
|
|
969
|
+
Disables the PVT sequence.
|
|
970
|
+
If the PVT sequence is not setup, this command does nothing.
|
|
971
|
+
Once disabled, the PVT sequence will no longer accept PVT commands.
|
|
972
|
+
The PVT sequence will process the rest of the commands in the queue until it is empty.
|
|
973
|
+
"""
|
|
974
|
+
request = dto.StreamEmptyRequest(
|
|
975
|
+
interface_id=self.device.connection.interface_id,
|
|
976
|
+
device=self.device.device_address,
|
|
977
|
+
stream_id=self.pvt_id,
|
|
978
|
+
pvt=True,
|
|
979
|
+
)
|
|
980
|
+
await call_async("device/stream_disable", request)
|
|
981
|
+
|
|
982
|
+
def generic_command(
|
|
983
|
+
self,
|
|
984
|
+
command: str
|
|
985
|
+
) -> None:
|
|
986
|
+
"""
|
|
987
|
+
Sends a generic ASCII command to the PVT sequence.
|
|
988
|
+
Keeps resending the command while the device rejects with AGAIN reason.
|
|
989
|
+
|
|
990
|
+
Args:
|
|
991
|
+
command: Command and its parameters.
|
|
992
|
+
"""
|
|
993
|
+
request = dto.StreamGenericCommandRequest(
|
|
994
|
+
interface_id=self.device.connection.interface_id,
|
|
995
|
+
device=self.device.device_address,
|
|
996
|
+
stream_id=self.pvt_id,
|
|
997
|
+
pvt=True,
|
|
998
|
+
command=command,
|
|
999
|
+
)
|
|
1000
|
+
call("device/stream_generic_command", request)
|
|
1001
|
+
|
|
1002
|
+
async def generic_command_async(
|
|
1003
|
+
self,
|
|
1004
|
+
command: str
|
|
1005
|
+
) -> None:
|
|
1006
|
+
"""
|
|
1007
|
+
Sends a generic ASCII command to the PVT sequence.
|
|
1008
|
+
Keeps resending the command while the device rejects with AGAIN reason.
|
|
1009
|
+
|
|
1010
|
+
Args:
|
|
1011
|
+
command: Command and its parameters.
|
|
1012
|
+
"""
|
|
1013
|
+
request = dto.StreamGenericCommandRequest(
|
|
1014
|
+
interface_id=self.device.connection.interface_id,
|
|
1015
|
+
device=self.device.device_address,
|
|
1016
|
+
stream_id=self.pvt_id,
|
|
1017
|
+
pvt=True,
|
|
1018
|
+
command=command,
|
|
1019
|
+
)
|
|
1020
|
+
await call_async("device/stream_generic_command", request)
|
|
1021
|
+
|
|
1022
|
+
def generic_command_batch(
|
|
1023
|
+
self,
|
|
1024
|
+
batch: List[str]
|
|
1025
|
+
) -> None:
|
|
1026
|
+
"""
|
|
1027
|
+
Sends a batch of generic ASCII commands to the PVT sequence.
|
|
1028
|
+
Keeps resending command while the device rejects with AGAIN reason.
|
|
1029
|
+
The batch is atomic in terms of thread safety.
|
|
1030
|
+
|
|
1031
|
+
Args:
|
|
1032
|
+
batch: Array of commands.
|
|
1033
|
+
"""
|
|
1034
|
+
request = dto.StreamGenericCommandBatchRequest(
|
|
1035
|
+
interface_id=self.device.connection.interface_id,
|
|
1036
|
+
device=self.device.device_address,
|
|
1037
|
+
stream_id=self.pvt_id,
|
|
1038
|
+
pvt=True,
|
|
1039
|
+
batch=batch,
|
|
1040
|
+
)
|
|
1041
|
+
call("device/stream_generic_command_batch", request)
|
|
1042
|
+
|
|
1043
|
+
async def generic_command_batch_async(
|
|
1044
|
+
self,
|
|
1045
|
+
batch: List[str]
|
|
1046
|
+
) -> None:
|
|
1047
|
+
"""
|
|
1048
|
+
Sends a batch of generic ASCII commands to the PVT sequence.
|
|
1049
|
+
Keeps resending command while the device rejects with AGAIN reason.
|
|
1050
|
+
The batch is atomic in terms of thread safety.
|
|
1051
|
+
|
|
1052
|
+
Args:
|
|
1053
|
+
batch: Array of commands.
|
|
1054
|
+
"""
|
|
1055
|
+
request = dto.StreamGenericCommandBatchRequest(
|
|
1056
|
+
interface_id=self.device.connection.interface_id,
|
|
1057
|
+
device=self.device.device_address,
|
|
1058
|
+
stream_id=self.pvt_id,
|
|
1059
|
+
pvt=True,
|
|
1060
|
+
batch=batch,
|
|
1061
|
+
)
|
|
1062
|
+
await call_async("device/stream_generic_command_batch", request)
|
|
1063
|
+
|
|
1064
|
+
def check_disabled(
|
|
1065
|
+
self
|
|
1066
|
+
) -> bool:
|
|
1067
|
+
"""
|
|
1068
|
+
Queries the PVT sequence status from the device
|
|
1069
|
+
and returns boolean indicating whether the PVT sequence is disabled.
|
|
1070
|
+
Useful to determine if execution was interrupted by other movements.
|
|
1071
|
+
|
|
1072
|
+
Returns:
|
|
1073
|
+
True if the PVT sequence is disabled.
|
|
1074
|
+
"""
|
|
1075
|
+
request = dto.StreamEmptyRequest(
|
|
1076
|
+
interface_id=self.device.connection.interface_id,
|
|
1077
|
+
device=self.device.device_address,
|
|
1078
|
+
stream_id=self.pvt_id,
|
|
1079
|
+
pvt=True,
|
|
1080
|
+
)
|
|
1081
|
+
response = call(
|
|
1082
|
+
"device/stream_check_disabled",
|
|
1083
|
+
request,
|
|
1084
|
+
dto.BoolResponse.from_binary)
|
|
1085
|
+
return response.value
|
|
1086
|
+
|
|
1087
|
+
async def check_disabled_async(
|
|
1088
|
+
self
|
|
1089
|
+
) -> bool:
|
|
1090
|
+
"""
|
|
1091
|
+
Queries the PVT sequence status from the device
|
|
1092
|
+
and returns boolean indicating whether the PVT sequence is disabled.
|
|
1093
|
+
Useful to determine if execution was interrupted by other movements.
|
|
1094
|
+
|
|
1095
|
+
Returns:
|
|
1096
|
+
True if the PVT sequence is disabled.
|
|
1097
|
+
"""
|
|
1098
|
+
request = dto.StreamEmptyRequest(
|
|
1099
|
+
interface_id=self.device.connection.interface_id,
|
|
1100
|
+
device=self.device.device_address,
|
|
1101
|
+
stream_id=self.pvt_id,
|
|
1102
|
+
pvt=True,
|
|
1103
|
+
)
|
|
1104
|
+
response = await call_async(
|
|
1105
|
+
"device/stream_check_disabled",
|
|
1106
|
+
request,
|
|
1107
|
+
dto.BoolResponse.from_binary)
|
|
1108
|
+
return response.value
|
|
1109
|
+
|
|
1110
|
+
def treat_discontinuities_as_error(
|
|
1111
|
+
self
|
|
1112
|
+
) -> None:
|
|
1113
|
+
"""
|
|
1114
|
+
Makes the PVT sequence throw PvtDiscontinuityException when it encounters discontinuities (ND warning flag).
|
|
1115
|
+
"""
|
|
1116
|
+
request = dto.StreamEmptyRequest(
|
|
1117
|
+
interface_id=self.device.connection.interface_id,
|
|
1118
|
+
device=self.device.device_address,
|
|
1119
|
+
stream_id=self.pvt_id,
|
|
1120
|
+
pvt=True,
|
|
1121
|
+
)
|
|
1122
|
+
call_sync("device/stream_treat_discontinuities", request)
|
|
1123
|
+
|
|
1124
|
+
def ignore_current_discontinuity(
|
|
1125
|
+
self
|
|
1126
|
+
) -> None:
|
|
1127
|
+
"""
|
|
1128
|
+
Prevents PvtDiscontinuityException as a result of expected discontinuity when resuming the sequence.
|
|
1129
|
+
"""
|
|
1130
|
+
request = dto.StreamEmptyRequest(
|
|
1131
|
+
interface_id=self.device.connection.interface_id,
|
|
1132
|
+
device=self.device.device_address,
|
|
1133
|
+
stream_id=self.pvt_id,
|
|
1134
|
+
pvt=True,
|
|
1135
|
+
)
|
|
1136
|
+
call_sync("device/stream_ignore_discontinuity", request)
|
|
1137
|
+
|
|
1138
|
+
def __retrieve_axes(
|
|
1139
|
+
self
|
|
1140
|
+
) -> List[PvtAxisDefinition]:
|
|
1141
|
+
"""
|
|
1142
|
+
Gets the axes of the PVT sequence.
|
|
1143
|
+
|
|
1144
|
+
Returns:
|
|
1145
|
+
An array of axis numbers of the axes the PVT sequence is set up to control.
|
|
1146
|
+
"""
|
|
1147
|
+
request = dto.StreamEmptyRequest(
|
|
1148
|
+
interface_id=self.device.connection.interface_id,
|
|
1149
|
+
device=self.device.device_address,
|
|
1150
|
+
stream_id=self.pvt_id,
|
|
1151
|
+
pvt=True,
|
|
1152
|
+
)
|
|
1153
|
+
response = call_sync(
|
|
1154
|
+
"device/stream_get_axes",
|
|
1155
|
+
request,
|
|
1156
|
+
dto.StreamGetAxesResponse.from_binary)
|
|
1157
|
+
return response.pvt_axes
|
|
1158
|
+
|
|
1159
|
+
def __retrieve_mode(
|
|
1160
|
+
self
|
|
1161
|
+
) -> PvtMode:
|
|
1162
|
+
"""
|
|
1163
|
+
Get the mode of the PVT sequence.
|
|
1164
|
+
|
|
1165
|
+
Returns:
|
|
1166
|
+
Mode of the PVT sequence.
|
|
1167
|
+
"""
|
|
1168
|
+
request = dto.StreamEmptyRequest(
|
|
1169
|
+
interface_id=self.device.connection.interface_id,
|
|
1170
|
+
device=self.device.device_address,
|
|
1171
|
+
stream_id=self.pvt_id,
|
|
1172
|
+
pvt=True,
|
|
1173
|
+
)
|
|
1174
|
+
response = call_sync(
|
|
1175
|
+
"device/stream_get_mode",
|
|
1176
|
+
request,
|
|
1177
|
+
dto.StreamModeResponse.from_binary)
|
|
1178
|
+
return response.pvt_mode
|
|
1179
|
+
|
|
1180
|
+
@staticmethod
|
|
1181
|
+
def save_sequence_data(
|
|
1182
|
+
sequence_data: PvtSequenceData,
|
|
1183
|
+
path: str,
|
|
1184
|
+
dimension_names: Optional[List[str]] = None
|
|
1185
|
+
) -> None:
|
|
1186
|
+
"""
|
|
1187
|
+
Saves PvtSequenceData object as csv file.
|
|
1188
|
+
Save format is compatible with Zaber Launcher PVT Editor App.
|
|
1189
|
+
|
|
1190
|
+
Throws InvalidArgumentException if fields are undefined or inconsistent.
|
|
1191
|
+
For example, position and velocity arrays must have the same dimensions.
|
|
1192
|
+
Sequence lengths must be consistent for positions, velocities and times.
|
|
1193
|
+
|
|
1194
|
+
Args:
|
|
1195
|
+
sequence_data: The PVT sequence data to save.
|
|
1196
|
+
path: The path to save the file to.
|
|
1197
|
+
dimension_names: Optional csv column names for each series.
|
|
1198
|
+
If not provided, the default names will be used: Series 1, Series 2, etc..
|
|
1199
|
+
Length of this array must be equal to number of dimensions in sequence data.
|
|
1200
|
+
"""
|
|
1201
|
+
request = dto.PvtSaveCsvRequest(
|
|
1202
|
+
sequence_data=sequence_data,
|
|
1203
|
+
path=path,
|
|
1204
|
+
dimension_names=dimension_names,
|
|
1205
|
+
)
|
|
1206
|
+
call("device/stream_pvt_save_csv", request)
|
|
1207
|
+
|
|
1208
|
+
@staticmethod
|
|
1209
|
+
async def save_sequence_data_async(
|
|
1210
|
+
sequence_data: PvtSequenceData,
|
|
1211
|
+
path: str,
|
|
1212
|
+
dimension_names: Optional[List[str]] = None
|
|
1213
|
+
) -> None:
|
|
1214
|
+
"""
|
|
1215
|
+
Saves PvtSequenceData object as csv file.
|
|
1216
|
+
Save format is compatible with Zaber Launcher PVT Editor App.
|
|
1217
|
+
|
|
1218
|
+
Throws InvalidArgumentException if fields are undefined or inconsistent.
|
|
1219
|
+
For example, position and velocity arrays must have the same dimensions.
|
|
1220
|
+
Sequence lengths must be consistent for positions, velocities and times.
|
|
1221
|
+
|
|
1222
|
+
Args:
|
|
1223
|
+
sequence_data: The PVT sequence data to save.
|
|
1224
|
+
path: The path to save the file to.
|
|
1225
|
+
dimension_names: Optional csv column names for each series.
|
|
1226
|
+
If not provided, the default names will be used: Series 1, Series 2, etc..
|
|
1227
|
+
Length of this array must be equal to number of dimensions in sequence data.
|
|
1228
|
+
"""
|
|
1229
|
+
request = dto.PvtSaveCsvRequest(
|
|
1230
|
+
sequence_data=sequence_data,
|
|
1231
|
+
path=path,
|
|
1232
|
+
dimension_names=dimension_names,
|
|
1233
|
+
)
|
|
1234
|
+
await call_async("device/stream_pvt_save_csv", request)
|
|
1235
|
+
|
|
1236
|
+
@staticmethod
|
|
1237
|
+
def load_sequence_data(
|
|
1238
|
+
path: str
|
|
1239
|
+
) -> PvtCsvData:
|
|
1240
|
+
"""
|
|
1241
|
+
Load PVT Sequence data from CSV file.
|
|
1242
|
+
The CSV data can include a header (recommended).
|
|
1243
|
+
There are two possible header formats:
|
|
1244
|
+
|
|
1245
|
+
1. A time column with named position and velocity columns.
|
|
1246
|
+
For example, "Time (ms),X Position (cm),X Velocity (cm/s),...".
|
|
1247
|
+
In this case, position, velocity and time columns are all optional.
|
|
1248
|
+
Also, order does not matter, but position and velocity names must be consistent.
|
|
1249
|
+
This is our recommended CSV format.
|
|
1250
|
+
|
|
1251
|
+
2. A time column with alternating position and velocity columns.
|
|
1252
|
+
For example, "Time (ms),Position (cm),Velocity (cm/s),...".
|
|
1253
|
+
In this case, only the time column is optional and order does matter.
|
|
1254
|
+
|
|
1255
|
+
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1256
|
+
Additionally, native units are the default if no units are specified.
|
|
1257
|
+
Time values default to milliseconds if no units are provided.
|
|
1258
|
+
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1259
|
+
In this case the number of columns must be odd.
|
|
1260
|
+
|
|
1261
|
+
Args:
|
|
1262
|
+
path: The path to the csv file to load.
|
|
1263
|
+
|
|
1264
|
+
Returns:
|
|
1265
|
+
The PVT csv data loaded from the file.
|
|
1266
|
+
"""
|
|
1267
|
+
request = dto.PvtLoadCsvRequest(
|
|
1268
|
+
path=path,
|
|
1269
|
+
)
|
|
1270
|
+
response = call(
|
|
1271
|
+
"device/stream_pvt_load_csv",
|
|
1272
|
+
request,
|
|
1273
|
+
PvtCsvData.from_binary)
|
|
1274
|
+
return response
|
|
1275
|
+
|
|
1276
|
+
@staticmethod
|
|
1277
|
+
async def load_sequence_data_async(
|
|
1278
|
+
path: str
|
|
1279
|
+
) -> PvtCsvData:
|
|
1280
|
+
"""
|
|
1281
|
+
Load PVT Sequence data from CSV file.
|
|
1282
|
+
The CSV data can include a header (recommended).
|
|
1283
|
+
There are two possible header formats:
|
|
1284
|
+
|
|
1285
|
+
1. A time column with named position and velocity columns.
|
|
1286
|
+
For example, "Time (ms),X Position (cm),X Velocity (cm/s),...".
|
|
1287
|
+
In this case, position, velocity and time columns are all optional.
|
|
1288
|
+
Also, order does not matter, but position and velocity names must be consistent.
|
|
1289
|
+
This is our recommended CSV format.
|
|
1290
|
+
|
|
1291
|
+
2. A time column with alternating position and velocity columns.
|
|
1292
|
+
For example, "Time (ms),Position (cm),Velocity (cm/s),...".
|
|
1293
|
+
In this case, only the time column is optional and order does matter.
|
|
1294
|
+
|
|
1295
|
+
Units must be wrapped in parens or square braces: ie. (µm/s), [µm/s].
|
|
1296
|
+
Additionally, native units are the default if no units are specified.
|
|
1297
|
+
Time values default to milliseconds if no units are provided.
|
|
1298
|
+
If no header is included, then column order is assumed to be "T,P1,V1,P2,V2,...".
|
|
1299
|
+
In this case the number of columns must be odd.
|
|
1300
|
+
|
|
1301
|
+
Args:
|
|
1302
|
+
path: The path to the csv file to load.
|
|
1303
|
+
|
|
1304
|
+
Returns:
|
|
1305
|
+
The PVT csv data loaded from the file.
|
|
1306
|
+
"""
|
|
1307
|
+
request = dto.PvtLoadCsvRequest(
|
|
1308
|
+
path=path,
|
|
1309
|
+
)
|
|
1310
|
+
response = await call_async(
|
|
1311
|
+
"device/stream_pvt_load_csv",
|
|
1312
|
+
request,
|
|
1313
|
+
PvtCsvData.from_binary)
|
|
1314
|
+
return response
|
|
1315
|
+
|
|
1316
|
+
def submit_sequence_data(
|
|
1317
|
+
self,
|
|
1318
|
+
sequence_data: PvtSequenceData
|
|
1319
|
+
) -> None:
|
|
1320
|
+
"""
|
|
1321
|
+
Writes the contents of a PvtSequenceData object to the sequence.
|
|
1322
|
+
|
|
1323
|
+
Args:
|
|
1324
|
+
sequence_data: The PVT sequence data to submit.
|
|
1325
|
+
"""
|
|
1326
|
+
request = dto.PvtSubmitSequenceDataRequest(
|
|
1327
|
+
interface_id=self.device.connection.interface_id,
|
|
1328
|
+
device=self.device.device_address,
|
|
1329
|
+
stream_id=self.pvt_id,
|
|
1330
|
+
sequence_data=sequence_data,
|
|
1331
|
+
)
|
|
1332
|
+
call("device/stream_pvt_submit_data", request)
|
|
1333
|
+
|
|
1334
|
+
async def submit_sequence_data_async(
|
|
1335
|
+
self,
|
|
1336
|
+
sequence_data: PvtSequenceData
|
|
1337
|
+
) -> None:
|
|
1338
|
+
"""
|
|
1339
|
+
Writes the contents of a PvtSequenceData object to the sequence.
|
|
1340
|
+
|
|
1341
|
+
Args:
|
|
1342
|
+
sequence_data: The PVT sequence data to submit.
|
|
1343
|
+
"""
|
|
1344
|
+
request = dto.PvtSubmitSequenceDataRequest(
|
|
1345
|
+
interface_id=self.device.connection.interface_id,
|
|
1346
|
+
device=self.device.device_address,
|
|
1347
|
+
stream_id=self.pvt_id,
|
|
1348
|
+
sequence_data=sequence_data,
|
|
1349
|
+
)
|
|
1350
|
+
await call_async("device/stream_pvt_submit_data", request)
|
|
1351
|
+
|
|
1352
|
+
def set_digital_output(
|
|
1353
|
+
self,
|
|
1354
|
+
channel_number: int,
|
|
1355
|
+
value: DigitalOutputAction
|
|
1356
|
+
) -> None:
|
|
1357
|
+
"""
|
|
1358
|
+
Deprecated: Use PvtSequence.Io.SetDigitalOutput instead.
|
|
1359
|
+
|
|
1360
|
+
Sets value for the specified digital output channel.
|
|
1361
|
+
|
|
1362
|
+
Args:
|
|
1363
|
+
channel_number: Channel number starting at 1.
|
|
1364
|
+
value: The type of action to perform on the channel.
|
|
1365
|
+
"""
|
|
1366
|
+
request = dto.StreamSetDigitalOutputRequest(
|
|
1367
|
+
interface_id=self.device.connection.interface_id,
|
|
1368
|
+
device=self.device.device_address,
|
|
1369
|
+
stream_id=self.pvt_id,
|
|
1370
|
+
pvt=True,
|
|
1371
|
+
channel_number=channel_number,
|
|
1372
|
+
value=value,
|
|
1373
|
+
)
|
|
1374
|
+
call("device/stream_set_digital_output", request)
|
|
1375
|
+
|
|
1376
|
+
async def set_digital_output_async(
|
|
1377
|
+
self,
|
|
1378
|
+
channel_number: int,
|
|
1379
|
+
value: DigitalOutputAction
|
|
1380
|
+
) -> None:
|
|
1381
|
+
"""
|
|
1382
|
+
Deprecated: Use PvtSequence.Io.SetDigitalOutput instead.
|
|
1383
|
+
|
|
1384
|
+
Sets value for the specified digital output channel.
|
|
1385
|
+
|
|
1386
|
+
Args:
|
|
1387
|
+
channel_number: Channel number starting at 1.
|
|
1388
|
+
value: The type of action to perform on the channel.
|
|
1389
|
+
"""
|
|
1390
|
+
request = dto.StreamSetDigitalOutputRequest(
|
|
1391
|
+
interface_id=self.device.connection.interface_id,
|
|
1392
|
+
device=self.device.device_address,
|
|
1393
|
+
stream_id=self.pvt_id,
|
|
1394
|
+
pvt=True,
|
|
1395
|
+
channel_number=channel_number,
|
|
1396
|
+
value=value,
|
|
1397
|
+
)
|
|
1398
|
+
await call_async("device/stream_set_digital_output", request)
|
|
1399
|
+
|
|
1400
|
+
def set_all_digital_outputs(
|
|
1401
|
+
self,
|
|
1402
|
+
values: List[DigitalOutputAction]
|
|
1403
|
+
) -> None:
|
|
1404
|
+
"""
|
|
1405
|
+
Deprecated: Use PvtSequence.Io.SetAllDigitalOutputs instead.
|
|
1406
|
+
|
|
1407
|
+
Sets values for all digital output channels.
|
|
1408
|
+
|
|
1409
|
+
Args:
|
|
1410
|
+
values: The type of action to perform on the channel.
|
|
1411
|
+
"""
|
|
1412
|
+
request = dto.StreamSetAllDigitalOutputsRequest(
|
|
1413
|
+
interface_id=self.device.connection.interface_id,
|
|
1414
|
+
device=self.device.device_address,
|
|
1415
|
+
stream_id=self.pvt_id,
|
|
1416
|
+
pvt=True,
|
|
1417
|
+
values=values,
|
|
1418
|
+
)
|
|
1419
|
+
call("device/stream_set_all_digital_outputs", request)
|
|
1420
|
+
|
|
1421
|
+
async def set_all_digital_outputs_async(
|
|
1422
|
+
self,
|
|
1423
|
+
values: List[DigitalOutputAction]
|
|
1424
|
+
) -> None:
|
|
1425
|
+
"""
|
|
1426
|
+
Deprecated: Use PvtSequence.Io.SetAllDigitalOutputs instead.
|
|
1427
|
+
|
|
1428
|
+
Sets values for all digital output channels.
|
|
1429
|
+
|
|
1430
|
+
Args:
|
|
1431
|
+
values: The type of action to perform on the channel.
|
|
1432
|
+
"""
|
|
1433
|
+
request = dto.StreamSetAllDigitalOutputsRequest(
|
|
1434
|
+
interface_id=self.device.connection.interface_id,
|
|
1435
|
+
device=self.device.device_address,
|
|
1436
|
+
stream_id=self.pvt_id,
|
|
1437
|
+
pvt=True,
|
|
1438
|
+
values=values,
|
|
1439
|
+
)
|
|
1440
|
+
await call_async("device/stream_set_all_digital_outputs", request)
|
|
1441
|
+
|
|
1442
|
+
def set_analog_output(
|
|
1443
|
+
self,
|
|
1444
|
+
channel_number: int,
|
|
1445
|
+
value: float
|
|
1446
|
+
) -> None:
|
|
1447
|
+
"""
|
|
1448
|
+
Deprecated: Use PvtSequence.Io.SetAnalogOutput instead.
|
|
1449
|
+
|
|
1450
|
+
Sets value for the specified analog output channel.
|
|
1451
|
+
|
|
1452
|
+
Args:
|
|
1453
|
+
channel_number: Channel number starting at 1.
|
|
1454
|
+
value: Value to set the output channel voltage to.
|
|
1455
|
+
"""
|
|
1456
|
+
request = dto.StreamSetAnalogOutputRequest(
|
|
1457
|
+
interface_id=self.device.connection.interface_id,
|
|
1458
|
+
device=self.device.device_address,
|
|
1459
|
+
stream_id=self.pvt_id,
|
|
1460
|
+
pvt=True,
|
|
1461
|
+
channel_number=channel_number,
|
|
1462
|
+
value=value,
|
|
1463
|
+
)
|
|
1464
|
+
call("device/stream_set_analog_output", request)
|
|
1465
|
+
|
|
1466
|
+
async def set_analog_output_async(
|
|
1467
|
+
self,
|
|
1468
|
+
channel_number: int,
|
|
1469
|
+
value: float
|
|
1470
|
+
) -> None:
|
|
1471
|
+
"""
|
|
1472
|
+
Deprecated: Use PvtSequence.Io.SetAnalogOutput instead.
|
|
1473
|
+
|
|
1474
|
+
Sets value for the specified analog output channel.
|
|
1475
|
+
|
|
1476
|
+
Args:
|
|
1477
|
+
channel_number: Channel number starting at 1.
|
|
1478
|
+
value: Value to set the output channel voltage to.
|
|
1479
|
+
"""
|
|
1480
|
+
request = dto.StreamSetAnalogOutputRequest(
|
|
1481
|
+
interface_id=self.device.connection.interface_id,
|
|
1482
|
+
device=self.device.device_address,
|
|
1483
|
+
stream_id=self.pvt_id,
|
|
1484
|
+
pvt=True,
|
|
1485
|
+
channel_number=channel_number,
|
|
1486
|
+
value=value,
|
|
1487
|
+
)
|
|
1488
|
+
await call_async("device/stream_set_analog_output", request)
|
|
1489
|
+
|
|
1490
|
+
def set_all_analog_outputs(
|
|
1491
|
+
self,
|
|
1492
|
+
values: List[float]
|
|
1493
|
+
) -> None:
|
|
1494
|
+
"""
|
|
1495
|
+
Deprecated: Use PvtSequence.Io.SetAllAnalogOutputs instead.
|
|
1496
|
+
|
|
1497
|
+
Sets values for all analog output channels.
|
|
1498
|
+
|
|
1499
|
+
Args:
|
|
1500
|
+
values: Voltage values to set the output channels to.
|
|
1501
|
+
"""
|
|
1502
|
+
request = dto.StreamSetAllAnalogOutputsRequest(
|
|
1503
|
+
interface_id=self.device.connection.interface_id,
|
|
1504
|
+
device=self.device.device_address,
|
|
1505
|
+
stream_id=self.pvt_id,
|
|
1506
|
+
pvt=True,
|
|
1507
|
+
values=values,
|
|
1508
|
+
)
|
|
1509
|
+
call("device/stream_set_all_analog_outputs", request)
|
|
1510
|
+
|
|
1511
|
+
async def set_all_analog_outputs_async(
|
|
1512
|
+
self,
|
|
1513
|
+
values: List[float]
|
|
1514
|
+
) -> None:
|
|
1515
|
+
"""
|
|
1516
|
+
Deprecated: Use PvtSequence.Io.SetAllAnalogOutputs instead.
|
|
1517
|
+
|
|
1518
|
+
Sets values for all analog output channels.
|
|
1519
|
+
|
|
1520
|
+
Args:
|
|
1521
|
+
values: Voltage values to set the output channels to.
|
|
1522
|
+
"""
|
|
1523
|
+
request = dto.StreamSetAllAnalogOutputsRequest(
|
|
1524
|
+
interface_id=self.device.connection.interface_id,
|
|
1525
|
+
device=self.device.device_address,
|
|
1526
|
+
stream_id=self.pvt_id,
|
|
1527
|
+
pvt=True,
|
|
1528
|
+
values=values,
|
|
1529
|
+
)
|
|
1530
|
+
await call_async("device/stream_set_all_analog_outputs", request)
|