How to pass a list variable from external application to the script of the server?

Typically: "How do I... ", "How can I... " questions
Post Reply
Hacher
Posts: 15
Joined: 28 Nov 2024, 02:00

How to pass a list variable from external application to the script of the server?

Post by Hacher »

The function I use(sim.moveToConfig) can only be used in the thread script, while the parameter of this function can only be caculated by the external application. Therefore, I wonder konw that is there way to pass the result caculate by the external applicatioin to the sever so that the thread script can also use it?

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

Re: How to pass a list variable from external application to the script of the server?

Post by coppelia »

Hello,

that is correct that sim.moveToPose can only be used from within a thread. But its elemental pendants can also be used from within non-threaded scripts: sim.moveToPose_init, sim.moveToPose_step and sim.moveToPose_cleanup.

If you need to exchange data with CoppeliaSim from an external application, you can use several means of communication with CoppeliaSim, but I would recommend the ZeroMQ remote API. From within your external application, you can call sim.callScriptFunction for that (you'll need a callable function in your script that stores thereceived data)

Cheers

Hacher
Posts: 15
Joined: 28 Nov 2024, 02:00

Re: How to pass a list variable from external application to the script of the server?

Post by Hacher »

Thank you for your reply.
Additionally, I wanna ask that how to make sure how much joint position will chang within each step when drive joint through 'sim.moveToConfig_step' ?

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

Re: How to pass a list variable from external application to the script of the server?

Post by coppelia »

Additionally, I wanna ask that how to make sure how much joint position will chang within each step when drive joint through 'sim.moveToConfig_step' ?
The position change is highly variable and is actually the core of the Ruckig motion library that powers the sim.moveToPose function. You probably meant to ask if there is a possibility to adjust the time step? Yes, you can do that during initialization (in sim.moveToPose_init) via the optional timeStep field.

Cheers

Post Reply