ArgumentError: cannot run a simulation on VREP under Windows

Hi all,

I have a problem with VREP, when I instantiate PoppyHumanoid… The Python interpreter says that there is a problem of type in the basic function simxStart()…
This is my script Python:

from poppy.creatures import PoppyHumanoid
from pypot.vrep import from_vrep

poppy = PoppyHumanoid(simulator = 'vrep')

And I get this error:

---------------------------------------------------------------------------
ArgumentError                             Traceback (most recent call last)
<ipython-input-3-86d8ddfa8658> in <module>()
----> 1 p = PoppyHumanoid(simulator = 'vrep')

C:\Python34\lib\site-packages\poppy\creatures\abstractcreature.py in __new__(cls, config, simulator, scene, host, port,
id, use_snap, snap_host, snap_port, sync)
     66             # TODO: use the id so we can have multiple poppy creatures
     67             # inside a single vrep scene
---> 68             poppy_creature = from_vrep('', host, port, scene)
     69             poppy_creature.simulated = True
     70

C:\Python34\lib\site-packages\pypot\vrep\__init__.py in from_vrep(config, vrep_host, vrep_port, scene, tracked_objects,
tracked_collisions)
     73
     74     """
---> 75     vrep_io = VrepIO(vrep_host, vrep_port)
     76
     77     vreptime = vrep_time(vrep_io)

C:\Python34\lib\site-packages\pypot\vrep\io.py in __init__(self, vrep_host, vrep_port, scene, start)
     67         #     self.load_scene(scene, start)
     68
---> 69         self.open_io()
     70
     71     def open_io(self):

C:\Python34\lib\site-packages\pypot\vrep\io.py in open_io(self)
     71     def open_io(self):
     72         self.client_id = remote_api.simxStart(
---> 73             self.vrep_host, self.vrep_port, True, True, 5000, 5)
     74         if self.client_id == -1:
     75             msg = ('Could not connect to V-REP server on {}:{}. '

C:\Python34\lib\site-packages\pypot\vrep\remoteApiBindings\vrep.py in simxStart(connectionAddress, connectionPort, waitU
ntilConnected, doNotReconnectOnceDisconnected, timeOutInMs, commThreadCycleInMs)
   1001     '''
   1002
-> 1003     return c_Start(connectionAddress, connectionPort, waitUntilConnected, doNotReconnectOnceDisconnected, timeOu
tInMs, commThreadCycleInMs)
   1004
   1005 def simxFinish(clientID):

ArgumentError: argument 1: <class 'TypeError'>: wrong type

I searched all afternoon, but I really don’t see where the error could come …
Someone would have an idea of where the error might come?

Dear,

I had the same problem. I’ve changed the python version, 3.4 to 2.7 and everything works find.

On Window you could have to install a C++ library to deal correctly with Python.

2 Likes

Thank you very much indeed in passing on Python 2.7 I don’t have problems … It’s strange as it gives me a type error on version 3.4…
Thanks a lot!

The V-REP remote API was not compatible with Python 3. I pushed a patch in the version 2.3.3. It should work now.