Are global variables needed in ZeroMQ remote API Matlab?

Typically: "How do I... ", "How can I... " questions
Post Reply
andrea1999
Posts: 8
Joined: 30 Oct 2023, 19:01

Are global variables needed in ZeroMQ remote API Matlab?

Post by andrea1999 »

Hello, I'm trying to make the cartpole example with reinforcement learning in Matlab simulating it on Coppelia. I'm using ZeroMQ remote API.

I have a main code and a class with some functions. Everytime I try to use API functions inside the class I get the error:
"Caused by:
Error using RemoteAPIClient/call
44: in sim.setJointTargetVelocity: one of the function's argument type is not correct."

Is that because I would have to create global variables for the arguments of the API functions? Because the same error happened with "sim.startSimulation();" but when I created the global variable "sim" it has worked.

Thank you

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Are global variables needed in ZeroMQ remote API Matlab?

Post by coppelia »

Hello,

make sure that sim is accessible from your code location. Making sim global is one possibility. But the error message ...one of the function's argument type is not correct. is directly caused by CoppeliaSim, not MATLAB. That means that your function call to sim.setJointTargetVelocity was successful, but decoding the correct argument was not.

Cheers

Post Reply