tud-phi / ros2-elastica

ROS2 package implementing Elastica
0 stars 0 forks source link

Re-work actuation model #16

Closed mstoelzle closed 2 years ago

mstoelzle commented 2 years ago

After looking at your current implementation and looking through Elasticas tutorials and code, I realised that we need to change the actuation model:

Accordingly, the current ControlInput msg can be kept, but should be renamed to MuscleTorques msg with fields direction, angular_frequency, wave_number, phase_shift, ramp_up_time and spline_control_points as documented here: https://github.com/GazzolaLab/PyElastica/blob/master/elastica/_elastica_numpy/_external_forces.py#L200

mstoelzle commented 2 years ago

I see that the torque is multiplied with the director collection, so probably its in a local coordinate frame? https://github.com/GazzolaLab/PyElastica/blob/master/elastica/_elastica_numpy/_external_forces.py#L162

RUFFY-369 commented 2 years ago

After looking at your current implementation and looking through Elasticas tutorials and code, I realised that we need to change the actuation model:

  • We consider a soft robotic arm actuated pneumatically. Pneumatic actuation allows us to apply a constant torque over a specified sub-length of the arm (also called a segment).
  • We should implement this analogy to pneumatic actuation also in simulation. I think the easiest strategy would be to connect multiple rods with fixed joints. Every rod represents aa segment with one pneumatic actuation model. This means, that we should apply a uniform torque along the rod. The control input in this case should be a sequence of torques for each segment.
  • [ ] Please find out into which direction the UniformTorque on a rod is applied to. Is this in the world coordinate frame or the local coordinate frame of the rod? If we cannot adapt the direction of control online, we should add a UniformTorque into each cardinal direction, so that we can scale each cartesian torque component during the simulation

Accordingly, the current ControlInput msg can be kept, but should be renamed to MuscleTorques msg with fields direction, angular_frequency, wave_number, phase_shift, ramp_up_time and spline_control_points as documented here: https://github.com/GazzolaLab/PyElastica/blob/master/elastica/_elastica_numpy/_external_forces.py#L200

mstoelzle commented 2 years ago
RUFFY-369 commented 2 years ago
mstoelzle commented 2 years ago
RUFFY-369 commented 2 years ago
RUFFY-369 commented 2 years ago

After looking at your current implementation and looking through Elasticas tutorials and code, I realised that we need to change the actuation model:

  • We consider a soft robotic arm actuated pneumatically. Pneumatic actuation allows us to apply a constant torque over a specified sub-length of the arm (also called a segment).
  • We should implement this analogy to pneumatic actuation also in simulation. I think the easiest strategy would be to connect multiple rods with fixed joints. Every rod represents aa segment with one pneumatic actuation model. This means, that we should apply a uniform torque along the rod. The control input in this case should be a sequence of torques for each segment.
  • [ ] Please find out into which direction the UniformTorque on a rod is applied to. Is this in the world coordinate frame or the local coordinate frame of the rod? If we cannot adapt the direction of control online, we should add a UniformTorque into each cardinal direction, so that we can scale each cartesian torque component during the simulation

Accordingly, the current ControlInput msg can be kept, but should be renamed to MuscleTorques msg with fields direction, angular_frequency, wave_number, phase_shift, ramp_up_time and spline_control_points as documented here: https://github.com/GazzolaLab/PyElastica/blob/master/elastica/_elastica_numpy/_external_forces.py#L200

  • Yeah in the current actuation model the arm is considered like a single strand of muscle where torque is applied in the form of beta spline for the actuation of whole arm together.
  • Regarding changing the actuation model to pneumatically actuated arm how're you thinking of the arrangement of the segments. Is it like (for now) a single linear attachment of segments (which can each be seen as a pneumatic chamber) making the whole arm?
  • Should we assume that the torque in each pneumatic segment is uniform throughout the actuation if we're using uniform torque?
  • Also, what values of the properties of material should we take for each segment, i.e., NU(energy dissipation coefficient), poisson ratio & young's modulus. Will it be better to choose those values after defining the environment?
  • Yeah I'll find that out.
  • We're not using the MuscleTorque class as that gives the muscle torque in the form of a travelling wave for which these (angular_frequency, wave_number, phase_shift, ramp_up_time ) params are required but instead just the control points' values.
  • Also, can we move the current actuation model where varying beta spline is used for the actuation of the whole arm to a different branch from main. And push the commits for new pneumatic actuation model to the main branch

This in reference to the last bullet point question for changing the branch name

mstoelzle commented 2 years ago
  • Also, can we move the current actuation model where varying beta spline is used for the actuation of the whole arm to a different branch from main. And push the commits for new pneumatic actuation model to the main branch

Yes, I am fine with this strategy

mstoelzle commented 2 years ago
  • Alright, will ensure that. Okay so, kind of like a restoring force which is always acting in the absence as well the presence of external torques, right?

Yes, exactly. Possibly, this is already a property of cosserad rods? If not, we need to add it manually. The force is always proportional to the curvature of the segment:

tau_elastic = K @ kappa
RUFFY-369 commented 2 years ago
  • Alright, will ensure that. Okay so, kind of like a restoring force which is always acting in the absence as well the presence of external torques, right?

Yes, exactly. Possibly, this is already a property of cosserad rods? If not, we need to add it manually. The force is always proportional to the curvature of the segment:

tau_elastic = K @ kappa

Yes, @mstoelzle it is already there in elastica. I just simulated the flagella structure & visualised to confirm it. For first 3 seconds one set of control points, for another three different set & then in the remaining time control points are set to a zero array. The behaviour can be seen in the GIF below: flagella

mstoelzle commented 2 years ago

Yes, @mstoelzle it is already there in elastica. I just simulated the flagella structure & visualised to confirm it. For first 3 seconds one set of control points, for another three different set & then in the remaining time control points are set to a zero array. The behaviour can be seen in the GIF below:

Ok, nice! So this is not something we have to specifically address for now then

RUFFY-369 commented 2 years ago

Yep this satisfies one behavioural characteristic now for the simulation of the SR arm you mentioned

RUFFY-369 commented 2 years ago

Hi @mstoelzle , In the recent commits I've changed the actuation model to the following: Number of rods (pneumatic segments): 6 Number of elements per rod : 50 Control Method: Uniform Torque in three directions per segment Joint between segments: Fixed joint