cgse 2024.7.0__py3-none-any.whl → 2025.0.2__py3-none-any.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.
- README.md +27 -0
- bump.py +85 -0
- cgse-2025.0.2.dist-info/METADATA +38 -0
- cgse-2025.0.2.dist-info/RECORD +5 -0
- {cgse-2024.7.0.dist-info → cgse-2025.0.2.dist-info}/WHEEL +1 -2
- cgse-2024.7.0.dist-info/COPYING +0 -674
- cgse-2024.7.0.dist-info/COPYING.LESSER +0 -165
- cgse-2024.7.0.dist-info/METADATA +0 -144
- cgse-2024.7.0.dist-info/RECORD +0 -660
- cgse-2024.7.0.dist-info/entry_points.txt +0 -75
- cgse-2024.7.0.dist-info/top_level.txt +0 -2
- egse/__init__.py +0 -12
- egse/__main__.py +0 -32
- egse/aeu/aeu.py +0 -5238
- egse/aeu/aeu_awg.yaml +0 -265
- egse/aeu/aeu_crio.yaml +0 -273
- egse/aeu/aeu_cs.py +0 -627
- egse/aeu/aeu_devif.py +0 -321
- egse/aeu/aeu_main_ui.py +0 -903
- egse/aeu/aeu_metrics.py +0 -131
- egse/aeu/aeu_protocol.py +0 -463
- egse/aeu/aeu_psu.yaml +0 -204
- egse/aeu/aeu_ui.py +0 -873
- egse/aeu/arbdata/FccdRead.arb +0 -2
- egse/aeu/arbdata/FccdRead_min_points.arb +0 -2
- egse/aeu/arbdata/HeaterSync_FccdRead.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead25.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead31_25.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead37_50.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead43_75.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead50.arb +0 -2
- egse/aeu/arbdata/Heater_FccdRead_min_points.arb +0 -2
- egse/aeu/arbdata/ccdRead25.arb +0 -2
- egse/aeu/arbdata/ccdRead25_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead31_25.arb +0 -2
- egse/aeu/arbdata/ccdRead31_25_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead37_50.arb +0 -2
- egse/aeu/arbdata/ccdRead37_50_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead43_75.arb +0 -2
- egse/aeu/arbdata/ccdRead43_75_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead50.arb +0 -2
- egse/aeu/arbdata/ccdRead50_150ms.arb +0 -2
- egse/alert/__init__.py +0 -1049
- egse/alert/alertman.yaml +0 -37
- egse/alert/alertman_cs.py +0 -233
- egse/alert/alertman_ui.py +0 -600
- egse/alert/gsm/beaglebone.py +0 -138
- egse/alert/gsm/beaglebone.yaml +0 -51
- egse/alert/gsm/beaglebone_cs.py +0 -108
- egse/alert/gsm/beaglebone_devif.py +0 -122
- egse/alert/gsm/beaglebone_protocol.py +0 -46
- egse/bits.py +0 -318
- egse/camera.py +0 -44
- egse/collimator/__init__.py +0 -0
- egse/collimator/fcul/__init__.py +0 -0
- egse/collimator/fcul/ogse.py +0 -1077
- egse/collimator/fcul/ogse.yaml +0 -14
- egse/collimator/fcul/ogse_cs.py +0 -154
- egse/collimator/fcul/ogse_devif.py +0 -358
- egse/collimator/fcul/ogse_protocol.py +0 -132
- egse/collimator/fcul/ogse_sim.py +0 -431
- egse/collimator/fcul/ogse_ui.py +0 -1108
- egse/command.py +0 -699
- egse/config.py +0 -410
- egse/confman/__init__.py +0 -1058
- egse/confman/confman.yaml +0 -70
- egse/confman/confman_cs.py +0 -240
- egse/confman/confman_ui.py +0 -381
- egse/confman/setup_ui.py +0 -565
- egse/control.py +0 -632
- egse/coordinates/__init__.py +0 -534
- egse/coordinates/avoidance.py +0 -100
- egse/coordinates/cslmodel.py +0 -127
- egse/coordinates/laser_tracker_to_dict.py +0 -122
- egse/coordinates/point.py +0 -707
- egse/coordinates/pyplot.py +0 -194
- egse/coordinates/referenceFrame.py +0 -1279
- egse/coordinates/refmodel.py +0 -737
- egse/coordinates/rotationMatrix.py +0 -85
- egse/coordinates/transform3d_addon.py +0 -419
- egse/csl/__init__.py +0 -50
- egse/csl/commanding.py +0 -78
- egse/csl/icons/hexapod-connected-selected.svg +0 -30
- egse/csl/icons/hexapod-connected.svg +0 -30
- egse/csl/icons/hexapod-homing-selected.svg +0 -68
- egse/csl/icons/hexapod-homing.svg +0 -68
- egse/csl/icons/hexapod-retract-selected.svg +0 -56
- egse/csl/icons/hexapod-retract.svg +0 -51
- egse/csl/icons/hexapod-zero-selected.svg +0 -56
- egse/csl/icons/hexapod-zero.svg +0 -56
- egse/csl/icons/logo-puna.svg +0 -92
- egse/csl/icons/stop.svg +0 -1
- egse/csl/initialisation.py +0 -102
- egse/csl/mech_pos_settings.yaml +0 -18
- egse/das.py +0 -1240
- egse/das.yaml +0 -7
- egse/data/conf/SETUP_CSL_00000_170620_150000.yaml +0 -5
- egse/data/conf/SETUP_CSL_00001_170620_151010.yaml +0 -69
- egse/data/conf/SETUP_CSL_00002_170620_151020.yaml +0 -69
- egse/data/conf/SETUP_CSL_00003_170620_151030.yaml +0 -69
- egse/data/conf/SETUP_CSL_00004_170620_151040.yaml +0 -69
- egse/data/conf/SETUP_CSL_00005_170620_151050.yaml +0 -69
- egse/data/conf/SETUP_CSL_00006_170620_151060.yaml +0 -69
- egse/data/conf/SETUP_CSL_00007_170620_151070.yaml +0 -69
- egse/data/conf/SETUP_CSL_00008_170620_151080.yaml +0 -75
- egse/data/conf/SETUP_CSL_00010_210308_083016.yaml +0 -138
- egse/data/conf/SETUP_INTA_00000_170620_150000.yaml +0 -4
- egse/data/conf/SETUP_SRON_00000_170620_150000.yaml +0 -4
- egse/decorators.py +0 -514
- egse/device.py +0 -269
- egse/dpu/__init__.py +0 -2698
- egse/dpu/ccd_ui.py +0 -514
- egse/dpu/dpu.py +0 -783
- egse/dpu/dpu.yaml +0 -153
- egse/dpu/dpu_cs.py +0 -272
- egse/dpu/dpu_ui.py +0 -671
- egse/dpu/fitsgen.py +0 -2096
- egse/dpu/fitsgen_ui.py +0 -399
- egse/dpu/hdf5_model.py +0 -332
- egse/dpu/hdf5_ui.py +0 -277
- egse/dpu/hdf5_viewer.py +0 -506
- egse/dpu/hk_ui.py +0 -468
- egse/dpu_commands.py +0 -81
- egse/dsi/__init__.py +0 -33
- egse/dsi/_libesl.py +0 -232
- egse/dsi/constants.py +0 -296
- egse/dsi/esl.py +0 -630
- egse/dsi/rmap.py +0 -444
- egse/dsi/rmapci.py +0 -39
- egse/dsi/spw.py +0 -335
- egse/dsi/spw_state.py +0 -29
- egse/dummy.py +0 -318
- egse/dyndummy.py +0 -179
- egse/env.py +0 -278
- egse/exceptions.py +0 -88
- egse/fdir/__init__.py +0 -26
- egse/fdir/fdir_manager.py +0 -85
- egse/fdir/fdir_manager.yaml +0 -37
- egse/fdir/fdir_manager_controller.py +0 -136
- egse/fdir/fdir_manager_cs.py +0 -164
- egse/fdir/fdir_manager_interface.py +0 -15
- egse/fdir/fdir_remote.py +0 -73
- egse/fdir/fdir_remote.yaml +0 -30
- egse/fdir/fdir_remote_controller.py +0 -30
- egse/fdir/fdir_remote_cs.py +0 -94
- egse/fdir/fdir_remote_interface.py +0 -9
- egse/fdir/fdir_remote_popup.py +0 -26
- egse/fee/__init__.py +0 -106
- egse/fee/f_fee_register.yaml +0 -43
- egse/fee/feesim.py +0 -914
- egse/fee/n_fee_hk.py +0 -768
- egse/fee/nfee.py +0 -188
- egse/filterwheel/__init__.py +0 -4
- egse/filterwheel/eksma/__init__.py +0 -49
- egse/filterwheel/eksma/fw8smc4.py +0 -657
- egse/filterwheel/eksma/fw8smc4.yaml +0 -121
- egse/filterwheel/eksma/fw8smc4_cs.py +0 -144
- egse/filterwheel/eksma/fw8smc4_devif.py +0 -473
- egse/filterwheel/eksma/fw8smc4_protocol.py +0 -82
- egse/filterwheel/eksma/fw8smc4_ui.py +0 -940
- egse/filterwheel/eksma/fw8smc5.py +0 -115
- egse/filterwheel/eksma/fw8smc5.yaml +0 -105
- egse/filterwheel/eksma/fw8smc5_controller.py +0 -307
- egse/filterwheel/eksma/fw8smc5_cs.py +0 -141
- egse/filterwheel/eksma/fw8smc5_interface.py +0 -65
- egse/filterwheel/eksma/fw8smc5_simulator.py +0 -29
- egse/filterwheel/eksma/fw8smc5_ui.py +0 -1065
- egse/filterwheel/eksma/testpythonfw.py +0 -215
- egse/fov/__init__.py +0 -65
- egse/fov/fov_hk.py +0 -710
- egse/fov/fov_ui.py +0 -859
- egse/fov/fov_ui_controller.py +0 -140
- egse/fov/fov_ui_model.py +0 -200
- egse/fov/fov_ui_view.py +0 -345
- egse/gimbal/__init__.py +0 -32
- egse/gimbal/symetrie/__init__.py +0 -26
- egse/gimbal/symetrie/alpha.py +0 -586
- egse/gimbal/symetrie/generic_gimbal_ui.py +0 -1521
- egse/gimbal/symetrie/gimbal.py +0 -877
- egse/gimbal/symetrie/gimbal.yaml +0 -168
- egse/gimbal/symetrie/gimbal_cs.py +0 -183
- egse/gimbal/symetrie/gimbal_protocol.py +0 -138
- egse/gimbal/symetrie/gimbal_ui.py +0 -361
- egse/gimbal/symetrie/pmac.py +0 -1006
- egse/gimbal/symetrie/pmac_regex.py +0 -83
- egse/graph.py +0 -132
- egse/gui/__init__.py +0 -47
- egse/gui/buttons.py +0 -378
- egse/gui/focalplane.py +0 -1285
- egse/gui/formatter.py +0 -10
- egse/gui/led.py +0 -162
- egse/gui/limitswitch.py +0 -143
- egse/gui/mechanisms.py +0 -587
- egse/gui/states.py +0 -148
- egse/gui/stripchart.py +0 -729
- egse/gui/styles.qss +0 -48
- egse/gui/switch.py +0 -112
- egse/h5.py +0 -274
- egse/help/__init__.py +0 -0
- egse/help/help_ui.py +0 -126
- egse/hexapod/__init__.py +0 -32
- egse/hexapod/symetrie/__init__.py +0 -137
- egse/hexapod/symetrie/alpha.py +0 -874
- egse/hexapod/symetrie/dynalpha.py +0 -1387
- egse/hexapod/symetrie/hexapod_ui.py +0 -1516
- egse/hexapod/symetrie/pmac.py +0 -1010
- egse/hexapod/symetrie/pmac_regex.py +0 -83
- egse/hexapod/symetrie/puna.py +0 -1167
- egse/hexapod/symetrie/puna.yaml +0 -193
- egse/hexapod/symetrie/puna_cs.py +0 -195
- egse/hexapod/symetrie/puna_protocol.py +0 -134
- egse/hexapod/symetrie/puna_ui.py +0 -433
- egse/hexapod/symetrie/punaplus.py +0 -107
- egse/hexapod/symetrie/zonda.py +0 -872
- egse/hexapod/symetrie/zonda.yaml +0 -337
- egse/hexapod/symetrie/zonda_cs.py +0 -172
- egse/hexapod/symetrie/zonda_devif.py +0 -414
- egse/hexapod/symetrie/zonda_protocol.py +0 -123
- egse/hexapod/symetrie/zonda_ui.py +0 -449
- egse/hk.py +0 -791
- egse/icons/aeu-cs-start.svg +0 -117
- egse/icons/aeu-cs-stop.svg +0 -118
- egse/icons/aeu-cs.svg +0 -107
- egse/icons/aeu_cs-started.svg +0 -112
- egse/icons/aeu_cs-stopped.svg +0 -112
- egse/icons/aeu_cs.svg +0 -55
- egse/icons/alert.svg +0 -1
- egse/icons/arrow-double-left.png +0 -0
- egse/icons/arrow-double-right.png +0 -0
- egse/icons/arrow-up.svg +0 -11
- egse/icons/backward.svg +0 -1
- egse/icons/busy.svg +0 -1
- egse/icons/cleaning.svg +0 -115
- egse/icons/color-scheme.svg +0 -1
- egse/icons/cs-connected-alert.svg +0 -91
- egse/icons/cs-connected-disabled.svg +0 -43
- egse/icons/cs-connected.svg +0 -89
- egse/icons/cs-not-connected.svg +0 -44
- egse/icons/double-left-arrow.svg +0 -1
- egse/icons/double-right-arrow.svg +0 -1
- egse/icons/erase-disabled.svg +0 -19
- egse/icons/erase.svg +0 -59
- egse/icons/fitsgen-start.svg +0 -47
- egse/icons/fitsgen-stop.svg +0 -48
- egse/icons/fitsgen.svg +0 -1
- egse/icons/forward.svg +0 -1
- egse/icons/fov-hk-start.svg +0 -33
- egse/icons/fov-hk-stop.svg +0 -37
- egse/icons/fov-hk.svg +0 -1
- egse/icons/front-desk.svg +0 -1
- egse/icons/home-actioned.svg +0 -15
- egse/icons/home-disabled.svg +0 -15
- egse/icons/home.svg +0 -13
- egse/icons/info.svg +0 -1
- egse/icons/invalid.png +0 -0
- egse/icons/led-green.svg +0 -20
- egse/icons/led-grey.svg +0 -20
- egse/icons/led-orange.svg +0 -20
- egse/icons/led-red.svg +0 -20
- egse/icons/led-square-green.svg +0 -134
- egse/icons/led-square-grey.svg +0 -134
- egse/icons/led-square-orange.svg +0 -134
- egse/icons/led-square-red.svg +0 -134
- egse/icons/limit-switch-all-green.svg +0 -115
- egse/icons/limit-switch-all-red.svg +0 -117
- egse/icons/limit-switch-el+.svg +0 -116
- egse/icons/limit-switch-el-.svg +0 -117
- egse/icons/location-marker.svg +0 -1
- egse/icons/logo-dpu.svg +0 -48
- egse/icons/logo-gimbal.svg +0 -112
- egse/icons/logo-huber.svg +0 -23
- egse/icons/logo-ogse.svg +0 -31
- egse/icons/logo-puna.svg +0 -92
- egse/icons/logo-tcs.svg +0 -29
- egse/icons/logo-zonda.svg +0 -66
- egse/icons/maximize.svg +0 -1
- egse/icons/meter.svg +0 -1
- egse/icons/more.svg +0 -45
- egse/icons/n-fee-hk-start.svg +0 -24
- egse/icons/n-fee-hk-stop.svg +0 -25
- egse/icons/n-fee-hk.svg +0 -83
- egse/icons/observing-off.svg +0 -46
- egse/icons/observing-on.svg +0 -46
- egse/icons/open-document-hdf5.png +0 -0
- egse/icons/open-document-hdf5.svg +0 -21
- egse/icons/ops-mode.svg +0 -1
- egse/icons/play-green.svg +0 -17
- egse/icons/plugged-disabled.svg +0 -27
- egse/icons/plugged.svg +0 -21
- egse/icons/pm_ui.svg +0 -1
- egse/icons/power-button-green.svg +0 -27
- egse/icons/power-button-red.svg +0 -27
- egse/icons/power-button.svg +0 -27
- egse/icons/radar.svg +0 -1
- egse/icons/radioactive.svg +0 -2
- egse/icons/reload.svg +0 -1
- egse/icons/remote-control-off.svg +0 -28
- egse/icons/remote-control-on.svg +0 -28
- egse/icons/repeat-blue.svg +0 -15
- egse/icons/repeat.svg +0 -1
- egse/icons/settings.svg +0 -1
- egse/icons/shrink.svg +0 -1
- egse/icons/shutter.svg +0 -1
- egse/icons/sign-off.svg +0 -1
- egse/icons/sign-on.svg +0 -1
- egse/icons/sim-mode.svg +0 -1
- egse/icons/small-buttons-go.svg +0 -20
- egse/icons/small-buttons-minus.svg +0 -51
- egse/icons/small-buttons-plus.svg +0 -51
- egse/icons/sponge.svg +0 -220
- egse/icons/start-button-disabled.svg +0 -84
- egse/icons/start-button.svg +0 -50
- egse/icons/stop-button-disabled.svg +0 -84
- egse/icons/stop-button.svg +0 -50
- egse/icons/stop-red.svg +0 -17
- egse/icons/stop.svg +0 -1
- egse/icons/switch-disabled-square.svg +0 -87
- egse/icons/switch-disabled.svg +0 -15
- egse/icons/switch-off-square.svg +0 -87
- egse/icons/switch-off.svg +0 -72
- egse/icons/switch-on-square.svg +0 -87
- egse/icons/switch-on.svg +0 -61
- egse/icons/temperature-control.svg +0 -44
- egse/icons/th_ui_logo.svg +0 -1
- egse/icons/unplugged.svg +0 -23
- egse/icons/unvalid.png +0 -0
- egse/icons/user-interface.svg +0 -1
- egse/icons/vacuum.svg +0 -1
- egse/icons/valid.png +0 -0
- egse/icons/zoom-to-pixel-dark.svg +0 -64
- egse/icons/zoom-to-pixel-white.svg +0 -36
- egse/images/big-rotation-stage.png +0 -0
- egse/images/connected-100.png +0 -0
- egse/images/cross.svg +0 -6
- egse/images/disconnected-100.png +0 -0
- egse/images/gui-icon.png +0 -0
- egse/images/home.svg +0 -6
- egse/images/info-icon.png +0 -0
- egse/images/led-black.svg +0 -89
- egse/images/led-green.svg +0 -85
- egse/images/led-orange.svg +0 -85
- egse/images/led-red.svg +0 -85
- egse/images/load-icon.png +0 -0
- egse/images/load-setup.png +0 -0
- egse/images/load.png +0 -0
- egse/images/pause.png +0 -0
- egse/images/play-button.svg +0 -8
- egse/images/play.png +0 -0
- egse/images/process-status.png +0 -0
- egse/images/restart.png +0 -0
- egse/images/search.png +0 -0
- egse/images/sma.png +0 -0
- egse/images/start.png +0 -0
- egse/images/stop-button.svg +0 -8
- egse/images/stop.png +0 -0
- egse/images/switch-off.svg +0 -48
- egse/images/switch-on.svg +0 -48
- egse/images/undo.png +0 -0
- egse/images/update-button.svg +0 -11
- egse/imageviewer/exposureselection.py +0 -475
- egse/imageviewer/imageviewer.py +0 -198
- egse/imageviewer/matchfocalplane.py +0 -179
- egse/imageviewer/subfieldposition.py +0 -133
- egse/lampcontrol/__init__.py +0 -4
- egse/lampcontrol/beaglebone/beaglebone.py +0 -178
- egse/lampcontrol/beaglebone/beaglebone.yaml +0 -62
- egse/lampcontrol/beaglebone/beaglebone_cs.py +0 -106
- egse/lampcontrol/beaglebone/beaglebone_devif.py +0 -150
- egse/lampcontrol/beaglebone/beaglebone_protocol.py +0 -73
- egse/lampcontrol/energetiq/__init__.py +0 -22
- egse/lampcontrol/energetiq/eq99.yaml +0 -98
- egse/lampcontrol/energetiq/lampEQ99.py +0 -283
- egse/lampcontrol/energetiq/lampEQ99_cs.py +0 -128
- egse/lampcontrol/energetiq/lampEQ99_devif.py +0 -158
- egse/lampcontrol/energetiq/lampEQ99_encode_decode_errors.py +0 -73
- egse/lampcontrol/energetiq/lampEQ99_protocol.py +0 -71
- egse/lampcontrol/energetiq/lampEQ99_ui.py +0 -465
- egse/lib/CentOS-7/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/CentOS-8/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/CentOS-8/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Debian/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Debian/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Debian/libetherspacelink_v35_21.dylib +0 -0
- egse/lib/Linux/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Linux/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Ubuntu-20/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Ubuntu-20/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/gssw/python3-gssw_2.2.3+31f63c9f-1_all.deb +0 -0
- egse/lib/ximc/__pycache__/pyximc.cpython-38 2.pyc +0 -0
- egse/lib/ximc/__pycache__/pyximc.cpython-38.pyc +0 -0
- egse/lib/ximc/libximc.framework/Frameworks/libbindy.dylib +0 -0
- egse/lib/ximc/libximc.framework/Frameworks/libxiwrapper.dylib +0 -0
- egse/lib/ximc/libximc.framework/Headers/ximc.h +0 -5510
- egse/lib/ximc/libximc.framework/Resources/Info.plist +0 -42
- egse/lib/ximc/libximc.framework/Resources/keyfile.sqlite +0 -0
- egse/lib/ximc/libximc.framework/libbindy.so +0 -0
- egse/lib/ximc/libximc.framework/libximc +0 -0
- egse/lib/ximc/libximc.framework/libximc.so +0 -0
- egse/lib/ximc/libximc.framework/libximc.so.7.0.0 +0 -0
- egse/lib/ximc/libximc.framework/libxiwrapper.so +0 -0
- egse/lib/ximc/pyximc.py +0 -922
- egse/listener.py +0 -179
- egse/logger/__init__.py +0 -243
- egse/logger/log_cs.py +0 -321
- egse/metrics.py +0 -102
- egse/mixin.py +0 -464
- egse/monitoring.py +0 -95
- egse/ni/alarms/__init__.py +0 -26
- egse/ni/alarms/cdaq9375.py +0 -300
- egse/ni/alarms/cdaq9375.yaml +0 -89
- egse/ni/alarms/cdaq9375_cs.py +0 -130
- egse/ni/alarms/cdaq9375_devif.py +0 -183
- egse/ni/alarms/cdaq9375_protocol.py +0 -48
- egse/obs_inspection.py +0 -165
- egse/observer.py +0 -41
- egse/obsid.py +0 -163
- egse/powermeter/__init__.py +0 -0
- egse/powermeter/ni/__init__.py +0 -38
- egse/powermeter/ni/cdaq9184.py +0 -224
- egse/powermeter/ni/cdaq9184.yaml +0 -73
- egse/powermeter/ni/cdaq9184_cs.py +0 -130
- egse/powermeter/ni/cdaq9184_devif.py +0 -201
- egse/powermeter/ni/cdaq9184_protocol.py +0 -48
- egse/powermeter/ni/cdaq9184_ui.py +0 -544
- egse/powermeter/thorlabs/__init__.py +0 -25
- egse/powermeter/thorlabs/pm100a.py +0 -380
- egse/powermeter/thorlabs/pm100a.yaml +0 -132
- egse/powermeter/thorlabs/pm100a_cs.py +0 -136
- egse/powermeter/thorlabs/pm100a_devif.py +0 -127
- egse/powermeter/thorlabs/pm100a_protocol.py +0 -80
- egse/powermeter/thorlabs/pm100a_ui.py +0 -725
- egse/process.py +0 -451
- egse/procman/__init__.py +0 -834
- egse/procman/cannot_start_process_popup.py +0 -43
- egse/procman/procman.yaml +0 -49
- egse/procman/procman_cs.py +0 -201
- egse/procman/procman_ui.py +0 -2081
- egse/protocol.py +0 -605
- egse/proxy.py +0 -531
- egse/randomwalk.py +0 -140
- egse/reg.py +0 -585
- egse/reload.py +0 -122
- egse/reprocess.py +0 -693
- egse/resource.py +0 -333
- egse/rmap.py +0 -406
- egse/rst.py +0 -135
- egse/search.py +0 -182
- egse/serialdevice.py +0 -190
- egse/services.py +0 -247
- egse/services.yaml +0 -68
- egse/settings.py +0 -379
- egse/settings.yaml +0 -980
- egse/setup.py +0 -1181
- egse/shutter/__init__.py +0 -0
- egse/shutter/thorlabs/__init__.py +0 -19
- egse/shutter/thorlabs/ksc101.py +0 -205
- egse/shutter/thorlabs/ksc101.yaml +0 -105
- egse/shutter/thorlabs/ksc101_cs.py +0 -136
- egse/shutter/thorlabs/ksc101_devif.py +0 -201
- egse/shutter/thorlabs/ksc101_protocol.py +0 -71
- egse/shutter/thorlabs/ksc101_ui.py +0 -548
- egse/shutter/thorlabs/sc10.py +0 -82
- egse/shutter/thorlabs/sc10.yaml +0 -52
- egse/shutter/thorlabs/sc10_controller.py +0 -81
- egse/shutter/thorlabs/sc10_cs.py +0 -108
- egse/shutter/thorlabs/sc10_interface.py +0 -25
- egse/shutter/thorlabs/sc10_simulator.py +0 -30
- egse/simulator.py +0 -41
- egse/slack.py +0 -61
- egse/socketdevice.py +0 -218
- egse/sockets.py +0 -218
- egse/spw.py +0 -1401
- egse/stages/__init__.py +0 -12
- egse/stages/aerotech/ensemble.py +0 -245
- egse/stages/aerotech/ensemble.yaml +0 -205
- egse/stages/aerotech/ensemble_controller.py +0 -275
- egse/stages/aerotech/ensemble_cs.py +0 -110
- egse/stages/aerotech/ensemble_interface.py +0 -132
- egse/stages/aerotech/ensemble_parameters.py +0 -433
- egse/stages/aerotech/ensemble_simulator.py +0 -27
- egse/stages/aerotech/mgse_sim.py +0 -188
- egse/stages/arun/smd3.py +0 -110
- egse/stages/arun/smd3.yaml +0 -68
- egse/stages/arun/smd3_controller.py +0 -470
- egse/stages/arun/smd3_cs.py +0 -112
- egse/stages/arun/smd3_interface.py +0 -53
- egse/stages/arun/smd3_simulator.py +0 -27
- egse/stages/arun/smd3_stop.py +0 -16
- egse/stages/huber/__init__.py +0 -49
- egse/stages/huber/smc9300.py +0 -920
- egse/stages/huber/smc9300.yaml +0 -63
- egse/stages/huber/smc9300_cs.py +0 -178
- egse/stages/huber/smc9300_devif.py +0 -345
- egse/stages/huber/smc9300_protocol.py +0 -113
- egse/stages/huber/smc9300_sim.py +0 -547
- egse/stages/huber/smc9300_ui.py +0 -973
- egse/state.py +0 -173
- egse/statemachine.py +0 -274
- egse/storage/__init__.py +0 -1067
- egse/storage/persistence.py +0 -2295
- egse/storage/storage.yaml +0 -79
- egse/storage/storage_cs.py +0 -231
- egse/styles/dark.qss +0 -343
- egse/styles/default.qss +0 -48
- egse/synoptics/__init__.py +0 -417
- egse/synoptics/syn.yaml +0 -9
- egse/synoptics/syn_cs.py +0 -195
- egse/system.py +0 -1611
- egse/tcs/__init__.py +0 -14
- egse/tcs/tcs.py +0 -879
- egse/tcs/tcs.yaml +0 -14
- egse/tcs/tcs_cs.py +0 -202
- egse/tcs/tcs_devif.py +0 -292
- egse/tcs/tcs_protocol.py +0 -180
- egse/tcs/tcs_sim.py +0 -177
- egse/tcs/tcs_ui.py +0 -543
- egse/tdms.py +0 -171
- egse/tempcontrol/__init__.py +0 -23
- egse/tempcontrol/agilent/agilent34970.py +0 -109
- egse/tempcontrol/agilent/agilent34970.yaml +0 -44
- egse/tempcontrol/agilent/agilent34970_cs.py +0 -114
- egse/tempcontrol/agilent/agilent34970_devif.py +0 -182
- egse/tempcontrol/agilent/agilent34970_protocol.py +0 -96
- egse/tempcontrol/agilent/agilent34972.py +0 -111
- egse/tempcontrol/agilent/agilent34972.yaml +0 -44
- egse/tempcontrol/agilent/agilent34972_cs.py +0 -115
- egse/tempcontrol/agilent/agilent34972_devif.py +0 -189
- egse/tempcontrol/agilent/agilent34972_protocol.py +0 -98
- egse/tempcontrol/beaglebone/beaglebone.py +0 -341
- egse/tempcontrol/beaglebone/beaglebone.yaml +0 -110
- egse/tempcontrol/beaglebone/beaglebone_cs.py +0 -117
- egse/tempcontrol/beaglebone/beaglebone_protocol.py +0 -134
- egse/tempcontrol/beaglebone/beaglebone_ui.py +0 -674
- egse/tempcontrol/digalox/digalox.py +0 -115
- egse/tempcontrol/digalox/digalox.yaml +0 -36
- egse/tempcontrol/digalox/digalox_cs.py +0 -108
- egse/tempcontrol/digalox/digalox_protocol.py +0 -56
- egse/tempcontrol/keithley/__init__.py +0 -33
- egse/tempcontrol/keithley/daq6510.py +0 -662
- egse/tempcontrol/keithley/daq6510.yaml +0 -105
- egse/tempcontrol/keithley/daq6510_cs.py +0 -163
- egse/tempcontrol/keithley/daq6510_devif.py +0 -343
- egse/tempcontrol/keithley/daq6510_protocol.py +0 -79
- egse/tempcontrol/keithley/daq6510_sim.py +0 -186
- egse/tempcontrol/lakeshore/__init__.py +0 -33
- egse/tempcontrol/lakeshore/lsci.py +0 -361
- egse/tempcontrol/lakeshore/lsci.yaml +0 -162
- egse/tempcontrol/lakeshore/lsci_cs.py +0 -174
- egse/tempcontrol/lakeshore/lsci_devif.py +0 -292
- egse/tempcontrol/lakeshore/lsci_protocol.py +0 -76
- egse/tempcontrol/lakeshore/lsci_ui.py +0 -387
- egse/tempcontrol/ni/__init__.py +0 -0
- egse/tempcontrol/spid/spid.py +0 -109
- egse/tempcontrol/spid/spid.yaml +0 -81
- egse/tempcontrol/spid/spid_controller.py +0 -279
- egse/tempcontrol/spid/spid_cs.py +0 -136
- egse/tempcontrol/spid/spid_protocol.py +0 -107
- egse/tempcontrol/spid/spid_ui.py +0 -723
- egse/tempcontrol/srs/__init__.py +0 -22
- egse/tempcontrol/srs/ptc10.py +0 -867
- egse/tempcontrol/srs/ptc10.yaml +0 -227
- egse/tempcontrol/srs/ptc10_cs.py +0 -128
- egse/tempcontrol/srs/ptc10_devif.py +0 -116
- egse/tempcontrol/srs/ptc10_protocol.py +0 -39
- egse/tempcontrol/srs/ptc10_ui.py +0 -906
- egse/ups/apc/apc.py +0 -236
- egse/ups/apc/apc.yaml +0 -45
- egse/ups/apc/apc_cs.py +0 -101
- egse/ups/apc/apc_protocol.py +0 -125
- egse/user.yaml +0 -7
- egse/vacuum/beaglebone/beaglebone.py +0 -149
- egse/vacuum/beaglebone/beaglebone.yaml +0 -44
- egse/vacuum/beaglebone/beaglebone_cs.py +0 -108
- egse/vacuum/beaglebone/beaglebone_devif.py +0 -159
- egse/vacuum/beaglebone/beaglebone_protocol.py +0 -192
- egse/vacuum/beaglebone/beaglebone_ui.py +0 -638
- egse/vacuum/instrutech/igm402.py +0 -91
- egse/vacuum/instrutech/igm402.yaml +0 -90
- egse/vacuum/instrutech/igm402_controller.py +0 -124
- egse/vacuum/instrutech/igm402_cs.py +0 -108
- egse/vacuum/instrutech/igm402_interface.py +0 -49
- egse/vacuum/instrutech/igm402_simulator.py +0 -36
- egse/vacuum/keller/kellerBus.py +0 -256
- egse/vacuum/keller/leo3.py +0 -100
- egse/vacuum/keller/leo3.yaml +0 -38
- egse/vacuum/keller/leo3_controller.py +0 -81
- egse/vacuum/keller/leo3_cs.py +0 -101
- egse/vacuum/keller/leo3_interface.py +0 -33
- egse/vacuum/mks/evision.py +0 -86
- egse/vacuum/mks/evision.yaml +0 -75
- egse/vacuum/mks/evision_cs.py +0 -101
- egse/vacuum/mks/evision_devif.py +0 -313
- egse/vacuum/mks/evision_interface.py +0 -60
- egse/vacuum/mks/evision_simulator.py +0 -24
- egse/vacuum/mks/evision_ui.py +0 -701
- egse/vacuum/pfeiffer/acp40.py +0 -87
- egse/vacuum/pfeiffer/acp40.yaml +0 -60
- egse/vacuum/pfeiffer/acp40_controller.py +0 -117
- egse/vacuum/pfeiffer/acp40_cs.py +0 -109
- egse/vacuum/pfeiffer/acp40_interface.py +0 -40
- egse/vacuum/pfeiffer/acp40_simulator.py +0 -37
- egse/vacuum/pfeiffer/tc400.py +0 -87
- egse/vacuum/pfeiffer/tc400.yaml +0 -83
- egse/vacuum/pfeiffer/tc400_controller.py +0 -136
- egse/vacuum/pfeiffer/tc400_cs.py +0 -109
- egse/vacuum/pfeiffer/tc400_interface.py +0 -70
- egse/vacuum/pfeiffer/tc400_simulator.py +0 -35
- egse/vacuum/pfeiffer/tpg261.py +0 -80
- egse/vacuum/pfeiffer/tpg261.yaml +0 -66
- egse/vacuum/pfeiffer/tpg261_controller.py +0 -150
- egse/vacuum/pfeiffer/tpg261_cs.py +0 -109
- egse/vacuum/pfeiffer/tpg261_interface.py +0 -59
- egse/vacuum/pfeiffer/tpg261_simulator.py +0 -23
- egse/version.py +0 -174
- egse/visitedpositions.py +0 -398
- egse/windowing.py +0 -213
- egse/zmq/__init__.py +0 -28
- egse/zmq/spw.py +0 -160
- egse/zmq_ser.py +0 -41
- scripts/alerts/cold.yaml +0 -278
- scripts/alerts/example_alerts.yaml +0 -54
- scripts/alerts/transition.yaml +0 -14
- scripts/alerts/warm.yaml +0 -49
- scripts/analyse_n_fee_hk_data.py +0 -52
- scripts/check_hdf5_files.py +0 -192
- scripts/check_register_sync.py +0 -47
- scripts/check_tcs_calib_coef.py +0 -90
- scripts/correct_ccd_cold_temperature_cal.py +0 -157
- scripts/create_hdf5_report.py +0 -293
- scripts/csl_model.py +0 -420
- scripts/csl_restore_setup.py +0 -229
- scripts/export-grafana-dashboards.py +0 -49
- scripts/fdir/cs_recovery/fdir_cs_recovery.py +0 -54
- scripts/fdir/fdir_table.yaml +0 -70
- scripts/fdir/fdir_test_recovery.py +0 -10
- scripts/fdir/hw_recovery/fdir_agilent_hw_recovery.py +0 -73
- scripts/fdir/limit_recovery/fdir_agilent_limit.py +0 -61
- scripts/fdir/limit_recovery/fdir_bb_heater_limit.py +0 -59
- scripts/fdir/limit_recovery/fdir_ensemble_limit.py +0 -33
- scripts/fdir/limit_recovery/fdir_pressure_limit_recovery.py +0 -71
- scripts/fix_csv.py +0 -80
- scripts/ias/correct_ccd_temp_cal_elfique.py +0 -43
- scripts/ias/correct_ccd_temp_cal_floreffe.py +0 -43
- scripts/ias/correct_trp_swap_achel.py +0 -199
- scripts/inta/correct_ccd_temp_cal_duvel.py +0 -43
- scripts/inta/correct_ccd_temp_cal_gueuze.py +0 -43
- scripts/n_fee_supply_voltage_calculation.py +0 -92
- scripts/playground.py +0 -30
- scripts/print_hdf5_hk_data.py +0 -68
- scripts/print_register_map.py +0 -43
- scripts/remove_lines_between_matches.py +0 -188
- scripts/sron/commanding/control_heaters.py +0 -44
- scripts/sron/commanding/pumpdown.py +0 -46
- scripts/sron/commanding/set_pid_setpoint.py +0 -19
- scripts/sron/commanding/shutdown_bbb_heaters.py +0 -10
- scripts/sron/commanding/shutdown_pumps.py +0 -33
- scripts/sron/correct_mgse_coordinates_brigand_chimay.py +0 -272
- scripts/sron/correct_trp_swap_brigand.py +0 -204
- scripts/sron/gimbal_conversions.py +0 -75
- scripts/sron/tm_gen/tm_gen_agilent.py +0 -37
- scripts/sron/tm_gen/tm_gen_heaters.py +0 -4
- scripts/sron/tm_gen/tm_gen_spid.py +0 -13
- scripts/update_operational_cgse.py +0 -268
- scripts/update_operational_cgse_old.py +0 -273
|
@@ -1,1387 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module provides the implementation of the commanding interfaces for the Alpha and Alpha+
|
|
3
|
-
controller using the new dynamic commanding scheme. The three main classes are the `AlphaPlusTelnetInterface`,
|
|
4
|
-
the `AlphaControllerInterface` and the `AlphaPlusControllerInterface`.
|
|
5
|
-
|
|
6
|
-
The `AlphaPlusTelnetInterface` directly talks to the device through the telnet protocol on port 23.
|
|
7
|
-
|
|
8
|
-
The `AlphaControllerInterface` provides an interface with methods that are compatible with both the Alpha controller
|
|
9
|
-
and the AlphaPlusController. This interface shall be sub-classed for proxy and controller classes that use the
|
|
10
|
-
alpha controller, like the PUNA Hexapod.
|
|
11
|
-
|
|
12
|
-
The `AlphaPlusControllerInterface` inherits from the `AlphaControllerInterface` and provides additional methods
|
|
13
|
-
that are specific for the alpha+ controllers. This class should be sub-classed for proxy and controller classes
|
|
14
|
-
that use the alpha+ controller, like the ZONDA hexapod.
|
|
15
|
-
|
|
16
|
-
"""
|
|
17
|
-
from __future__ import annotations
|
|
18
|
-
|
|
19
|
-
import logging
|
|
20
|
-
from functools import partial
|
|
21
|
-
from telnetlib import Telnet
|
|
22
|
-
from typing import Any
|
|
23
|
-
from typing import Callable
|
|
24
|
-
from typing import Dict
|
|
25
|
-
from typing import List
|
|
26
|
-
from typing import Tuple
|
|
27
|
-
|
|
28
|
-
import egse.logger
|
|
29
|
-
from egse.control import Failure
|
|
30
|
-
from egse.control import Success
|
|
31
|
-
from egse.device import DeviceConnectionError
|
|
32
|
-
from egse.device import DeviceConnectionInterface
|
|
33
|
-
from egse.device import DeviceInterface
|
|
34
|
-
from egse.device import DeviceTransport
|
|
35
|
-
from egse.mixin import add_cr_lf
|
|
36
|
-
from egse.mixin import dynamic_command
|
|
37
|
-
from egse.settings import Settings
|
|
38
|
-
from egse.system import Timer
|
|
39
|
-
from egse.system import wait_until
|
|
40
|
-
|
|
41
|
-
LOGGER = logging.getLogger(__name__)
|
|
42
|
-
PUNA_PLUS = Settings.load("PUNA Alpha+ Controller")
|
|
43
|
-
|
|
44
|
-
# The following constants represent the index into the GENERAL_STATE list and are used in the code
|
|
45
|
-
# to match the name of a flag in the general_state.
|
|
46
|
-
|
|
47
|
-
HOME_COMPLETE = 6
|
|
48
|
-
IN_POSITION = 3
|
|
49
|
-
IN_MOTION = 4
|
|
50
|
-
|
|
51
|
-
GENERAL_STATE = [
|
|
52
|
-
"Error",
|
|
53
|
-
"System initialized",
|
|
54
|
-
"Control on",
|
|
55
|
-
"In position",
|
|
56
|
-
"Motion task running",
|
|
57
|
-
"Home task running",
|
|
58
|
-
"Home complete",
|
|
59
|
-
"Home virtual",
|
|
60
|
-
"Phase found",
|
|
61
|
-
"Brake on",
|
|
62
|
-
"Motion restricted",
|
|
63
|
-
"Power on encoders",
|
|
64
|
-
"Power on limit switches",
|
|
65
|
-
"Power on drives",
|
|
66
|
-
"Emergency stop",
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
ACTUATOR_STATE = [
|
|
71
|
-
"Error",
|
|
72
|
-
"Control on",
|
|
73
|
-
"In position",
|
|
74
|
-
"Motion task running",
|
|
75
|
-
"Home task running",
|
|
76
|
-
"Home complete",
|
|
77
|
-
"Phase found",
|
|
78
|
-
"Brake on",
|
|
79
|
-
"Home hardware input",
|
|
80
|
-
"Negative hardware limit switch",
|
|
81
|
-
"Positive hardware limit switch",
|
|
82
|
-
"Software limit reached",
|
|
83
|
-
"Following error",
|
|
84
|
-
"Drive fault",
|
|
85
|
-
"Encoder error",
|
|
86
|
-
]
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
ERROR_CODES = {
|
|
90
|
-
1: "An emergency stop has been pressed.",
|
|
91
|
-
2: "A safety input has been triggered. The status of the inputs is given in the DATA field.",
|
|
92
|
-
3: "A temperature sensor has exceeded the limit threshold. Sensor number is given in DATA field.",
|
|
93
|
-
4: "Controller system status error (Sys.Status).",
|
|
94
|
-
5: "Controller ‘abort all’ input has been triggered. (Sys.AbortAll).",
|
|
95
|
-
6: "Controller watchdog error (Sys.WDTFault).",
|
|
96
|
-
7: "Configuration load error.",
|
|
97
|
-
8: "Configuration failed: a wrong hexapod ID has been detected. Detected ID is given in DATA field.",
|
|
98
|
-
9: "Home task has failed.",
|
|
99
|
-
10: "Virtual home write task has failed.",
|
|
100
|
-
11: "The motion program did not start in the defined timeout.",
|
|
101
|
-
12: "The home task did not start in the defined timeout.",
|
|
102
|
-
13: "A kinematic error has occurred. Kinematic error number is given in DATA field.",
|
|
103
|
-
14: "Controller coordinate error status (Coord.ErrorStatus). Error number is given in DATA field.",
|
|
104
|
-
15: "An error has been detected on encoder.",
|
|
105
|
-
16: "Brake should have been engaged as the motor control was off.",
|
|
106
|
-
17: "Controller motor status: Auxiliary fault (AuxFault).",
|
|
107
|
-
18: "Controller motor status: Encoder loss (EncLoss).",
|
|
108
|
-
19: "Controller motor status: Amplifier warning (AmpWarn).",
|
|
109
|
-
20: "Controller motor status: Trigger not found (TriggerNotFound).",
|
|
110
|
-
21: "Controller motor status: Integrated current 'I2T' fault (I2tFault).",
|
|
111
|
-
22: "Controller motor status: Software positive limit reach (SoftPlusLimit).",
|
|
112
|
-
23: "Controller motor status: Software negative limit reach (SoftMinusLimit).",
|
|
113
|
-
24: "Controller motor status: Amplifier fault (AmpFault).",
|
|
114
|
-
25: "Controller motor status: Stopped on hardware limit (LimitStop).",
|
|
115
|
-
26: "Controller motor status: Fatal following error (FeFatal).",
|
|
116
|
-
27: "Controller motor status: Warning following error (FeWarn).",
|
|
117
|
-
28: "Controller motor status: Hardware positive limit reach (PlusLimit).",
|
|
118
|
-
29: "Controller motor status: Hardware negative limit reach (MinusLimit).",
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
RETURN_CODES = {
|
|
123
|
-
0: "Success.",
|
|
124
|
-
-1: "Undefined error.",
|
|
125
|
-
-10: "Wrong value for parameter at index 0.",
|
|
126
|
-
-11: "Wrong value for parameter at index 1.",
|
|
127
|
-
-12: "Wrong value for parameter at index 2.",
|
|
128
|
-
-13: "Wrong value for parameter at index 3.",
|
|
129
|
-
-14: "Wrong value for parameter at index 4.",
|
|
130
|
-
-15: "Wrong value for parameter at index 5.",
|
|
131
|
-
-16: "Wrong value for parameter at index 6.",
|
|
132
|
-
-17: "Wrong value for parameter at index 7.",
|
|
133
|
-
-18: "Wrong value for parameter at index 8.",
|
|
134
|
-
-19: "Wrong value for parameter at index 9.",
|
|
135
|
-
-20: "Wrong value for parameter at index 10.",
|
|
136
|
-
-21: "Wrong value for parameter at index 11.",
|
|
137
|
-
-22: "Wrong value for parameter at index 12.",
|
|
138
|
-
-23: "Wrong value for parameter at index 13.",
|
|
139
|
-
-24: "Wrong value for parameter at index 14.",
|
|
140
|
-
-25: "Wrong value for parameter at index 15.",
|
|
141
|
-
-26: "Wrong value for parameter at index 16.",
|
|
142
|
-
-27: "Wrong value for parameter at index 17.",
|
|
143
|
-
-28: "Wrong value for parameter at index 18.",
|
|
144
|
-
-29: "Wrong value for parameter at index 19.",
|
|
145
|
-
-30: "Unknown command number.",
|
|
146
|
-
-31: "This configuration command is a 'get' only type.",
|
|
147
|
-
-32: "This configuration command is a 'set' only type.",
|
|
148
|
-
-33: "The axis number do not correspond to an axis defined on the controller.",
|
|
149
|
-
-34: "A stop task is running.",
|
|
150
|
-
-35: "All motors need to be control on.",
|
|
151
|
-
-36: "All motors need to be control off.",
|
|
152
|
-
-37: "Emergency stop is pressed.",
|
|
153
|
-
-38: "A motion task is running.",
|
|
154
|
-
-39: "A home task is running.",
|
|
155
|
-
-40: "Requested move is not feasible.",
|
|
156
|
-
-41: "Power supply of limit switches is off.",
|
|
157
|
-
-42: "Power supply of encoders is off.",
|
|
158
|
-
-43: "A fatal error is present. This type of error needs a controller restart to be removed.",
|
|
159
|
-
-44: "An error is present, error reset is required.",
|
|
160
|
-
-45: "Home is not completed.",
|
|
161
|
-
-46: "Software option not available (can be linked to hardware configuration).",
|
|
162
|
-
-47: "Virtual home: file was created on another controller (different MAC address).",
|
|
163
|
-
-48: "Virtual home: some positions read in file are out of software limits.",
|
|
164
|
-
-49: "Virtual home: file data were stored while hexapod was moving.",
|
|
165
|
-
-50: "Virtual home: no data available.",
|
|
166
|
-
-51: "Command has been rejected because another action is running.",
|
|
167
|
-
-52: "Timeout waiting for home complete status.",
|
|
168
|
-
-53: "Timeout waiting for control on status.",
|
|
169
|
-
-54: "Timeout on motion program start.",
|
|
170
|
-
-55: "Timeout on home task start.",
|
|
171
|
-
-56: "Timeout on virtual home write file task.",
|
|
172
|
-
-57: "Timeout on virtual home delete file task.",
|
|
173
|
-
-58: "Timeout on virtual home read file task.",
|
|
174
|
-
-59: "Timeout on disk access verification task.",
|
|
175
|
-
-60: "Configuration file: save process failed.",
|
|
176
|
-
-61: "Configuration file: loaded file is empty.",
|
|
177
|
-
-62: "Configuration file: loaded data are corrupted.",
|
|
178
|
-
-63: "No access to the memory disk.",
|
|
179
|
-
-64: "File does not exist.",
|
|
180
|
-
-65: "Folder access failed.",
|
|
181
|
-
-66: "Creation of folder tree on the memory disk failed.",
|
|
182
|
-
-67: "Generation or write of the checksum failed.",
|
|
183
|
-
-68: "File read: no data or wrong data size.",
|
|
184
|
-
-69: "File read: no checksum.",
|
|
185
|
-
-70: "File read: incorrect checksum.",
|
|
186
|
-
-71: "File write: failed.",
|
|
187
|
-
-72: "File open: failed.",
|
|
188
|
-
-73: "File delete: failed.",
|
|
189
|
-
-74: "Get MAC address failed.",
|
|
190
|
-
-75: "NaN (Not a Number) or infinite value found.",
|
|
191
|
-
-76: "The coordinate system transformations are not initialized.",
|
|
192
|
-
-77: "A kinematic error is present.",
|
|
193
|
-
-78: "The motor phase process failed (phase search or phase set from position offset).",
|
|
194
|
-
-79: "The motor phase is not found.",
|
|
195
|
-
-80: "Timeout waiting for control off status.",
|
|
196
|
-
-81: "The requested kinematic mode (number) is not defined for the machine.",
|
|
197
|
-
-82: "Timeout waiting for phase found status.",
|
|
198
|
-
-1000: "Internal error: 'RET_Dev_CfS_NaNReturned'.",
|
|
199
|
-
-1001: "Internal error: 'RET_Dev_CfS_FctNotAvailableInKernel'.",
|
|
200
|
-
-1002: "Internal error: 'RET_Dev_CfS_UndefinedCfSType'.",
|
|
201
|
-
-1003: "Internal error: 'RET_Dev_CfS_FIO_UndefinedFioType'.",
|
|
202
|
-
-1004: "Internal error: 'RET_Dev_CfS_FIO_HomeFile_UndefinedAction'.",
|
|
203
|
-
-1005: "Internal error: 'RET_Dev_UndefinedEnumValue'.",
|
|
204
|
-
-1006: "Internal error: 'RET_Dev_LdataCmdStatusIsNegative'.",
|
|
205
|
-
-1007: "Internal error: 'RET_Dev_NumMotorsInCoord_Sup_DEF_aGrQ_SIZE'.",
|
|
206
|
-
-1008: "Internal error: 'RET_Dev_NumMotorsInCoord_WrongNumber'.",
|
|
207
|
-
-1009: "Internal error: 'RET_String_StrCat_DestSizeReached'.",
|
|
208
|
-
-1010: "Internal error: 'RET_String_LengthOverStringSize'.",
|
|
209
|
-
-1011: "Internal error: 'RET_String_AllCharShouldIntBetween_0_255'.",
|
|
210
|
-
-1012: "Internal error: 'RET_String_StrCpy_DestSizeReached'.",
|
|
211
|
-
-1013: "Internal error: 'RET_ErrAction_HomeReset'.",
|
|
212
|
-
-1014: "Internal error: 'RET_Home_StopReceivedWhileRunning'.",
|
|
213
|
-
-1015: "Internal error: 'RET_UndefinedKinAssembly'.",
|
|
214
|
-
-1016: "Internal error: 'RET_WrongPmcConfig'.",
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
VALIDATION_LIMITS = [
|
|
219
|
-
"Factory workspace limits",
|
|
220
|
-
"Machine workspace limits",
|
|
221
|
-
"User workspace limits",
|
|
222
|
-
"Actuator limits",
|
|
223
|
-
"Joints limits",
|
|
224
|
-
"Due to backlash compensation",
|
|
225
|
-
]
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
def process_cmd_string(command: str) -> str:
|
|
229
|
-
"""
|
|
230
|
-
Prepares the command string for sending to the controller.
|
|
231
|
-
A carriage return and newline is appended to the command.
|
|
232
|
-
"""
|
|
233
|
-
|
|
234
|
-
return add_cr_lf(command)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
def wait_until_cmd_is_zero(transport: DeviceTransport, timeout: float = 1.0, interval: float = 0.01):
|
|
238
|
-
"""
|
|
239
|
-
Waits until the `cmd` register is 0 (zero) and returns successfully if it does.
|
|
240
|
-
When the `cmd` register doesn't turn zero within the given timeout, a Failure is returned.
|
|
241
|
-
"""
|
|
242
|
-
rc = 0
|
|
243
|
-
|
|
244
|
-
def c_cmd():
|
|
245
|
-
nonlocal rc
|
|
246
|
-
rc_s = transport.query('c_cmd\r\n').decode()
|
|
247
|
-
LOGGER.debug(f"{rc_s = } <- c_cmd in get_pars")
|
|
248
|
-
if not rc_s.startswith('c_cmd'):
|
|
249
|
-
LOGGER.warning(f"{rc_s = }")
|
|
250
|
-
return -1
|
|
251
|
-
rc = int(rc_s.split('\r\n')[1])
|
|
252
|
-
return rc
|
|
253
|
-
|
|
254
|
-
if wait_until(lambda: c_cmd() == 0, interval=interval, timeout=timeout):
|
|
255
|
-
try:
|
|
256
|
-
LOGGER.warning(f"Command check timed out: {RETURN_CODES[rc]} [{rc=}]")
|
|
257
|
-
return Failure(f"Command check resulted in the following error: {RETURN_CODES[rc]}")
|
|
258
|
-
except KeyError:
|
|
259
|
-
return Failure(f"Command check resulted in an unknown error code: {rc = }.")
|
|
260
|
-
|
|
261
|
-
return Success("Command finished successfully")
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
def get_pars(
|
|
265
|
-
transport: DeviceTransport = None, response: bytes = None,
|
|
266
|
-
index: int = 0, count: int = 1, increment: int = 1, timeout: float = 1.0, interval: float = 0.01
|
|
267
|
-
) -> bytes | Failure:
|
|
268
|
-
"""
|
|
269
|
-
Retrieve the response from a given command from the `c_par` array. The `c_par` array will
|
|
270
|
-
contain the correct values only after the `cmd` register is 0 (zero). So, we will wait until
|
|
271
|
-
`cmd` becomes 0, then retrieve the requested parameters from the `c_par` array and return
|
|
272
|
-
them as a normal response to be processed.
|
|
273
|
-
|
|
274
|
-
This function is intended to be used as a `post_cmd` function in the dynamic command decorator.
|
|
275
|
-
|
|
276
|
-
Args:
|
|
277
|
-
transport: the transport interface to communicate with the device
|
|
278
|
-
response: the response from the actual command that was sent
|
|
279
|
-
index: starting index for the `c_par` array
|
|
280
|
-
count: the number of c_par values to retrieve
|
|
281
|
-
increment: the increment in the c_par array
|
|
282
|
-
timeout: the timeout period while waiting for the `cmd` to become 0
|
|
283
|
-
interval: the sampling interval for the `cmd`
|
|
284
|
-
|
|
285
|
-
Returns:
|
|
286
|
-
The requested values from the `c_par` array as a string. This string can be decoded with
|
|
287
|
-
the `decode_pars()` function.
|
|
288
|
-
"""
|
|
289
|
-
|
|
290
|
-
if transport is None:
|
|
291
|
-
raise RuntimeError("no device transport was passed into the function!")
|
|
292
|
-
|
|
293
|
-
rc = wait_until_cmd_is_zero(transport=transport, interval=interval, timeout=timeout)
|
|
294
|
-
if isinstance(rc, Failure):
|
|
295
|
-
return rc
|
|
296
|
-
|
|
297
|
-
# The string 'c_par(0),1,1' is considered illegal.
|
|
298
|
-
|
|
299
|
-
if count == 1 and increment == 1:
|
|
300
|
-
query = f"c_par({index})"
|
|
301
|
-
else:
|
|
302
|
-
query = f"c_par({index}),{count},{increment}"
|
|
303
|
-
|
|
304
|
-
response = transport.query(f'{query}\r\n')
|
|
305
|
-
|
|
306
|
-
LOGGER.debug(f"{response = } <- {query} in get_pars")
|
|
307
|
-
|
|
308
|
-
return response
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
def return_command_status(transport: DeviceTransport = None, response: bytes = None,
|
|
312
|
-
timeout: float = 1.0, interval: float = 0.01) -> Tuple[int, str] | Failure:
|
|
313
|
-
"""
|
|
314
|
-
Check the status of last sent command. When the status is zero (0) the command was successfully executed.
|
|
315
|
-
When the status is not zero before timeout seconds, the status check will be aborted and the function
|
|
316
|
-
will then return the latest status code from the `c_cmd` variable.
|
|
317
|
-
|
|
318
|
-
Note: This function shall be used as a `post_cmd` callable in the dynamic_command decorator and the process_response
|
|
319
|
-
shall not be used in conjunction with this command.
|
|
320
|
-
|
|
321
|
-
Args:
|
|
322
|
-
transport: the device transport that can be used send additional commands to the device
|
|
323
|
-
response: The response from the command that was sent to the device (ignored by this function)
|
|
324
|
-
timeout: number of seconds before a timeout will occur
|
|
325
|
-
interval: sleep time between checks for the status condition
|
|
326
|
-
|
|
327
|
-
Returns:
|
|
328
|
-
The status of the last sent command as a tuple (status code, description).
|
|
329
|
-
|
|
330
|
-
Raises:
|
|
331
|
-
A RuntimeError is raised when no device transport is passed into this function.
|
|
332
|
-
"""
|
|
333
|
-
|
|
334
|
-
# The response argument is ignored in this function as it generates a new response from the
|
|
335
|
-
# command return code.
|
|
336
|
-
|
|
337
|
-
if transport is None:
|
|
338
|
-
raise RuntimeError("no device transport was passed into the function!")
|
|
339
|
-
|
|
340
|
-
rc = 0
|
|
341
|
-
|
|
342
|
-
def c_cmd():
|
|
343
|
-
nonlocal rc
|
|
344
|
-
rc_s = transport.query('c_cmd\r\n').decode()
|
|
345
|
-
LOGGER.debug(f"{rc_s = } <- c_cmd in check_command_status")
|
|
346
|
-
if not rc_s.startswith('c_cmd'):
|
|
347
|
-
LOGGER.warning(f"{rc_s = }")
|
|
348
|
-
return -1
|
|
349
|
-
rc = int(rc_s.split('\r\n')[1])
|
|
350
|
-
return rc
|
|
351
|
-
|
|
352
|
-
if wait_until(lambda: c_cmd() == 0, interval=interval, timeout=timeout):
|
|
353
|
-
LOGGER.warning(f"Command check: {RETURN_CODES[rc]} [{rc}]")
|
|
354
|
-
else:
|
|
355
|
-
LOGGER.debug("Success!")
|
|
356
|
-
rc = 0
|
|
357
|
-
|
|
358
|
-
return rc, RETURN_CODES[rc]
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
def check_command_status(transport: DeviceTransport = None, response: bytes = None,
|
|
362
|
-
timeout: float = 1.0, interval: float = 0.01) -> Any:
|
|
363
|
-
"""
|
|
364
|
-
Check the state of last sent command. When the state is zero (0) the command was successfully executed. When the
|
|
365
|
-
status is not zero before timeout seconds, the status check will be aborted and a warning message will be issued.
|
|
366
|
-
This function will then return a Failure containing the latest status code from the `c_cmd` variable.
|
|
367
|
-
|
|
368
|
-
The status can take the following values:
|
|
369
|
-
|
|
370
|
-
* > 1: a new command has been written but has not yet been interpreted by the communication application
|
|
371
|
-
* = 1: the last written command is currently under execution
|
|
372
|
-
* = 0: the last command was successfully executed
|
|
373
|
-
* < 0: the last command failed. This status code can be used to determine the cause of the error from
|
|
374
|
-
the RETURN_CODES variable in this module.
|
|
375
|
-
|
|
376
|
-
Note: This function shall be used as a `post_cmd` callable in the dynamic_command decorator.
|
|
377
|
-
|
|
378
|
-
Args:
|
|
379
|
-
transport: the device transport that can be used send additional commands to the device
|
|
380
|
-
response: The response from the command that was sent to the device
|
|
381
|
-
timeout: number of seconds before a timeout will occur
|
|
382
|
-
interval: sleep time between checks for the status condition
|
|
383
|
-
|
|
384
|
-
Returns:
|
|
385
|
-
This function passes through the response without change. When the status check timed out
|
|
386
|
-
a Failure will be returned with an associated error message.
|
|
387
|
-
|
|
388
|
-
Raises:
|
|
389
|
-
A RuntimeError is raised when no device transport is passed into this function.
|
|
390
|
-
"""
|
|
391
|
-
if transport is None:
|
|
392
|
-
raise RuntimeError("no device transport was passed into the function!")
|
|
393
|
-
|
|
394
|
-
rc = wait_until_cmd_is_zero(transport=transport, interval=interval, timeout=timeout)
|
|
395
|
-
return rc if isinstance(rc, Failure) else response
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
def decode_response(response: bytes) -> str | Failure:
|
|
399
|
-
"""Decodes the bytes object, strips off the trailing 'CRLF'."""
|
|
400
|
-
|
|
401
|
-
LOGGER.debug(f"{response = } <- decode_response")
|
|
402
|
-
|
|
403
|
-
return response.decode().rstrip()
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
def validate_response(response: str, cmd: str = None) -> List[str] | Failure:
|
|
407
|
-
"""
|
|
408
|
-
Performs a number of checks on the response string and returns the response as a list of strings.
|
|
409
|
-
The command string (which is the first part of the device response) is removed from the returned list.
|
|
410
|
-
|
|
411
|
-
Args:
|
|
412
|
-
response: decoded response from the device
|
|
413
|
-
cmd: the command string that is returned by the device
|
|
414
|
-
|
|
415
|
-
Returns:
|
|
416
|
-
A list of strings containing the split response without the first item (which was the command string).
|
|
417
|
-
If the response contains the string 'error #', a Failure will be returned with the error message.
|
|
418
|
-
If the response doesn't start with the given command string (when cmd != None), a Failure is returned.
|
|
419
|
-
"""
|
|
420
|
-
if "error #" in response:
|
|
421
|
-
msg = response.split("\r\n")[-1] # this will strip off the cmd part of the response
|
|
422
|
-
return Failure(msg)
|
|
423
|
-
|
|
424
|
-
if cmd is not None and not response.startswith(cmd):
|
|
425
|
-
return Failure(f"Unexpected response from '{cmd}' command: {response}")
|
|
426
|
-
|
|
427
|
-
LOGGER.debug(f"{response = } <- validate_response")
|
|
428
|
-
|
|
429
|
-
return response.split("\r\n")[1:]
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
def process_response(response: bytes, cmd: str = None) -> List[str] | Failure:
|
|
433
|
-
"""This function is a shortcut for decode_response() and validate_response()."""
|
|
434
|
-
|
|
435
|
-
# You might think this shortcut is really useless and doesn't give us anything,
|
|
436
|
-
# the thing is that this function is used in the decorator, which is not possible
|
|
437
|
-
# for each function individually.
|
|
438
|
-
|
|
439
|
-
return validate_response(decode_response(response), cmd)
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
def process_validate_ptp(response: bytes) -> Tuple[int, Dict[int, str]] | Failure:
|
|
443
|
-
"""
|
|
444
|
-
The response is in this case the value of 'c_par(0)' which is returned by the `post_cmd` function `get_pars`.
|
|
445
|
-
|
|
446
|
-
Args:
|
|
447
|
-
response:
|
|
448
|
-
|
|
449
|
-
Returns:
|
|
450
|
-
|
|
451
|
-
"""
|
|
452
|
-
response = process_response(response)
|
|
453
|
-
|
|
454
|
-
if isinstance(response, Failure):
|
|
455
|
-
return response
|
|
456
|
-
|
|
457
|
-
response = int(response[0])
|
|
458
|
-
|
|
459
|
-
if response == 0:
|
|
460
|
-
return 0, {}
|
|
461
|
-
|
|
462
|
-
if response > 0:
|
|
463
|
-
description = decode_validation_error(response)
|
|
464
|
-
return response, description
|
|
465
|
-
|
|
466
|
-
# When response is negative, the validation failed, and we extract the command return code
|
|
467
|
-
|
|
468
|
-
msg = f"{RETURN_CODES.get(response, 'unknown error code')}"
|
|
469
|
-
|
|
470
|
-
LOGGER.error(f"Validate position: error code={response} - {msg}")
|
|
471
|
-
|
|
472
|
-
return response, {response: msg}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
def issue_warning(*, response, msg: str):
|
|
476
|
-
LOGGER.warning(f"{msg} {response}")
|
|
477
|
-
return response
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
from typing import TypeVar
|
|
481
|
-
|
|
482
|
-
T = TypeVar('T', float, int) # Declare type variable
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
def decode_pars(response: bytes = None, index: int = 0, count: int = 1, func: Callable = float) -> List[T] | Failure:
|
|
486
|
-
response = process_response(response)
|
|
487
|
-
|
|
488
|
-
if isinstance(response, Failure):
|
|
489
|
-
return response
|
|
490
|
-
|
|
491
|
-
return [func(x) for x in response[index:index+count]]
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
def decode_info(response: bytes) -> str | Failure:
|
|
495
|
-
response = process_response(response)
|
|
496
|
-
|
|
497
|
-
if isinstance(response, Failure):
|
|
498
|
-
return response
|
|
499
|
-
|
|
500
|
-
LOGGER.debug(f"{response = } <- decode_info")
|
|
501
|
-
|
|
502
|
-
return (
|
|
503
|
-
f"Info about the Hexapod Alpha+ Controller:\n"
|
|
504
|
-
f" Software version = {response[1]}.{response[2]}.{response[3]}.{response[4]}\n"
|
|
505
|
-
f" API version = {response[5]}.{response[6]}.{response[7]}.{response[8]}\n"
|
|
506
|
-
f" System Configuration version = {response[11]}"
|
|
507
|
-
)
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
def decode_version(response: bytes) -> str | Failure:
|
|
511
|
-
response = validate_response(decode_response(response))
|
|
512
|
-
|
|
513
|
-
if isinstance(response, Failure):
|
|
514
|
-
return response
|
|
515
|
-
|
|
516
|
-
return f"{response[5]}.{response[6]}.{response[7]}.{response[8]}"
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
def decode_uto(response: bytes) -> List[float] | Failure:
|
|
520
|
-
response = validate_response(decode_response(response), "s_uto")
|
|
521
|
-
|
|
522
|
-
if isinstance(response, Failure):
|
|
523
|
-
return response
|
|
524
|
-
|
|
525
|
-
return [float(x) for x in response]
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
def decode_mtp(response: bytes) -> List[float] | Failure:
|
|
529
|
-
response = validate_response(decode_response(response), "s_mtp")
|
|
530
|
-
|
|
531
|
-
if isinstance(response, Failure):
|
|
532
|
-
return response
|
|
533
|
-
|
|
534
|
-
return [float(x) for x in response]
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
def decode_general_state(response: bytes) -> Tuple[Dict, List] | Failure:
|
|
538
|
-
response = validate_response(decode_response(response), "s_hexa")
|
|
539
|
-
|
|
540
|
-
if isinstance(response, Failure):
|
|
541
|
-
return response
|
|
542
|
-
|
|
543
|
-
response = int(response[0])
|
|
544
|
-
|
|
545
|
-
LOGGER.debug(f"{response = } <- decode_general_state")
|
|
546
|
-
|
|
547
|
-
s_hexa = [int(x) for x in f'{response:015b}'[::-1]]
|
|
548
|
-
state = dict(zip(GENERAL_STATE, s_hexa))
|
|
549
|
-
|
|
550
|
-
return state, list(state.values())
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
def decode_actuator_state(response: bytes) -> Tuple[Tuple[Dict, List]] | Failure:
|
|
554
|
-
response = validate_response(decode_response(response), "s_ax")
|
|
555
|
-
|
|
556
|
-
if isinstance(response, Failure):
|
|
557
|
-
return response
|
|
558
|
-
|
|
559
|
-
def decode_state(state: int) -> Tuple[Dict, List]:
|
|
560
|
-
state_bits = [int(x) for x in f'{state:015b}'[::-1]]
|
|
561
|
-
state_dict = dict(zip(ACTUATOR_STATE, state_bits))
|
|
562
|
-
return state_dict, state_bits
|
|
563
|
-
|
|
564
|
-
actuator_states = [int(x) for x in response]
|
|
565
|
-
|
|
566
|
-
return tuple(decode_state(state) for state in actuator_states)
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
def decode_validation_error(value) -> Dict:
|
|
570
|
-
"""
|
|
571
|
-
Decode the bitfield variable that is returned by the VALID_PTP command.
|
|
572
|
-
|
|
573
|
-
Each bit in this variable represents a particular error in the validation of a movement.
|
|
574
|
-
Several errors can be combined into the given variable.
|
|
575
|
-
|
|
576
|
-
Returns a dictionary with the bit numbers that were (on) and the corresponding error description.
|
|
577
|
-
"""
|
|
578
|
-
|
|
579
|
-
return {bit: VALIDATION_LIMITS[bit] for bit in range(6) if value >> bit & 0b01}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
class AlphaPlusTelnetInterface(DeviceTransport, DeviceConnectionInterface):
|
|
583
|
-
"""
|
|
584
|
-
The Hexapod controller device interface based on the telnet protocol. This class implements the
|
|
585
|
-
DeviceTransport protocol which provides the `read()`, `write()`, `trans()`, and `query()` methods.
|
|
586
|
-
"""
|
|
587
|
-
|
|
588
|
-
TELNET_TIMEOUT = 1.0
|
|
589
|
-
|
|
590
|
-
def __init__(self, hostname: str = 'localhost', port: int = 23):
|
|
591
|
-
"""
|
|
592
|
-
Args:
|
|
593
|
-
hostname (str): the IP address or fully qualified hostname of the OGSE hardware
|
|
594
|
-
controller. The default is 'localhost'.
|
|
595
|
-
port (int): the IP port number to connect to. The default is 23.
|
|
596
|
-
"""
|
|
597
|
-
super().__init__()
|
|
598
|
-
self.telnet = Telnet()
|
|
599
|
-
self._is_connected = False
|
|
600
|
-
self.hostname = hostname
|
|
601
|
-
self.port = port
|
|
602
|
-
|
|
603
|
-
def connect(self) -> None:
|
|
604
|
-
"""
|
|
605
|
-
Connects to the Alpha+ Controller using the Telnet protocol. After connection
|
|
606
|
-
the telnet session logs in with the username provided in the Settings under
|
|
607
|
-
the `PUNA Alpha+ Controller` group. The password for this login is also provided
|
|
608
|
-
in the Settings under the same group. Make sure their values are only given in
|
|
609
|
-
the local settings file, not the global settings.
|
|
610
|
-
|
|
611
|
-
After login, the `gpascii` command is started with the option `-2` as instructed
|
|
612
|
-
in the software manual of the controller. The first command sent then is the
|
|
613
|
-
`echo7` command, which configures the system to return variable numbers only,
|
|
614
|
-
not their variable names.
|
|
615
|
-
"""
|
|
616
|
-
try:
|
|
617
|
-
self.telnet.open(self.hostname, self.port)
|
|
618
|
-
except ConnectionRefusedError as exc:
|
|
619
|
-
raise DeviceConnectionError(
|
|
620
|
-
device_name="Alpha+ Controller",
|
|
621
|
-
message=f"Connection refused to {self.hostname} port {self.port}"
|
|
622
|
-
) from exc
|
|
623
|
-
|
|
624
|
-
try:
|
|
625
|
-
rc = self.telnet.read_until(b"login: ", timeout=self.TELNET_TIMEOUT)
|
|
626
|
-
# print(rc.decode(), flush=True, end="")
|
|
627
|
-
self.telnet.write(f"{PUNA_PLUS.user_name}\r\n".encode())
|
|
628
|
-
rc = self.telnet.read_until(b"Password: ", timeout=self.TELNET_TIMEOUT)
|
|
629
|
-
# print(rc.decode(), flush=True, end="")
|
|
630
|
-
self.telnet.write(f"{PUNA_PLUS.password}\r\n".encode())
|
|
631
|
-
rc = self.telnet.read_until(b"ppmac# ", timeout=self.TELNET_TIMEOUT)
|
|
632
|
-
# print(rc.decode(), flush=True, end="")
|
|
633
|
-
self.telnet.write(b"gpascii -2\r\n")
|
|
634
|
-
rc = self.telnet.read_until(b'\x06\r\n', timeout=self.TELNET_TIMEOUT)
|
|
635
|
-
# print(rc.decode(), flush=True, end="")
|
|
636
|
-
self.telnet.write(b"echo7\r\n")
|
|
637
|
-
rc = self.telnet.read_until(b'\x06\r\n', timeout=self.TELNET_TIMEOUT)
|
|
638
|
-
# print(rc.decode(), flush=True, end="")
|
|
639
|
-
except EOFError as exc:
|
|
640
|
-
raise DeviceConnectionError(
|
|
641
|
-
device_name="Alpha+ Controller",
|
|
642
|
-
message=f"Telnet connection closed for {self.hostname} port {self.port}"
|
|
643
|
-
) from exc
|
|
644
|
-
|
|
645
|
-
self._is_connected = True
|
|
646
|
-
|
|
647
|
-
def is_connected(self):
|
|
648
|
-
return self._is_connected
|
|
649
|
-
|
|
650
|
-
def disconnect(self):
|
|
651
|
-
rc = self.telnet.read_very_eager()
|
|
652
|
-
print(rc.decode(), flush=True, end="")
|
|
653
|
-
self.telnet.close()
|
|
654
|
-
self._is_connected = False
|
|
655
|
-
|
|
656
|
-
def reconnect(self):
|
|
657
|
-
|
|
658
|
-
if self._is_connected:
|
|
659
|
-
self.disconnect()
|
|
660
|
-
self.connect()
|
|
661
|
-
|
|
662
|
-
def trans(self, cmd: str) -> bytes:
|
|
663
|
-
"""
|
|
664
|
-
Send a command to the Aplha+ Controller and waits for a response.
|
|
665
|
-
The response is returned after the ACK is stripped off (see `read()` method).
|
|
666
|
-
|
|
667
|
-
Args:
|
|
668
|
-
cmd: a valid command string for the Alpha+ Controller
|
|
669
|
-
|
|
670
|
-
Returns:
|
|
671
|
-
The response from the controller on the command that was sent.
|
|
672
|
-
"""
|
|
673
|
-
self.write(cmd)
|
|
674
|
-
response = self.read()
|
|
675
|
-
|
|
676
|
-
LOGGER.debug(f"trans: {response = }")
|
|
677
|
-
|
|
678
|
-
return response
|
|
679
|
-
|
|
680
|
-
def read(self) -> bytes:
|
|
681
|
-
"""
|
|
682
|
-
Reads a response from the controller.
|
|
683
|
-
|
|
684
|
-
Note: The acknowledgement `\x06\r\n` is stripped from the response before it is
|
|
685
|
-
returned. If no ACK is present, a warning message will be logged.
|
|
686
|
-
|
|
687
|
-
Returns:
|
|
688
|
-
The response from the controller on a previously sent command.
|
|
689
|
-
"""
|
|
690
|
-
|
|
691
|
-
response = self.telnet.read_until(b'\x06\r\n', timeout=self.TELNET_TIMEOUT)
|
|
692
|
-
|
|
693
|
-
LOGGER.debug(f"read: {response = }")
|
|
694
|
-
|
|
695
|
-
if not response.endswith(b'\x06\r\n'):
|
|
696
|
-
LOGGER.warning(f"Expected ACK at the end of the response, {response = }")
|
|
697
|
-
return response
|
|
698
|
-
|
|
699
|
-
return response[:-3] # strip off the ACK
|
|
700
|
-
|
|
701
|
-
def write(self, cmd: str):
|
|
702
|
-
"""
|
|
703
|
-
Sends a command string to the Alpha+ Controller.
|
|
704
|
-
The command string shall not end with a CRLF, that is automatically appended
|
|
705
|
-
by this function.
|
|
706
|
-
|
|
707
|
-
Args:
|
|
708
|
-
cmd: a valid command string for the Alpha+ Controller
|
|
709
|
-
|
|
710
|
-
Returns:
|
|
711
|
-
Nothing is returned.
|
|
712
|
-
"""
|
|
713
|
-
LOGGER.debug(f"Executing: {cmd.rstrip()}")
|
|
714
|
-
self.telnet.write(cmd.encode())
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
class AlphaControllerInterface(DeviceInterface):
|
|
718
|
-
|
|
719
|
-
@dynamic_command(
|
|
720
|
-
cmd_type="transaction", cmd_string="c_cmd=C_STOP",
|
|
721
|
-
process_cmd_string=process_cmd_string,
|
|
722
|
-
process_response=partial(issue_warning, msg="STOP command has been executed."),
|
|
723
|
-
post_cmd=return_command_status,
|
|
724
|
-
)
|
|
725
|
-
def stop(self) -> Tuple[int, str] | Failure:
|
|
726
|
-
"""
|
|
727
|
-
Stop the current motion. This command can be sent during a motion of the Hexapod
|
|
728
|
-
and is executed with high priority.
|
|
729
|
-
|
|
730
|
-
Returns:
|
|
731
|
-
A tuple (return code, description). Return code = 0 on success.
|
|
732
|
-
"""
|
|
733
|
-
raise NotImplementedError
|
|
734
|
-
|
|
735
|
-
@dynamic_command(
|
|
736
|
-
cmd_type="transaction", cmd_string="c_cmd=C_CONTROLON",
|
|
737
|
-
process_cmd_string=process_cmd_string,
|
|
738
|
-
post_cmd=return_command_status,
|
|
739
|
-
)
|
|
740
|
-
def activate_control_loop(self):
|
|
741
|
-
"""
|
|
742
|
-
Activates the control loop on motors.
|
|
743
|
-
|
|
744
|
-
It activates the power on the motors and releases the brakes if present.
|
|
745
|
-
The hexapod status 'Control On' will switch to true when the command is successful.
|
|
746
|
-
|
|
747
|
-
This command should be used before starting a movement.
|
|
748
|
-
|
|
749
|
-
Note: it is possible to activate the control loop on motors even if the home is not complete.
|
|
750
|
-
"""
|
|
751
|
-
raise NotImplementedError
|
|
752
|
-
|
|
753
|
-
@dynamic_command(
|
|
754
|
-
cmd_type="transaction", cmd_string="c_cmd=C_CONTROLOFF",
|
|
755
|
-
process_cmd_string=process_cmd_string,
|
|
756
|
-
post_cmd=return_command_status,
|
|
757
|
-
)
|
|
758
|
-
def deactivate_control_loop(self):
|
|
759
|
-
"""
|
|
760
|
-
Disables the control loop on the servo motors.
|
|
761
|
-
|
|
762
|
-
It is advisable to disable the servo motors if the system is not used for
|
|
763
|
-
a long period (more than 1 hour for example). However, this recommendation
|
|
764
|
-
depends on the application for which the system is being used.
|
|
765
|
-
|
|
766
|
-
This command is performed only if the following conditions are met:
|
|
767
|
-
* there is no motion task running
|
|
768
|
-
* there is no action running
|
|
769
|
-
"""
|
|
770
|
-
raise NotImplementedError
|
|
771
|
-
|
|
772
|
-
@dynamic_command(
|
|
773
|
-
cmd_type="transaction", cmd_string="c_cmd=C_HOME",
|
|
774
|
-
process_cmd_string=process_cmd_string,
|
|
775
|
-
process_response=process_response,
|
|
776
|
-
)
|
|
777
|
-
def homing(self):
|
|
778
|
-
"""
|
|
779
|
-
Starts the homing task on the hexapod.
|
|
780
|
-
|
|
781
|
-
Homing needs to be completed before performing any movement. When the hexapod
|
|
782
|
-
is equipped with absolute encoders, this cycle is executed automatically during
|
|
783
|
-
the controller initialization. When the hexapod is not equipped with absolute
|
|
784
|
-
encoders, the homing request movements: homing cycle will search actuators
|
|
785
|
-
reference sensors.
|
|
786
|
-
|
|
787
|
-
Homing is required before performing a control movement. Without absolute encoders,
|
|
788
|
-
the homing is performed with a hexapod movement until detecting the reference sensor
|
|
789
|
-
on each of the actuators. The Hexapod will go to a position were the sensors are
|
|
790
|
-
reached that signal a known calibrated position and then returns to the zero position.
|
|
791
|
-
|
|
792
|
-
Whenever a homing is performed, the method will return before the actual movement
|
|
793
|
-
is finished.
|
|
794
|
-
|
|
795
|
-
The homing cycle takes about two minutes to complete, but the ``homing()`` method
|
|
796
|
-
returns almost immediately. Therefore, to check if the homing is finished, use
|
|
797
|
-
the is_homing_done() method.
|
|
798
|
-
|
|
799
|
-
This command is performed only if the following conditions are met:
|
|
800
|
-
* there is no motion task running
|
|
801
|
-
* the emergency stop button is not engaged (not applicable for absolute encoders)
|
|
802
|
-
|
|
803
|
-
"""
|
|
804
|
-
raise NotImplementedError
|
|
805
|
-
|
|
806
|
-
def is_homing_done(self) -> bool | Failure:
|
|
807
|
-
"""
|
|
808
|
-
Checks if Homing is done.
|
|
809
|
-
|
|
810
|
-
When this variable indicates 'Homing is done' it means the command has been properly
|
|
811
|
-
executed, but it doesn't mean the Hexapod is in position. The hexapod might still be
|
|
812
|
-
moving to its zero position.
|
|
813
|
-
|
|
814
|
-
Returns:
|
|
815
|
-
True when the homing is done, False otherwise.
|
|
816
|
-
"""
|
|
817
|
-
general_state = self.get_general_state()
|
|
818
|
-
if isinstance(general_state, Failure):
|
|
819
|
-
return general_state
|
|
820
|
-
|
|
821
|
-
return bool(general_state[1][HOME_COMPLETE])
|
|
822
|
-
|
|
823
|
-
def is_in_position(self) -> bool | Failure:
|
|
824
|
-
"""
|
|
825
|
-
Checks if the hexapod is in position.
|
|
826
|
-
|
|
827
|
-
Returns:
|
|
828
|
-
True when in position, False otherwise.
|
|
829
|
-
"""
|
|
830
|
-
general_state = self.get_general_state()
|
|
831
|
-
if isinstance(general_state, Failure):
|
|
832
|
-
return general_state
|
|
833
|
-
|
|
834
|
-
return bool(general_state[1][IN_POSITION]) and not bool(general_state[1][IN_MOTION])
|
|
835
|
-
|
|
836
|
-
@dynamic_command(
|
|
837
|
-
cmd_type="transaction", cmd_string="c_cmd=C_CLEARERROR",
|
|
838
|
-
process_cmd_string=process_cmd_string,
|
|
839
|
-
post_cmd=return_command_status,
|
|
840
|
-
)
|
|
841
|
-
def clear_error(self) -> Tuple[int, str] | Failure:
|
|
842
|
-
"""
|
|
843
|
-
Clear all errors in the controller software.
|
|
844
|
-
|
|
845
|
-
This command clears the error list on the controller and automatically removes the error bit of the hexapod
|
|
846
|
-
state. After this command, errors might automatically be regenerated if they are still present. For example,
|
|
847
|
-
if an encoder is disconnected, the encoder error will be re-generated after the command because error reason
|
|
848
|
-
is not corrected.
|
|
849
|
-
|
|
850
|
-
Returns:
|
|
851
|
-
The command status is returned as a tuple with (return code, message).
|
|
852
|
-
"""
|
|
853
|
-
raise NotImplementedError
|
|
854
|
-
|
|
855
|
-
@dynamic_command(
|
|
856
|
-
cmd_type="transaction", cmd_string="c_cfg=1 "
|
|
857
|
-
"c_par(0)=${tx_u} c_par(1)=${ty_u} c_par(2)=${tz_u} "
|
|
858
|
-
"c_par(3)=${rx_u} c_par(4)=${ry_u} c_par(5)=${rz_u} "
|
|
859
|
-
"c_par(6)=${tx_o} c_par(7)=${ty_o} c_par(8)=${tz_o} "
|
|
860
|
-
"c_par(9)=${rx_o} c_par(10)=${ry_o} c_par(11)=${rz_o} "
|
|
861
|
-
"c_cmd=C_CFG_CS",
|
|
862
|
-
process_cmd_string=process_cmd_string,
|
|
863
|
-
post_cmd=return_command_status,
|
|
864
|
-
)
|
|
865
|
-
def configure_coordinates_systems(
|
|
866
|
-
self, tx_u, ty_u, tz_u, rx_u, ry_u, rz_u, tx_o, ty_o, tz_o, rx_o, ry_o, rz_o
|
|
867
|
-
) -> Tuple[int, str] | Failure:
|
|
868
|
-
"""
|
|
869
|
-
Change the definition of the User Coordinate System and the Object Coordinate System.
|
|
870
|
-
|
|
871
|
-
The parameters tx_u, ty_u, tz_u, rx_u, ry_u, rz_u are used to define the user coordinate
|
|
872
|
-
system relative to the Machine Coordinate System and the parameters tx_o, ty_o, tz_o, rx_o,
|
|
873
|
-
ry_o, rz_o are used to define the Object Coordinate System relative to the Platform
|
|
874
|
-
Coordinate System.
|
|
875
|
-
|
|
876
|
-
Args:
|
|
877
|
-
tx_u (float): translation parameter that define the user coordinate system relative
|
|
878
|
-
to the machine coordinate system [in mm]
|
|
879
|
-
ty_u (float): translation parameter that define the user coordinate system relative
|
|
880
|
-
to the machine coordinate system [in mm]
|
|
881
|
-
tz_u (float): translation parameter that define the user coordinate system relative
|
|
882
|
-
to the machine coordinate system [in mm]
|
|
883
|
-
|
|
884
|
-
rx_u (float): rotation parameter that define the user coordinate system relative to
|
|
885
|
-
the machine coordinate system [in deg]
|
|
886
|
-
ry_u (float): rotation parameter that define the user coordinate system relative to
|
|
887
|
-
the machine coordinate system [in deg]
|
|
888
|
-
rz_u (float): rotation parameter that define the user coordinate system relative to
|
|
889
|
-
the machine coordinate system [in deg]
|
|
890
|
-
|
|
891
|
-
tx_o (float): translation parameter that define the object coordinate system relative
|
|
892
|
-
to the platform coordinate system [in mm]
|
|
893
|
-
ty_o (float): translation parameter that define the object coordinate system relative
|
|
894
|
-
to the platform coordinate system [in mm]
|
|
895
|
-
tz_o (float): translation parameter that define the object coordinate system relative
|
|
896
|
-
to the platform coordinate system [in mm]
|
|
897
|
-
|
|
898
|
-
rx_o (float): rotation parameter that define the object coordinate system relative to
|
|
899
|
-
the platform coordinate system [in deg]
|
|
900
|
-
ry_o (float): rotation parameter that define the object coordinate system relative to
|
|
901
|
-
the platform coordinate system [in deg]
|
|
902
|
-
rz_o (float): rotation parameter that define the object coordinate system relative to
|
|
903
|
-
the platform coordinate system [in deg]
|
|
904
|
-
|
|
905
|
-
Returns:
|
|
906
|
-
A tuple with the command status return code and a description.
|
|
907
|
-
"""
|
|
908
|
-
raise NotImplementedError
|
|
909
|
-
|
|
910
|
-
@dynamic_command(
|
|
911
|
-
cmd_type="query", cmd_string="c_cfg=0 c_cmd=C_CFG_CS",
|
|
912
|
-
process_cmd_string=process_cmd_string,
|
|
913
|
-
process_response=partial(decode_pars, count=12),
|
|
914
|
-
post_cmd=partial(get_pars, count=12),
|
|
915
|
-
)
|
|
916
|
-
def get_coordinates_systems(self):
|
|
917
|
-
"""
|
|
918
|
-
Retrieve the definition of the User Coordinate System and the Object Coordinate System.
|
|
919
|
-
|
|
920
|
-
Returns:
|
|
921
|
-
tx_u, ty_u, tz_u, rx_u, ry_u, rz_u, tx_o, ty_o, tz_o, rx_o, ry_o, rz_o where the
|
|
922
|
-
translation parameters are in [mm] and the rotation parameters are in [deg].
|
|
923
|
-
"""
|
|
924
|
-
raise NotImplementedError
|
|
925
|
-
|
|
926
|
-
@dynamic_command(
|
|
927
|
-
cmd_type="transaction", cmd_string="c_par(0)=${cm} "
|
|
928
|
-
"c_par(1)=${tx} c_par(2)=${ty} c_par(3)=${tz} "
|
|
929
|
-
"c_par(4)=${rx} c_par(5)=${ry} c_par(6)=${rz} "
|
|
930
|
-
"c_cmd=C_MOVE_PTP",
|
|
931
|
-
process_cmd_string=process_cmd_string,
|
|
932
|
-
post_cmd=return_command_status,
|
|
933
|
-
)
|
|
934
|
-
def move_ptp(self, cm: int,
|
|
935
|
-
tx: float, ty: float, tz: float, rx: float, ry: float, rz: float) -> Tuple[int, str] | Failure:
|
|
936
|
-
"""
|
|
937
|
-
Start the movement as defined by the arguments.
|
|
938
|
-
|
|
939
|
-
Args:
|
|
940
|
-
cm: control mode, 0=absolute, 1=object relative, 2=user relative
|
|
941
|
-
tx: position on X-axis [mm]
|
|
942
|
-
ty: position on Y-axis [mm]
|
|
943
|
-
tz: position on Z-axis [mm]
|
|
944
|
-
rx: rotation around the X-axis [deg]
|
|
945
|
-
ry: rotation around the Y-axis [deg]
|
|
946
|
-
rz: rotation around the Z-axis [deg]
|
|
947
|
-
|
|
948
|
-
Returns:
|
|
949
|
-
|
|
950
|
-
"""
|
|
951
|
-
raise NotImplementedError
|
|
952
|
-
|
|
953
|
-
def move_absolute(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, str] | Failure:
|
|
954
|
-
return self.move_ptp(0, tx, ty, tz, rx, ry, rz)
|
|
955
|
-
|
|
956
|
-
def move_relative_object(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, str] | Failure:
|
|
957
|
-
return self.move_ptp(1, tx, ty, tz, rx, ry, rz)
|
|
958
|
-
|
|
959
|
-
def move_relative_user(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, str] | Failure:
|
|
960
|
-
return self.move_ptp(2, tx, ty, tz, rx, ry, rz)
|
|
961
|
-
|
|
962
|
-
@dynamic_command(
|
|
963
|
-
cmd_type="transaction", cmd_string="c_par(0)=${pos} c_cmd=C_MOVE_SPECIFICPOS",
|
|
964
|
-
process_cmd_string=process_cmd_string,
|
|
965
|
-
# process_response=process_response,
|
|
966
|
-
post_cmd=return_command_status,
|
|
967
|
-
)
|
|
968
|
-
def goto_specific_position(self, pos: int):
|
|
969
|
-
raise NotImplementedError
|
|
970
|
-
|
|
971
|
-
def goto_user_zero_position(self):
|
|
972
|
-
return self.goto_specific_position(pos=1)
|
|
973
|
-
|
|
974
|
-
def goto_retracted_position(self):
|
|
975
|
-
return self.goto_specific_position(pos=2)
|
|
976
|
-
|
|
977
|
-
def goto_machine_zero_position(self):
|
|
978
|
-
return self.goto_specific_position(pos=3)
|
|
979
|
-
|
|
980
|
-
goto_zero_position = goto_user_zero_position
|
|
981
|
-
|
|
982
|
-
@dynamic_command(
|
|
983
|
-
cmd_type="transaction", cmd_string="s_uto_tx,6,1",
|
|
984
|
-
process_cmd_string=process_cmd_string,
|
|
985
|
-
process_response=decode_uto,
|
|
986
|
-
)
|
|
987
|
-
def get_user_positions(self):
|
|
988
|
-
raise NotImplementedError
|
|
989
|
-
|
|
990
|
-
@dynamic_command(
|
|
991
|
-
cmd_type="transaction", cmd_string="s_mtp_tx,6,1",
|
|
992
|
-
process_cmd_string=process_cmd_string,
|
|
993
|
-
process_response=decode_mtp,
|
|
994
|
-
)
|
|
995
|
-
def get_machine_positions(self) -> List[float] | Failure:
|
|
996
|
-
raise NotImplementedError
|
|
997
|
-
|
|
998
|
-
@dynamic_command(
|
|
999
|
-
cmd_type="query", cmd_string="c_cmd=C_VERSION",
|
|
1000
|
-
process_cmd_string=process_cmd_string,
|
|
1001
|
-
process_response=decode_info,
|
|
1002
|
-
post_cmd=partial(get_pars, count=12),
|
|
1003
|
-
)
|
|
1004
|
-
def info(self) -> str:
|
|
1005
|
-
"""Returns basic information about the hexapod and the controller.
|
|
1006
|
-
|
|
1007
|
-
Returns:
|
|
1008
|
-
a multiline response message containing the device info.
|
|
1009
|
-
"""
|
|
1010
|
-
raise NotImplementedError
|
|
1011
|
-
|
|
1012
|
-
@dynamic_command(
|
|
1013
|
-
cmd_type="query", cmd_string="c_cmd=C_VERSION",
|
|
1014
|
-
process_cmd_string=process_cmd_string,
|
|
1015
|
-
process_response=decode_version,
|
|
1016
|
-
post_cmd=partial(get_pars, count=12),
|
|
1017
|
-
)
|
|
1018
|
-
def version(self) -> str:
|
|
1019
|
-
"""Returns the version of the firmware running on the hexapod aplha+ controller.
|
|
1020
|
-
|
|
1021
|
-
Returns:
|
|
1022
|
-
A version number as a string.
|
|
1023
|
-
"""
|
|
1024
|
-
raise NotImplementedError
|
|
1025
|
-
|
|
1026
|
-
@dynamic_command(
|
|
1027
|
-
cmd_type="transaction", cmd_string="s_hexa",
|
|
1028
|
-
process_cmd_string=process_cmd_string,
|
|
1029
|
-
process_response=decode_general_state
|
|
1030
|
-
)
|
|
1031
|
-
def get_general_state(self) -> Tuple[Dict, List] | Failure:
|
|
1032
|
-
"""
|
|
1033
|
-
Asks the general state of the hexapod on all the motors following the bits definition
|
|
1034
|
-
presented below.
|
|
1035
|
-
|
|
1036
|
-
GENERAL_STATE =
|
|
1037
|
-
0: "Error",
|
|
1038
|
-
1: "System initialized",
|
|
1039
|
-
2: "Control on",
|
|
1040
|
-
3: "In position",
|
|
1041
|
-
4: "Motion task running",
|
|
1042
|
-
5: "Home task running",
|
|
1043
|
-
6: "Home complete",
|
|
1044
|
-
7: "Home virtual",
|
|
1045
|
-
8: "Phase found",
|
|
1046
|
-
9: "Brake on",
|
|
1047
|
-
10:"Motion restricted",
|
|
1048
|
-
11:"Power on encoders",
|
|
1049
|
-
12:"Power on limit switches",
|
|
1050
|
-
13:"Power on drives",
|
|
1051
|
-
14:"Emergency stop"
|
|
1052
|
-
|
|
1053
|
-
Returns:
|
|
1054
|
-
A dictionary with the bits value of each parameter.
|
|
1055
|
-
"""
|
|
1056
|
-
raise NotImplementedError
|
|
1057
|
-
|
|
1058
|
-
@dynamic_command(
|
|
1059
|
-
cmd_type="transaction", cmd_string="s_ax_1,6,1",
|
|
1060
|
-
process_cmd_string=process_cmd_string,
|
|
1061
|
-
process_response=decode_actuator_state,
|
|
1062
|
-
)
|
|
1063
|
-
def get_actuator_state(self) -> Tuple[Dict, List] | Failure:
|
|
1064
|
-
raise NotImplementedError
|
|
1065
|
-
|
|
1066
|
-
@dynamic_command(
|
|
1067
|
-
cmd_type="query", cmd_string="s_pos_ax_1,6,1",
|
|
1068
|
-
process_cmd_string=process_cmd_string,
|
|
1069
|
-
process_response=partial(decode_pars, count=6, func=float),
|
|
1070
|
-
)
|
|
1071
|
-
def get_actuator_length(self):
|
|
1072
|
-
"""
|
|
1073
|
-
Retrieve the current length of the hexapod actuators.
|
|
1074
|
-
|
|
1075
|
-
Returns:
|
|
1076
|
-
array: an array of six float values for actuator length L1 to L6 in [mm], and \
|
|
1077
|
-
None: when an Exception was raised and logs the error message.
|
|
1078
|
-
"""
|
|
1079
|
-
raise NotImplementedError
|
|
1080
|
-
|
|
1081
|
-
@dynamic_command(
|
|
1082
|
-
cmd_type="query", cmd_string="c_cfg=0 c_cmd=C_CFG_SPEED",
|
|
1083
|
-
process_cmd_string=process_cmd_string,
|
|
1084
|
-
process_response=partial(decode_pars, count=6),
|
|
1085
|
-
post_cmd=partial(get_pars, count=6),
|
|
1086
|
-
)
|
|
1087
|
-
def get_speed(self) -> List[float]:
|
|
1088
|
-
"""
|
|
1089
|
-
Returns the positional speed of movements.
|
|
1090
|
-
|
|
1091
|
-
Returns a list of floating point numbers [vt, vr, vt-, vr-, vt+, vr+] where vt and vr are the translation and
|
|
1092
|
-
angular speed respectively, the '-' and '+' are the minimum and maximum speeds.
|
|
1093
|
-
"""
|
|
1094
|
-
raise NotImplementedError
|
|
1095
|
-
|
|
1096
|
-
@dynamic_command(
|
|
1097
|
-
cmd_type="transaction", cmd_string="c_cfg=1 c_par(0)=${vt} c_par(1)=${vr} c_cmd=C_CFG_SPEED",
|
|
1098
|
-
process_cmd_string=process_cmd_string,
|
|
1099
|
-
post_cmd=return_command_status,
|
|
1100
|
-
)
|
|
1101
|
-
def set_speed(self, vt: float, vr: float):
|
|
1102
|
-
"""
|
|
1103
|
-
Set the positioning speed of movements.
|
|
1104
|
-
|
|
1105
|
-
Args:
|
|
1106
|
-
vt: translational speed, unit = mm per second
|
|
1107
|
-
vr: angular speed, unit = deg per second
|
|
1108
|
-
"""
|
|
1109
|
-
raise NotImplementedError
|
|
1110
|
-
|
|
1111
|
-
@dynamic_command(
|
|
1112
|
-
cmd_type="transaction", cmd_string="c_par(0)=${vm} c_par(1)=${cm} "
|
|
1113
|
-
"c_par(2)=${tx} c_par(3)=${ty} c_par(4)=${tz} "
|
|
1114
|
-
"c_par(5)=${rx} c_par(6)=${ry} c_par(7)=${rz} "
|
|
1115
|
-
"c_cmd=C_VALID_PTP",
|
|
1116
|
-
process_cmd_string=process_cmd_string,
|
|
1117
|
-
process_response=process_validate_ptp,
|
|
1118
|
-
post_cmd=get_pars,
|
|
1119
|
-
)
|
|
1120
|
-
def validate_position(self, vm, cm, tx, ty, tz, rx, ry, rz) -> Tuple[int, Dict[int, str]] | Failure:
|
|
1121
|
-
"""
|
|
1122
|
-
Ask the controller if the movement defined by the arguments is feasible.
|
|
1123
|
-
|
|
1124
|
-
Returns a tuple where the first element is an integer that represents the
|
|
1125
|
-
bitfield encoding the errors. The second element is a dictionary with the
|
|
1126
|
-
bit numbers that were (on) and the corresponding error description as
|
|
1127
|
-
defined by VALIDATION_LIMITS.
|
|
1128
|
-
|
|
1129
|
-
Args:
|
|
1130
|
-
vm (int): validation mode [only vm=1 is currently implemented by Symétrie]
|
|
1131
|
-
cm (int): control mode (0 = absolute, 1 = object relative, 2 = user relative)
|
|
1132
|
-
tx (float): position on the X-axis [mm]
|
|
1133
|
-
ty (float): position on the Y-axis [mm]
|
|
1134
|
-
tz (float): position on the Z-axis [mm]
|
|
1135
|
-
rx (float): rotation around the X-axis [deg]
|
|
1136
|
-
ry (float): rotation around the Y-axis [deg]
|
|
1137
|
-
rz (float): rotation around the Z-axis [deg]
|
|
1138
|
-
|
|
1139
|
-
"""
|
|
1140
|
-
raise NotImplementedError
|
|
1141
|
-
|
|
1142
|
-
def check_absolute_movement(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, Dict[int, str]] | Failure:
|
|
1143
|
-
"""
|
|
1144
|
-
Check if the requested object movement is valid.
|
|
1145
|
-
|
|
1146
|
-
The absolute movement is expressed in the user coordinate system.
|
|
1147
|
-
|
|
1148
|
-
Args:
|
|
1149
|
-
tx (float): position on the X-axis [mm]
|
|
1150
|
-
ty (float): position on the Y-axis [mm]
|
|
1151
|
-
tz (float): position on the Z-axis [mm]
|
|
1152
|
-
rx (float): rotation around the X-axis [deg]
|
|
1153
|
-
ry (float): rotation around the Y-axis [deg]
|
|
1154
|
-
rz (float): rotation around the Z-axis [deg]
|
|
1155
|
-
|
|
1156
|
-
Returns:
|
|
1157
|
-
tuple: where the first element is an integer that represents the
|
|
1158
|
-
bitfield encoding the errors. The second element is a dictionary
|
|
1159
|
-
with the bit numbers that were (on) and the corresponding error
|
|
1160
|
-
description.
|
|
1161
|
-
"""
|
|
1162
|
-
# Currently only the vm=1 mode is developed by Symétrie
|
|
1163
|
-
# Parameter cm = 0 for absolute
|
|
1164
|
-
return self.validate_position(1, 0, tx, ty, tz, rx, ry, rz)
|
|
1165
|
-
|
|
1166
|
-
def check_relative_object_movement(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, Dict[int, str]] | Failure:
|
|
1167
|
-
"""
|
|
1168
|
-
Check if the requested object movement is valid.
|
|
1169
|
-
|
|
1170
|
-
The relative motion is expressed in the object coordinate system.
|
|
1171
|
-
|
|
1172
|
-
Args:
|
|
1173
|
-
tx (float): position on the X-axis [mm]
|
|
1174
|
-
ty (float): position on the Y-axis [mm]
|
|
1175
|
-
tz (float): position on the Z-axis [mm]
|
|
1176
|
-
rx (float): rotation around the X-axis [deg]
|
|
1177
|
-
ry (float): rotation around the Y-axis [deg]
|
|
1178
|
-
rz (float): rotation around the Z-axis [deg]
|
|
1179
|
-
|
|
1180
|
-
Returns:
|
|
1181
|
-
tuple: where the first element is an integer that represents the
|
|
1182
|
-
bitfield encoding the errors. The second element is a dictionary
|
|
1183
|
-
with the bit numbers that were (on) and the corresponding error
|
|
1184
|
-
description.
|
|
1185
|
-
"""
|
|
1186
|
-
# Currently only the vm=1 mode is developed by Symétrie
|
|
1187
|
-
# Parameter cm = 1 for object relative
|
|
1188
|
-
return self.validate_position(1, 1, tx, ty, tz, rx, ry, rz)
|
|
1189
|
-
|
|
1190
|
-
def check_relative_user_movement(self, tx, ty, tz, rx, ry, rz) -> Tuple[int, Dict[int, str]] | Failure:
|
|
1191
|
-
"""
|
|
1192
|
-
Check if the requested object movement is valid.
|
|
1193
|
-
|
|
1194
|
-
The relative motion is expressed in the user coordinate system.
|
|
1195
|
-
|
|
1196
|
-
Args:
|
|
1197
|
-
tx (float): position on the X-axis [mm]
|
|
1198
|
-
ty (float): position on the Y-axis [mm]
|
|
1199
|
-
tz (float): position on the Z-axis [mm]
|
|
1200
|
-
rx (float): rotation around the X-axis [deg]
|
|
1201
|
-
ry (float): rotation around the Y-axis [deg]
|
|
1202
|
-
rz (float): rotation around the Z-axis [deg]
|
|
1203
|
-
|
|
1204
|
-
Returns:
|
|
1205
|
-
tuple: where the first element is an integer that represents the
|
|
1206
|
-
bitfield encoding the errors. The second element is a dictionary
|
|
1207
|
-
with the bit numbers that were (on) and the corresponding error
|
|
1208
|
-
description.
|
|
1209
|
-
"""
|
|
1210
|
-
# Currently only the vm=1 mode is developed by Symétrie
|
|
1211
|
-
# Parameter cm = 2 for user relative
|
|
1212
|
-
return self.validate_position(1, 2, tx, ty, tz, rx, ry, rz)
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
class AlphaPlusControllerInterface(AlphaControllerInterface):
|
|
1216
|
-
@dynamic_command(
|
|
1217
|
-
cmd_type="query", cmd_string="${name}",
|
|
1218
|
-
process_cmd_string=process_cmd_string,
|
|
1219
|
-
process_response=process_response,
|
|
1220
|
-
)
|
|
1221
|
-
def query_variable(self, name: str) -> str:
|
|
1222
|
-
raise NotImplementedError
|
|
1223
|
-
|
|
1224
|
-
@dynamic_command(
|
|
1225
|
-
cmd_type="query", cmd_string="${name},${count},${increment}",
|
|
1226
|
-
process_cmd_string=process_cmd_string,
|
|
1227
|
-
process_response=process_response,
|
|
1228
|
-
)
|
|
1229
|
-
def query_variables(self, name: str, count: int, increment: int = 1):
|
|
1230
|
-
raise NotImplementedError
|
|
1231
|
-
|
|
1232
|
-
@dynamic_command(
|
|
1233
|
-
cmd_type="query", cmd_string="${name}(${idx})",
|
|
1234
|
-
process_cmd_string=process_cmd_string,
|
|
1235
|
-
process_response=process_response,
|
|
1236
|
-
)
|
|
1237
|
-
def query_array(self, name: str, idx: int):
|
|
1238
|
-
raise NotImplementedError
|
|
1239
|
-
|
|
1240
|
-
@dynamic_command(
|
|
1241
|
-
cmd_type="query", cmd_string="${name}(${idx}),${count},${increment}",
|
|
1242
|
-
process_cmd_string=process_cmd_string,
|
|
1243
|
-
process_response=process_response,
|
|
1244
|
-
)
|
|
1245
|
-
def query_array_values(self, name: str, idx: int, count: int, increment: int = 1):
|
|
1246
|
-
raise NotImplementedError
|
|
1247
|
-
|
|
1248
|
-
@dynamic_command(
|
|
1249
|
-
cmd_type="transaction", cmd_string="c_cfg=0 c_par(0)=${lim} c_cmd=C_CFG_LIMIT",
|
|
1250
|
-
process_cmd_string=process_cmd_string,
|
|
1251
|
-
process_response=partial(decode_pars, index=1, count=12),
|
|
1252
|
-
post_cmd=partial(get_pars, count=13),
|
|
1253
|
-
)
|
|
1254
|
-
def get_limits_value(self, lim):
|
|
1255
|
-
"""
|
|
1256
|
-
Three different and independent operational workspace limits are defined on the controller:
|
|
1257
|
-
|
|
1258
|
-
* Factory limits: are expressed in machine coordinate system limits. Those parameters cannot be modified.
|
|
1259
|
-
* Machine coordinate system limits: they are expressed in the Machine coordinate system. It can be used to
|
|
1260
|
-
secure the hexapod (and/or object) from its environment.
|
|
1261
|
-
* User coordinate system limits: they are expressed in the User coordinate system. It can be used to limits
|
|
1262
|
-
the movements of the object mounted on hexapod.
|
|
1263
|
-
|
|
1264
|
-
Remark: operational workspace limits must be understood as limits in terms of amplitude of movement. Those
|
|
1265
|
-
limits are defined for each operational axis with a negative and positive value and are used in the validation
|
|
1266
|
-
process. Position on each operational axis must be within those two values.
|
|
1267
|
-
|
|
1268
|
-
Args:
|
|
1269
|
-
lim (int): 0 = factory (GET only), 1 = machine cs limit, 2 = user cs limit
|
|
1270
|
-
|
|
1271
|
-
Returns:
|
|
1272
|
-
A list of 12 float values: tx-, ty-, tz-, rx-, ry-, rz-, tx+, ty+, tz+, rx+, ry+, rz+
|
|
1273
|
-
The first six values are the negative limits for translation and rotation, the last six numbers are the
|
|
1274
|
-
positive limits for translation and rotation.
|
|
1275
|
-
|
|
1276
|
-
"""
|
|
1277
|
-
raise NotImplementedError
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
if __name__ == "__main__":
|
|
1281
|
-
|
|
1282
|
-
from rich import print as rp
|
|
1283
|
-
|
|
1284
|
-
from egse.hexapod.symetrie.punaplus import PunaPlusController
|
|
1285
|
-
|
|
1286
|
-
egse.logger.set_all_logger_levels(logging.INFO)
|
|
1287
|
-
|
|
1288
|
-
# Thie IP address for the emulator running in VirtualBox is 192.168.56.10
|
|
1289
|
-
# When you run the emulator in Parallels, the IP address is 10.37.129.10
|
|
1290
|
-
|
|
1291
|
-
puna = PunaPlusController(hostname="10.37.129.10", port=23)
|
|
1292
|
-
puna.connect()
|
|
1293
|
-
|
|
1294
|
-
with Timer("PunaPlusController"):
|
|
1295
|
-
rp(puna.info())
|
|
1296
|
-
rp(puna.version())
|
|
1297
|
-
rp(puna.is_homing_done())
|
|
1298
|
-
rp(puna.homing())
|
|
1299
|
-
if wait_until(puna.is_homing_done, interval=1, timeout=300):
|
|
1300
|
-
rp("[red]Task puna.is_homing_done() timed out after 30s.[/red]")
|
|
1301
|
-
rp(puna.is_homing_done())
|
|
1302
|
-
rp(puna.is_in_position())
|
|
1303
|
-
rp(puna.activate_control_loop())
|
|
1304
|
-
rp(puna.get_general_state())
|
|
1305
|
-
rp(puna.get_actuator_state())
|
|
1306
|
-
rp(puna.deactivate_control_loop())
|
|
1307
|
-
rp(puna.get_general_state())
|
|
1308
|
-
rp(puna.get_actuator_state())
|
|
1309
|
-
rp(puna.stop())
|
|
1310
|
-
rp(puna.get_limits_value(0))
|
|
1311
|
-
rp(puna.get_limits_value(1))
|
|
1312
|
-
rp(puna.check_absolute_movement(1, 1, 1, 1, 1, 1))
|
|
1313
|
-
rp(puna.check_absolute_movement(51, 51, 51, 1, 1, 1))
|
|
1314
|
-
rp(puna.get_speed())
|
|
1315
|
-
rp(puna.set_speed(2.0, 1.0))
|
|
1316
|
-
rp(speed := puna.get_speed())
|
|
1317
|
-
|
|
1318
|
-
if speed[:2] != [2.0, 1.0]:
|
|
1319
|
-
rp(f"[red]Expected {speed[:2]} == [2.0, 1.0][/red")
|
|
1320
|
-
|
|
1321
|
-
input("Check speed parameters in GUI")
|
|
1322
|
-
|
|
1323
|
-
rp(puna.set_speed(1.2, 1.1))
|
|
1324
|
-
|
|
1325
|
-
rp(speed := puna.get_speed())
|
|
1326
|
-
|
|
1327
|
-
if speed[:2] != [1.2, 1.1]:
|
|
1328
|
-
rp(f"[red]Expected {speed[:2]} == [1.2, 1.1][/red")
|
|
1329
|
-
|
|
1330
|
-
rp(puna.get_actuator_length())
|
|
1331
|
-
|
|
1332
|
-
# rp(puna.machine_limit_enable(0))
|
|
1333
|
-
# rp(puna.machine_limit_enable(1))
|
|
1334
|
-
# rp(puna.get_limits_state())
|
|
1335
|
-
rp(puna.get_coordinates_systems())
|
|
1336
|
-
rp(puna.configure_coordinates_systems(
|
|
1337
|
-
0.033000, -0.238000, 230.205000, 0.003282, 0.005671, 0.013930,
|
|
1338
|
-
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000))
|
|
1339
|
-
rp(puna.get_coordinates_systems())
|
|
1340
|
-
rp(puna.get_machine_positions())
|
|
1341
|
-
rp(puna.get_user_positions())
|
|
1342
|
-
|
|
1343
|
-
input("Check configuration in GUI")
|
|
1344
|
-
|
|
1345
|
-
rp(puna.configure_coordinates_systems(
|
|
1346
|
-
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
|
|
1347
|
-
0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000))
|
|
1348
|
-
|
|
1349
|
-
rp(puna.validate_position(1, 0, 0, 0, 0, 0, 0, 0))
|
|
1350
|
-
rp(puna.validate_position(1, 0, 0, 0, 50, 0, 0, 0))
|
|
1351
|
-
|
|
1352
|
-
rp(puna.goto_zero_position())
|
|
1353
|
-
rp(puna.is_in_position())
|
|
1354
|
-
if wait_until(puna.is_in_position, interval=1, timeout=300):
|
|
1355
|
-
rp("[red]Task puna.is_in_position() timed out after 30s.[/red]")
|
|
1356
|
-
rp(puna.is_in_position())
|
|
1357
|
-
|
|
1358
|
-
rp(puna.get_machine_positions())
|
|
1359
|
-
rp(puna.get_user_positions())
|
|
1360
|
-
|
|
1361
|
-
rp(puna.move_absolute(0, 0, 12, 0, 0, 10))
|
|
1362
|
-
|
|
1363
|
-
rp(puna.is_in_position())
|
|
1364
|
-
if wait_until(puna.is_in_position, interval=1, timeout=300):
|
|
1365
|
-
rp("[red]Task puna.is_in_position() timed out after 30s.[/red]")
|
|
1366
|
-
rp(puna.is_in_position())
|
|
1367
|
-
|
|
1368
|
-
rp(puna.get_machine_positions())
|
|
1369
|
-
rp(puna.get_user_positions())
|
|
1370
|
-
|
|
1371
|
-
rp(puna.move_absolute(0, 0, 0, 0, 0, 0))
|
|
1372
|
-
|
|
1373
|
-
rp(puna.is_in_position())
|
|
1374
|
-
if wait_until(puna.is_in_position, interval=1, timeout=300):
|
|
1375
|
-
rp("[red]Task puna.is_in_position() timed out after 30s.[/red]")
|
|
1376
|
-
rp(puna.is_in_position())
|
|
1377
|
-
|
|
1378
|
-
rp(puna.get_machine_positions())
|
|
1379
|
-
rp(puna.get_user_positions())
|
|
1380
|
-
|
|
1381
|
-
# # puna.reset()
|
|
1382
|
-
puna.disconnect()
|
|
1383
|
-
|
|
1384
|
-
# rp(0, decode_validation_error(0))
|
|
1385
|
-
# rp(11, decode_validation_error(11))
|
|
1386
|
-
# rp(8, decode_validation_error(8))
|
|
1387
|
-
# rp(24, decode_validation_error(24))
|