Regarding the issue of obtaining collision detection feedback in the ZMQ remote API

Typically: "How do I... ", "How can I... " questions
Post Reply
lumeqi
Posts: 29
Joined: 04 Dec 2023, 06:20

Regarding the issue of obtaining collision detection feedback in the ZMQ remote API

Post by lumeqi »

Hello,
I encountered some issues while using the ZeroMQ remote API for my work: now I have a trajectory composed of a series of points, and I have made the end of the UR10 robotic arm follow the trajectory. When the robotic arm moves at each point, I need to obtain the six joint angles and velocities of the robotic arm to determine the interval time between the two points. However, I found that adding these calculations made the simulation more sluggish. Now I still need to obtain real-time information on whether the robotic arm has collided during movement. If a collision occurs, feedback needs to be generated in the Python client, rather than in the Coppelia console or other locations.
So my question is as follows:
(1) Do I need to use sim. checkCollision to obtain real-time feedback results after setting a point position for the robotic arm.
(2) If I insert too much calculation when setting the position of the midpoint in the trajectory for the robotic arm, and the simulation becomes sluggish, how should I solve it? Does the simulation lag affect the motion of the real robotic arm.
Thank you very much for your help.

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

Re: Regarding the issue of obtaining collision detection feedback in the ZMQ remote API

Post by coppelia »

Hello,

it is very difficult to get an idea of what you are doing exactly, and why you are experiencing problems. Best is to identify individual problems separately.

First of all, what do you mean with sluggish? Is speed reduced? If yes, what kind of calculations exactly are you doing? Just getting the robot angles should not excessively slow-down a simulation. Additionally, have a look at the stepping mode (sim.setStepping), which allows you to trigger individual simulation steps from within your external client (with sim.step).

If you need to check for collisions, then yes, you need to call sim.checkCollision. This can be done within a CoppeliaSim script, or within your client. But maybe you do not need to check for collision in every simulation step (maybe every other simulation step, or every n simulation step is enough).

Cheers

Post Reply