Hi friends,
I have some troubles with ur_rtde library using Python (with IO part to be exact): Examples — ur_rtde 1.5.7 documentation
First problem is I cant figure out how to read digital input. There is no equivalent of setStandardDigitalOut for reading purposes.
I’ve tried getActualDigitalInputBits but there is no further explanation how it works in the documentation: API Reference — ur_rtde 1.5.7 documentation
Unfortunately this function always returns 0 no matter of digital input state (I connected combination of H and L state to some inputs via jumper wires). Do anybody know what is going on or how to walk around this problem? My goal is to read digital inputs via RTDE.
Second problem is strange behavior of setAnalogOutputVoltage function. I made a setup where analog input 0 is connected to analog output 0. According to documentation: API Reference — ur_rtde 1.5.7 documentation
setting 0 means minimum voltage, and setting 1 is maximum volatage. Anything between means voltage level is fraction of maximum voltage. Unfortunately this is not a case. To my surprise those voltages are unpredictable. Even more suspicious is that the function takes arguments outside given range 0-1 no problem.
I thought it’s noise or something with wiring but those values are repeatable. There are commands I’ve run + comments:
io.setAnalogOutputVoltage(0, 0) # zero means 0 volts
True
r.getStandardAnalogInput0() # but there is almost 15!
14.71467113494873
io.setAnalogOutputVoltage(0, 1) # one means maximum so 24 volts
True
r.getStandardAnalogInput0() # but there is less than that of 0…
12.574845314025879
io.setAnalogOutputVoltage(0, -1)
True
r.getStandardAnalogInput0()
0.678781270980835
io.setAnalogOutputVoltage(0, -5)
True
r.getStandardAnalogInput0()
0.6878471374511719
io.setAnalogOutputVoltage(0, 5)
True
r.getStandardAnalogInput0()
12.432341575622559
io.setAnalogOutputVoltage(0, 0) # results are repeatable…
True
r.getStandardAnalogInput0()
14.712907791137695
io.setAnalogOutputVoltage(0, 1) # repeatable again
True
r.getStandardAnalogInput0()
12.54891300201416
io.setAnalogOutputVoltage(0, -1) # and again (with some margin of error)
True
r.getStandardAnalogInput0()
0.683063268661499
Any help is very appreciated