Page 1 of 1

### How to make a flexible cable?

Posted: 18 Dec 2014, 16:24
Hello everyone,

I recently started working with V-REP and I have to say it is really an amazing program!

Im trying to make a simulation of picking up the end of a cable that is attached to the ground. I want it first to be loose, and then pick it up with a gripper and pull it tight.
In one of the demo videos I saw a flexible cable which was simulated with the use of inverse kinematics endpoint contstraints and a “desire of straightness” constraint. So I think this should be possible.

Does anyone know how I can accomplish this?

Is this a correct approach?
1. Make a cuboid with a long cylinder attached to it.
2. Adding dummies to the tip of the cylinder and link them with the IK tip-target type and select the cuboid as base.
3. Make the material flexible.

I already followed the inverse kinematics tutorial, so the first 2 steps are no problem. I’m however not sure how I should make the material flexible.

squiq

### Re: How to make a flexible cable?

Posted: 18 Dec 2014, 23:08
Hello squiq,

the big question is whether you want your cable to be able to interact with the environment (e.g. not intersect with the floor, and obstacle, or itself, or fall to the ground (i.e. feel the effect of gravity)).

If you want interaction with the environment, which I suspect you do, then you cannot use IK.

The procedure is as follows:

What you should do is create a cable using dynamic link elements (non-static and collidable). Consecutive links should have a different collidable mask, otherwise you'll create additional constraints.

For your cable do something like:

body --> revoluteJoint --> body --> revoluteJoint --> body --> revoluteJoint --> body --> etc.

Depending on what you need, you can alternate the orientation of the revolute joints in order to achieve a bending in 2 directions. You can apply a spring behaviour to your revolute joints.

If your cable doesn't need a spring behaviour, but should more act as a rope, then use spherical joints instead of revolute joints: then you will automatically have 3 degrees of freedom between each body element. Here is an example.

Cheers

### Re: How to make a flexible cable?

Posted: 19 Dec 2014, 09:17
Hello coppela,

Thanks a lot for your answer! Indeed I want my cable to interact with the environment like a rope.
I will use the spherical joints. Very helpfull!

cheers,

squiq

### Re: How to make a flexible cable?

Posted: 18 Jan 2019, 11:43
Hello,
I'm working on a project related to cables, though this wasn't much related to the work, I just downloaded the file to see what it's all about. I run the simulation, it worked but once when I changed the joint motion to torque/force mode, it stopped working. So I again changed the mode to Motion mode (DEPRECATED) but it stopped working. What did I do wrong there, I didn't get that. Please help me out with that.
Thank you.

### Re: How to make a flexible cable?

Posted: 18 Jan 2019, 14:32
This scene comes from an old version of V-REP.
To actuate the joint again, simply set it to passive mode, and then attach a non-threaded child script to that joint with following code:

Code: Select all

``````function sysCall_init()
h=sim.getObjectAssociatedWithScript(sim.handle_self)
da=50*math.pi/180 -- rot velocity
end

function sysCall_actuation()
local a=sim.getJointPosition(h)
a=a+da*sim.getSimulationTimeStep()
sim.setJointPosition(h,a)
end``````
Cheers

### Re: How to make a flexible cable?

Posted: 11 Dec 2019, 16:53
Hello copellia,

I am new to V-REP and currently working on a project to simulate a cable binding robot. Is it possible to simulate a bendable and long steel cable which possesses the material properties of steel that can interact with the environment in V-REP (the steel cable is meant to be dragged, gripped, bent and knocked with the manipulators of the robot)?

### Re: How to make a flexible cable?

Posted: 18 Dec 2019, 23:33
Hello,

see also my reply to your other post. Generally, you will have to approximate a cable by a series of rigid elements linked via spring-dampers. But it wouldn't expect more than 3-4 elements to give very realistic simulation results, i.e. don't expect to be able to simulate you cable with 10-50 elements and that your cable will behave as expected. CoppeliaSim can perform rigid body simulations, and a bit more by subdividing bendable elements into sub-elements.

Cheers