Skip to content

Commit

Permalink
Merge pull request #112 from SofaDefrost/cosseratExtension-review2
Browse files Browse the repository at this point in the history
Cosserat extension review2
  • Loading branch information
adagolodjo authored Jun 26, 2024
2 parents 17593ab + 7f70e87 commit f23d6b5
Show file tree
Hide file tree
Showing 191 changed files with 141,077 additions and 3,584 deletions.
Binary file added .cache/jb/UpdateWork.dat
Binary file not shown.
1 change: 1 addition & 0 deletions .cache/jb/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(ssh://[email protected]/llvm/llvm-project.git 8f193d135b5e285f03a4863d7cf657c97c24b0b3 based on LLVM ed5dd8e5f0fb6ca4af26adcb6193a9d9106eb36a revision)
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ set(SRC_ROOT_DIR src/${PROJECT_NAME})

set(HEADER_FILES
${SRC_ROOT_DIR}/config.h.in
${SRC_ROOT_DIR}/mapping/BaseCosserat.h
${SRC_ROOT_DIR}/mapping/BaseCosserat.inl
${SRC_ROOT_DIR}/fwd.h
${SRC_ROOT_DIR}/types.h
${SRC_ROOT_DIR}/mapping/BaseCosseratMapping.h
${SRC_ROOT_DIR}/mapping/BaseCosseratMapping.inl
${SRC_ROOT_DIR}/mapping/DiscreteCosseratMapping.h
${SRC_ROOT_DIR}/mapping/DiscreteCosseratMapping.inl
${SRC_ROOT_DIR}/mapping/DiscreteDynamicCosseratMapping.h
${SRC_ROOT_DIR}/mapping/DiscreteDynamicCosseratMapping.inl
${SRC_ROOT_DIR}/mapping/ProjectionEngine.h
${SRC_ROOT_DIR}/mapping/ProjectionEngine.inl
${SRC_ROOT_DIR}/engine/ProjectionEngine.h
${SRC_ROOT_DIR}/engine/ProjectionEngine.inl
${SRC_ROOT_DIR}/mapping/DifferenceMultiMapping.h
${SRC_ROOT_DIR}/mapping/DifferenceMultiMapping.inl
${SRC_ROOT_DIR}/mapping/RigidDistanceMapping.h
Expand All @@ -37,6 +39,8 @@ set(HEADER_FILES
${SRC_ROOT_DIR}/engine/PointsManager.inl
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceField.h
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceField.inl
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceFieldRigid.h
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceFieldRigid.inl
${SRC_ROOT_DIR}/forcefield/CosseratInternalActuation.h
${SRC_ROOT_DIR}/forcefield/CosseratInternalActuation.inl
${SRC_ROOT_DIR}/constraint/CosseratSlidingConstraint.h
Expand All @@ -48,14 +52,15 @@ set(HEADER_FILES
)
set(SOURCE_FILES
${SRC_ROOT_DIR}/initCosserat.cpp
${SRC_ROOT_DIR}/mapping/BaseCosserat.cpp
${SRC_ROOT_DIR}/mapping/BaseCosseratMapping.cpp
${SRC_ROOT_DIR}/mapping/DiscreteCosseratMapping.cpp
${SRC_ROOT_DIR}/mapping/DiscreteDynamicCosseratMapping.cpp
${SRC_ROOT_DIR}/mapping/ProjectionEngine.cpp
${SRC_ROOT_DIR}/engine/ProjectionEngine.cpp
${SRC_ROOT_DIR}/mapping/DifferenceMultiMapping.cpp
${SRC_ROOT_DIR}/mapping/RigidDistanceMapping.cpp
${SRC_ROOT_DIR}/engine/PointsManager.cpp
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceField.cpp
${SRC_ROOT_DIR}/forcefield/BeamHookeLawForceFieldRigid.cpp
${SRC_ROOT_DIR}/forcefield/CosseratInternalActuation.cpp
${SRC_ROOT_DIR}/constraint/CosseratSlidingConstraint.cpp
${SRC_ROOT_DIR}/mapping/LegendrePolynomialsMapping.cpp
Expand Down Expand Up @@ -84,7 +89,7 @@ if(WIN32)
add_definitions(-D_WINSOCKAPI_)
endif()

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${DOC_FILES} ${RESOURCE_FILES} )
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${DOC_FILES} )
target_link_libraries(${PROJECT_NAME}
Sofa.Component.Constraint.Lagrangian.Model
Sofa.Component.StateContainer
Expand Down
206 changes: 147 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,147 @@
[![Gitter](https://img.shields.io/badge/chat-on_Gitter-ff69b4.svg)](https://app.gitter.im/#/room/#sofa-framework_cosserat-needle-insertion:gitter.im)
[![Support](https://img.shields.io/badge/support-on_GitHub_Discussions-blue.svg)](https://github.com/sofa-framework/sofa/discussions/categories/cosserat)

![download](https://img.shields.io/github/downloads/SofaDefrost/Cosserat/total.svg)
![forks](https://img.shields.io/github/forks/SofaDefrost/Cosserat.svg)
![stars](https://img.shields.io/github/stars/SofaDefrost/Cosserat.svg)


# Description

Cosserat model has been introduced in continuum robotics to simulate the deformation of the robot body whose geometry
and mechanical characteristics are similar to a rod.
By extension, this model can be used to simulate needles, wires.
The specificity of Cosserat's theory from the point of view of the mechanics of continuous media, is to consider that: each material point
of an object is rigid body(3 translations, 3 rotations), where most other models of continuum media mechanics consider
the material point as particles (3 translations).
For the modeling of linear structures, it is therefore possible to find a framework very close to the articulated solids with a series
of rigid body whose relative position is defined by a strain state.
This model can be used to model and control concentric tube robots, continuum robots actuated with cables, or pneumatic soft robots
with a constant cross-section.

## Features

1. Pieces-wise constant Strain PCS: This feature is base on the paper
1. __Discrete cosserat approach for soft robot dynamics: A new piece-wise constant strain model with torsion and shears__ [Link to the paper](https://ieeexplore.ieee.org/document/7759808)
2. __Coupling numerical deformable models in global and reduced coordinates for the simulation of the direct and the inverse kinematics of Soft Robots__ [Link to the paper](https://hal.archives-ouvertes.fr/hal-03192168/document)

<div align="center">
<a href="https://www.youtube.com/watch?v=qwzKAgw31pU"><img src="https://img.youtube.com/vi/qwzKAgw31pU/0.jpg" alt="link to youtube"></a>
</div>

2. Pieces-wise Non-constant Strain:
3. DCM with Plastic model

### Modelling cochlear implant using Discret Cosserat Model (DCM)

| View 1 | View 2 | View 3 |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| <img src="/doc/images/multiSectionWithColorMap1.png" width="300" title="DCM as an implant"> | <img src="/doc/images/multiSectionWithColorMap2.png" width="300" title="DCM as an implant"> | <img src="/doc/images/multiSectionWithColorMap3.png" width="300" title="DCM as an implant"> |

### DCM for cable modeling to control deformable robots:
| Direct simulation of a soft gripper | The study the model convergence |
|------------------------------------------------------------------------------------------| --- |
| <img src="/doc/images/cosseratgripper_2.png" width="400" title="DCM for cable modeling"> | <img src="/doc/images/tenCossseratSections.png" width="400" title="DCM for cable modeling ">|

### Some use cases

| <img src="/doc/images/actuationConstraint_2.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="doc/images/circleActuationConstraint.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="/doc/images/actuationConstraint_1.png" width="300" title="DCM Beam actuation using a cable"> |
| ------------- |:-------------:| -----:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =```| Beam actuation using a cable ```d =```|


| <img src="/doc/images/example1.gif" width="300" title="PCS_Example1.py "> | <img src="./doc/images/example2.gif" widt="300" title="PCS_Example2.py"> | <img src="./doc/images/example2.gif" width="300" title="PCS_Example3.PCS"> |
| ------------- |:-------------:| -------------:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =```| Beam actuation using a cable ```d =```|


Format: ![Alt Text]

# Cosserat
<div class="highlight-content">
<strong>Overview</strong>

An open-source plugin, designed to be compatible with the Sofa framework, facilitates the simulation of 1D objects.
Specifically, it caters to the modeling of both rigid and flexible 1D entities, like rods, wires or needles, using the Cosserat beam theory.
In this context, we have outlined a range of potential applications for this plugin. If you wish to explore its functionality, you have the flexibility to construct scenes using Python or XML, or you can take it a step further by developing new C++ components.
We also welcome contributions from the community to enhance and expand the capabilities of this plugin.

</div>

## Description related to Soft-body modeling

The Cosserat model has found applications in the realm of continuum robotics, particularly for simulating the deformation of robot bodies with geometries and mechanical properties akin to rods.
This model aligns closely with the dynamic deformation patterns exhibited by soft manipulators, as it can effectively replicate nonlinear deformations encompassing bending, torsion, extension, and shearing.

One distinctive feature of Cosserat's theory, within the domain of continuous media mechanics, lies in its conceptualization:
it views each material point of an object as a rigid body with six degrees of freedom (three translations and three rotations).
In contrast, many other models in continuum media mechanics tend to treat material points as particles with only three translation degrees of freedom.

When modeling linear structures, this framework enables the creation of a structure closely resembling articulated solids, consisting of a series of rigid bodies whose relative positions are defined by their strain states.
Consequently, this model serves as a versatile tool for modeling and controlling a variety of systems, including concentric tube robots, continuum robots driven by cables, or pneumatic soft robots with constant cross-sections.

Go into theorotical part of the plugin [Theory](docs/text/Theory.md)

Follow the tutorial : [cosserat_tutorial](docs/text/cosserat_tutorial.md)
## Some use cases


### Modeling and control

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

#### Direct control

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

#### Modeling cochlear implant using Discret Cosserat Model (DCM)


| View 1 | View 2 | View 3 |
|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| ![333](docs/images/multiSectionWithColorMap1.png) | ![333](docs/images/multiSectionWithColorMap2.png) | ![333](docs/images/multiSectionWithColorMap3.png) |


## Utilizing the Discrete Cosserat Model for Cable Modeling in Deformable Robot Control:


| Direct simulation of a soft gripper | The study of the model convergence |
|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| ![400](docs/images/cosseratgripper_2.png) | ![400](../../../../Templater/images/tenCossseratSections.png.md) |


---

<strong> Actuation </strong>

| <img src="/docs/images/actuationConstraint_2.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="docs/images/circleActuationConstraint.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="/docs/images/actuationConstraint_1.png" width="300" title="DCM Beam actuation using a cable"> |
|---------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =``` | Beam actuation using a cable ```d =``` |


| <img src="/docs/images/example1.gif" width="300" title="PCS_Example1.py "> | <img src="./docs/images/example2.gif" widt="300" title="PCS_Example2.py"> | <img src="./docs/images/example2.gif" width="300" title="PCS_Example3.PCS"> |
|----------------------------------------------------------------------------|:-------------------------------------------------------------------------:|----------------------------------------------------------------------------:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =``` | Beam actuation using a cable ```d =``` |

<strong> Tripod using bending lab sensors </strong>
Format: ![Alt Text]


### Inverse Control


## Publications
1. Pieces-wise constant Strain PCS: This feature is based on the paper
- __Discrete cosserat approach for soft robot dynamics: A new piece-wise constant strain model with torsion and shears__ [Link to the paper](https://ieeexplore.ieee.org/document/7759808)
- __Coupling numerical deformable models in global and reduced coordinates for the simulation of the direct and the inverse kinematics of Soft Robots__ [Link to the paper](https://ieeexplore.ieee.org/abstract/document/9362217).
The link to download the Pdf of the Paper: __https://hal.archives-ouvertes.fr/hal-03192168/document__

<div align="center">
<a href="https://www.youtube.com/watch?v=qwzKAgw31pU"><img src="https://img.youtube.com/vi/qwzKAgw31pU/0.jpg" alt="link to youtube"></a>
</div>

2. Pieces-wise Non-constant Strain:
3. DCM with Plastic model


%%% old_version
[![Gitter](https://img.shields.io/badge/chat-on_Gitter-ff69b4.svg)](https://app.gitter.im/#/room/#sofa-framework_cosserat-needle-insertion:gitter.im)
[![Support](https://img.shields.io/badge/support-on_GitHub_Discussions-blue.svg)](https://github.com/sofa-framework/sofa/discussions/categories/cosserat)

![download](https://img.shields.io/github/downloads/SofaDefrost/Cosserat/total.svg)
![forks](https://img.shields.io/github/forks/SofaDefrost/Cosserat.svg)
![stars](https://img.shields.io/github/stars/SofaDefrost/Cosserat.svg)


# Description

Cosserat model has been introduced in continuum robotics to simulate the deformation of the robot body whose geometry
and mechanical characteristics are similar to a rod.
By extension, this model can be used to simulate needles, wires.
The specificity of Cosserat's theory from the point of view of the mechanics of continuous media, is to consider that: each material point
of an object is rigid body(3 translations, 3 rotations), where most other models of continuum media mechanics consider
the material point as particles (3 translations).
For the modeling of linear structures, it is therefore possible to find a framework very close to the articulated solids with a series
of rigid body whose relative position is defined by a strain state.
This model can be used to model and control concentric tube robots, continuum robots actuated with cables, or pneumatic soft robots
with a constant cross-section.

## Features

1. Pieces-wise constant Strain PCS: This feature is base on the paper
1. __Discrete cosserat approach for soft robot dynamics: A new piece-wise constant strain model with torsion and shears__ [Link to the paper](https://ieeexplore.ieee.org/document/7759808)
2. __Coupling numerical deformable models in global and reduced coordinates for the simulation of the direct and the inverse kinematics of Soft Robots__ [Link to the paper](https://hal.archives-ouvertes.fr/hal-03192168/document)

<div align="center">
<a href="https://www.youtube.com/watch?v=qwzKAgw31pU"><img src="https://img.youtube.com/vi/qwzKAgw31pU/0.jpg" alt="link to youtube"></a>
</div>

2. Pieces-wise Non-constant Strain:
3. DCM with Plastic model

### Modelling cochlear implant using Discret Cosserat Model (DCM)

| View 1 | View 2 | View 3 |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| <img src="/doc/images/multiSectionWithColorMap1.png" width="300" title="DCM as an implant"> | <img src="/doc/images/multiSectionWithColorMap2.png" width="300" title="DCM as an implant"> | <img src="/doc/images/multiSectionWithColorMap3.png" width="300" title="DCM as an implant"> |

### DCM for cable modeling to control deformable robots:
| Direct simulation of a soft gripper | The study the model convergence |
|------------------------------------------------------------------------------------------| --- |
| <img src="/doc/images/cosseratgripper_2.png" width="400" title="DCM for cable modeling"> | <img src="/doc/images/tenCossseratSections.png" width="400" title="DCM for cable modeling ">|

### Some use cases

| <img src="/doc/images/actuationConstraint_2.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="doc/images/circleActuationConstraint.png" width="300" title="DCM Beam actuation using a given cable"> | <img src="/doc/images/actuationConstraint_1.png" width="300" title="DCM Beam actuation using a cable"> |
| ------------- |:-------------:| -----:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =```| Beam actuation using a cable ```d =```|


| <img src="/doc/images/example1.gif" width="300" title="PCS_Example1.py "> | <img src="./doc/images/example2.gif" widt="300" title="PCS_Example2.py"> | <img src="./doc/images/example2.gif" width="300" title="PCS_Example3.PCS"> |
| ------------- |:-------------:| -------------:|
| DCM Beam actuation using a cable ```d =``` | DCM Beam actuation using a cable ```d =```| Beam actuation using a cable ```d =```|


Format: ![Alt Text]

2 changes: 1 addition & 1 deletion Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.12)

set(This Cosserat_test)

Expand Down
Binary file added docs/images/CosseratMapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/PCS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231025171449.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231102173536.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231108201224.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231108233708.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231108234643.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231109002926.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231109003349.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231109003734.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231109003934.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Pasted image 20231109004616.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f23d6b5

Please sign in to comment.