Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not add a cude in vrep in poppy project #256

Open
HuangBo-Terraloupe opened this issue Jun 1, 2017 · 2 comments
Open

can not add a cude in vrep in poppy project #256

HuangBo-Terraloupe opened this issue Jun 1, 2017 · 2 comments

Comments

@HuangBo-Terraloupe
Copy link

when I add a cude in vrep,
I do this:
poppy.reset_simulation()
io = poppy._controllers[0].io
name = b'cube'
#position = goal_position # X, Y, Z
position = [0, 0, 0]
#position = [0, 0, 0]
sizes = [100, 100, 100] # in meters
mass = 0 # in kg
io.add_cube(name, position, sizes, mass)

And it shows this error:

VrepIOErrors Traceback (most recent call last)
in ()
8 mass = 0 # in kg
9
---> 10 io.add_cube(name, position, sizes, mass)

/usr/local/lib/python2.7/dist-packages/pypot/vrep/io.pyc in add_cube(self, name, position, sizes, mass)
232 """ Add Cube """
233 self._create_pure_shape(0, 239, sizes, mass, [0, 0])
--> 234 self.set_object_position("Cuboid", position)
235 self.change_object_name("Cuboid", name)
236

/usr/local/lib/python2.7/dist-packages/pypot/vrep/io.pyc in set_object_position(self, object_name, position)
179 def set_object_position(self, object_name, position=[0, 0, 0]):
180 """ Sets the object position. """
--> 181 h = self.get_object_handle(object_name)
182
183 return self.call_remote_api('simxSetObjectPosition',

/usr/local/lib/python2.7/dist-packages/pypot/vrep/io.pyc in get_object_handle(self, obj)
201 """ Gets the vrep object handle. """
202 if obj not in self._object_handles:
--> 203 self._object_handles[obj] = self._get_object_handle(obj=obj)
204
205 return self._object_handles[obj]

/usr/local/lib/python2.7/dist-packages/pypot/vrep/io.pyc in _get_object_handle(self, obj)
196
197 def _get_object_handle(self, obj):
--> 198 return self.call_remote_api('simxGetObjectHandle', obj)
199
200 def get_object_handle(self, obj):

/usr/local/lib/python2.7/dist-packages/pypot/vrep/io.pyc in call_remote_api(self, func_name, *args, **kwargs)
357 msg = ' '.join([vrep_error[2 ** i]
358 for i, e in enumerate(err) if e])
--> 359 raise VrepIOErrors(msg)
360
361 return res

VrepIOErrors: Remote error

@jjehl
Copy link
Contributor

jjehl commented Jun 2, 2017

What is your creature ? What vrep scene are you using ?

@codenie
Copy link

codenie commented Jun 23, 2019

I meet the same bug

import pypot.vrep.io as IO
io = IO.VrepIO()
io.add_cube("cube2", [0.2,0,0.8],[1,1,1],1)
VrepIOErrors                              Traceback (most recent call last)
<ipython-input-53-427d8b3fdd21> in <module>
----> 1 io.add_cube("cube2", [0.2,0,0.8],[1,1,1],1)

~\AppData\Roaming\Python\Python36\site-packages\pypot\vrep\io.py in add_cube(self, name, position, sizes, mass)
    232         """ Add Cube """
    233         self._create_pure_shape(0, 239, sizes, mass, [0, 0])
--> 234         self.set_object_position("Cuboid", position)
    235         self.change_object_name("Cuboid", name)
    236 

~\AppData\Roaming\Python\Python36\site-packages\pypot\vrep\io.py in set_object_position(self, object_name, position)
    179     def set_object_position(self, object_name, position=[0, 0, 0]):
    180         """ Sets the object position. """
--> 181         h = self.get_object_handle(object_name)
    182 
    183         return self.call_remote_api('simxSetObjectPosition',

~\AppData\Roaming\Python\Python36\site-packages\pypot\vrep\io.py in get_object_handle(self, obj)
    201         """ Gets the vrep object handle. """
    202         if obj not in self._object_handles:
--> 203             self._object_handles[obj] = self._get_object_handle(obj=obj)
    204 
    205         return self._object_handles[obj]

~\AppData\Roaming\Python\Python36\site-packages\pypot\vrep\io.py in _get_object_handle(self, obj)
    196 
    197     def _get_object_handle(self, obj):
--> 198         return self.call_remote_api('simxGetObjectHandle', obj)
    199 
    200     def get_object_handle(self, obj):

~\AppData\Roaming\Python\Python36\site-packages\pypot\vrep\io.py in call_remote_api(self, func_name, *args, **kwargs)
    357             msg = ' '.join([vrep_error[2 ** i]
    358                             for i, e in enumerate(err) if e])
--> 359             raise VrepIOErrors(msg)
    360 
    361         return res

VrepIOErrors: Remote error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants