Contact Force is ZERO
Posted: 28 Feb 2025, 08:12
Hello!
I set up this catalyst-rl tutorial that uses CoppeliaSim4.1 to perform reinforcement learning on a simple peg-in-hole task. https://github.com/arrival-ltd/catalyst-rl-tutorial
I'm reversing the work of this tutorial to simulate disassembly instead and I'm facing a problem. I understand that the implemented CoppeliaSim environment they used can detect collision correctly. But for some reason, the contact forces are always 0 when I try to print them. I tried using getContactInfo and I tried using a contact force inside the hole to detect the magnitude of collision force but it does not happen (prints 0).
I also tried printing the force/torque at the joints of the robot arm but this did not work as well (printing blank, not 0).
Furthermore, their initial code would terminate episode when a collision (detected correctly) between the peg and the hole take place. But I don't want to use the collision force instead. So, now that the episode is not terminating, there's penetration between the peg and the hole which is also something I do not want.
I'm using the Newton physics engine for this.
Unfortunately, I can't update to a newer CopSim version without facing a lot of discrepancies with the inner imported libraries.
Is 4.1 incapable of performing/understanding the physics interactions between parts? Can the force be too much of an "impulse" that this is the reason it's not calculating it well?
What can be the reason for these issues and is there hope to perform this on 4.1 or do I have to update? If updating to a higher CopSim version is the solution, how can I do this with minimal compatibility/discrepancy issues? Because it seems that even the most fundamental libraries have changed (e.g. libcoppeliaSim.so.1 --> libcoppeliaSim.so).
I'm new to CoppeliaSim so this might be a very basic problem, sorry.
I set up this catalyst-rl tutorial that uses CoppeliaSim4.1 to perform reinforcement learning on a simple peg-in-hole task. https://github.com/arrival-ltd/catalyst-rl-tutorial
I'm reversing the work of this tutorial to simulate disassembly instead and I'm facing a problem. I understand that the implemented CoppeliaSim environment they used can detect collision correctly. But for some reason, the contact forces are always 0 when I try to print them. I tried using getContactInfo and I tried using a contact force inside the hole to detect the magnitude of collision force but it does not happen (prints 0).
I also tried printing the force/torque at the joints of the robot arm but this did not work as well (printing blank, not 0).
Furthermore, their initial code would terminate episode when a collision (detected correctly) between the peg and the hole take place. But I don't want to use the collision force instead. So, now that the episode is not terminating, there's penetration between the peg and the hole which is also something I do not want.
I'm using the Newton physics engine for this.
Unfortunately, I can't update to a newer CopSim version without facing a lot of discrepancies with the inner imported libraries.
Is 4.1 incapable of performing/understanding the physics interactions between parts? Can the force be too much of an "impulse" that this is the reason it's not calculating it well?
What can be the reason for these issues and is there hope to perform this on 4.1 or do I have to update? If updating to a higher CopSim version is the solution, how can I do this with minimal compatibility/discrepancy issues? Because it seems that even the most fundamental libraries have changed (e.g. libcoppeliaSim.so.1 --> libcoppeliaSim.so).
I'm new to CoppeliaSim so this might be a very basic problem, sorry.