Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Setting exact cable lengths and getting cable forces
#1
Hello,

I have 3 questions I would like to get clarified.


   



1 - Setting exact cable lengths


In one of my earlier questions you mentioned that,



"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).





This is usually useful to calculate strain (deformation due to forces), which is the ratio between the calculated length and the rest length."



If I have a load attached to 4 cables as shown in the scene.
And If i give control inputs to the cables as [28, 28, 28, 28] where the inutial cable lengths at the start  are [25, 25, 25, 25].
I would like to have the cable lengths to be exactly [28, 28, 28, 28] but at the moment I get something like [27.830832 27.834806 27.824314 27.820284]
And If i change the cable lengths again to  [25, 25, 30, 30] the results induced more offset from the applied control input and I get [25.510212 25.506298 29.991457 29.995811].

Currently I have 100 substeps for the solver.

Would it be logical to set cable lengths until the rest lengths attain the applied control , because at the moment I am applying the control until the current length reaches the applied control

Code:
public Action SetCable1(float length, float control_ip, float velocity)
    {
        float c1_control_ip = control_ip;
        float c1_len = length;
        float c1_vel = velocity;

        return () =>
        {
            if (c1_len > c1_control_ip + cable_threshold)
            {
                cursor1.ChangeLength(c1_len - c1_vel * time_dt);
            }
            else if (c1_len < c1_control_ip - cable_threshold)
            {
                cursor1.ChangeLength(c1_len + c1_vel * time_dt);
            }
            else if (c1_len == c1_control_ip - cable_threshold)
            {
                Debug.Log("Current Length and Control input are the same for Cable 1");
                return;
            }
        };
    }


I just want to know if there is a way to set the exact cable lengths I give as control inputs.

2 - Getting Cable Forces
Also I would like to know if there is a way in Obi rope to get cable forces at the points where the cables are attached to the load object (or ideally at different points of the cables)?


3 - Controlling the attached load object
Is it possible in Obi rope to moved the attached load and the cables just extend according to the load position?
Like inverse kinematics.

Any suggestions/ advice or clarifications are greatly appreciated.


Thank You.
Reply


Messages In This Thread
Setting exact cable lengths and getting cable forces - by rohit_dhak - 26-06-2023, 05:57 AM