I'm using the python client and wanted to set the realtimeSimulation property of the app without having to use the button in the editor. I can successfully run the various.py script from the client's tests. I added the following line to the script:
Code: Select all
sim.setBoolProperty(sim.handle_app, sim.boolparam_realtime_simulation, True)
Code: Select all
Traceback (most recent call last):
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/various.py", line 51, in simThreadFunc
sim.setBoolProperty(sim.handle_app, sim.boolparam_realtime_simulation, True)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/coppeliasim/bridge.py", line 85, in <lambda>
setattr(ret, k, lambda *a, func=f'{name}.{k}': call(func, a))
~~~~^^^^^^^^^
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/coppeliasim/bridge.py", line 51, in call
stack.write(stackHandle, args, typeHints[0])
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/coppeliasim/stack.py", line 311, in write
write_value(stackHandle, value, typeHints[i])
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/coppeliasim/stack.py", line 284, in write_value
return write_string(stackHandle, value, encoding='utf-8')
File "/home/gregor/workspace/tools/CoppeliaSim_Edu_V4_9_0_rev0_Ubuntu24_04/coppeliasim/stack.py", line 243, in write_string
value = value.encode(encoding)
^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'encode'
Thanks in advance