ZeroMQ Remote API issue

Typically: "How do I... ", "How can I... " questions
Post Reply
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

ZeroMQ Remote API issue

Post by gplminhduc147 »

I wanna set the position for an object in CoppeliaSim using python and ZeroMQ remote API.
I follow this code refer to Regular API reference (https://manual.coppeliarobotics.com/en/apiFunctions.htm):

Code: Select all

sim.setObjectPosition(int objectHandle, list position, int relativeToObjectHandle = sim.handle_world)
So, my code is:

Code: Select all

sim.setObjectOrientation(Obj_handle, (0 * np.pi/180, -90 * np.pi/180, -33.999 * np.pi/180), sim.handle_world)
However, I ran my code and got the error:
Exception: 44: in sim.setObjectOrientation: one of the function's argument type is not correct.

Later, I read some code in a project and change my code into:

Code: Select all

sim.setObjectOrientation(Obj_handle, -1, (0 * np.pi/180, -90 * np.pi/180, -33.999 * np.pi/180))
After that, the code worked well.

I wanna ask that why I got the error when I ran my code refer to Regular API reference.
And for the working code, It looks so different from the Regular API reference. Why does it work?
May I do something wrong here? I'm looking forward to hearing from you.
Thanks !!!
fferri
Posts: 1334
Joined: 09 Sep 2013, 19:28

Re: ZeroMQ Remote API issue

Post by fferri »

Online rerefence applies to the latest version of CoppeliaSim.

Perhaps you are using an older version? In the past the arguments of sim.setObjectPosition, sim.setObjectOrientation,. etc.. were in a different order.
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: ZeroMQ Remote API issue

Post by gplminhduc147 »

fferri wrote: 19 Jun 2024, 11:19 Online rerefence applies to the latest version of CoppeliaSim.

Perhaps you are using an older version? In the past the arguments of sim.setObjectPosition, sim.setObjectOrientation,. etc.. were in a different order.
Thanks for your help. I think It's the reason.
I'm using CoppeliaSim version 4.5.1
The project file I'm working on was create with V4.4.0
Post Reply