30-03-2023, 08:05 AM
(This post was last modified: 30-03-2023, 08:08 AM by josemendez.)
(30-03-2023, 07:39 AM)rohit_dhak Wrote: I am giving the condition to get c2_len which is rope2.CalculateLength() set to the control input c2_control_ip
However when I logged the restLength, c2_len and c2_control_ip I saw that the c2_len is trying to set to restLength instead of c2_control_ip
Am I misunderstanding something?
The actual -calculated- length of a rope always strives to be its rest length, so this is the intended result: in your case, c2_len will strive to be as close as possible to restLength.
Imagine you have a rope that's 5 meters long at rest (under no forces). Then you hang a heavy object from it, and the rope stretches to be 5.2 meters long. Its restLength is still 5, but CalculatedLength() would return 5.2.
If you now call cursor.ChangeLength(6), the rope's restLength is set to 6, but due to the force applied by the object hanging from it its CalculatedLength() might be 6.2 (or 6.5, 7, 8.2... depending on how many substeps are used and how compliant the rope is).