I am encountering an issue while using the ZeroMQ remote API to control a robot in CoppeliaSim. My environment is as follows:
CoppeliaSim version: V4.9.0
Operating system: Linux
Programming language: C++
Communication method: ZeroMQ remote API
Problem description:
When I tried to set the initial joint positions of the robot using sim.setJointPosition at the start of the simulation, the joints did not move visually in the simulation. However, when I subsequently called sim.getJointPosition, the returned angles matched exactly what I had sent via sim.setJointPosition. This indicates that the joint values were updated internally but not reflected visually.
As a workaround, I switched to using sim.setJointTargetPosition, and the robot’s joints moved as expected in the simulation.
Additionally, I noticed in the CoppeliaSim forums that some users mentioned sim.setJointPosition requires the joint to be set to kinematic mode. However, in my previous experience on Windows, I used MATLAB with the same robot model (with joints consistently in dynamic mode) and sim.setJointPosition worked perfectly.
Why does sim.setJointPosition fail to visually update joint positions in Linux (using C++ and ZeroMQ), while it works correctly on Windows (using MATLAB)?
How can I ensure sim.setJointPosition works reliably across different platforms?
Any insights or suggestions would be greatly appreciated. Thank you!
Inconsistent Behavior of sim.setJointPosition between Linux and Windows Platforms
Re: Inconsistent Behavior of sim.setJointPosition between Linux and Windows Platforms
The issue has been resolved. The root cause was that the C++ project had not been fully recompiled. After performing a complete rebuild of all source files in the project, the sim.setJointPosition function now works correctly, and visual joint updates are properly reflected in the simulation.