Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
64467b2
Resolve remaining bugs related to SoftRobot plugin compilation issues.
adagolodjo Aug 22, 2024
37b54a7
update python prefabs
adagolodjo Aug 30, 2024
df9225e
Merge branch 'fixLinkWithSoftRobot' into update_python_prefabs
adagolodjo Aug 30, 2024
9de9336
Merge pull request #128 from SofaDefrost/master
adagolodjo Sep 2, 2024
79547ec
fix bugs due to Sofa Update
adagolodjo Sep 5, 2024
05451bd
Merge branch 'update_python_prefabs' of github.com:SofaDefrost/plugin…
adagolodjo Sep 5, 2024
bd2d47e
fix bugs due to Sofa Update
adagolodjo Sep 5, 2024
ef0220c
Refactor Cosserat prefab to remove visualization parameters and simpl…
adagolodjo Sep 6, 2024
1a439c8
-----> qwen2
adagolodjo Sep 6, 2024
f76833e
-----> qwen2
adagolodjo Sep 6, 2024
87c1064
Refactor naming consistency and update parameters in BeamPhysicsParam…
adagolodjo Sep 6, 2024
8f84fab
Rename parameter data class for prefab use case"
adagolodjo Sep 6, 2024
609dd33
Refactoring
adagolodjo Sep 6, 2024
1411919
Refactor naming consistency and update parameters in BeamPhysicsParam…
adagolodjo Sep 6, 2024
ff18262
Rename parameter data class for prefab use case"
adagolodjo Sep 6, 2024
60add9d
cleanning prefab
adagolodjo Sep 8, 2024
3f200fa
Merge remote-tracking branch 'origin/update_python_prefabs' into upda…
adagolodjo Sep 8, 2024
e469781
Merge branch 'master' of github.com:SofaDefrost/plugin.Cosserat
adagolodjo Sep 10, 2024
49bf1c5
code cleanning
adagolodjo Sep 11, 2024
ca025cd
Merge branch 'master' of github.com:SofaDefrost/plugin.Cosserat
adagolodjo Oct 3, 2024
b0cf1a2
merge master to update_python_prefabs branch
adagolodjo Oct 4, 2024
1c7d597
clean tuto scenes
adagolodjo Oct 7, 2024
9332cde
update tuto3 scene regarding the modification of cosserat's prefab
adagolodjo Oct 8, 2024
0752b10
Add beam structure with points and controller for cable actuation
adagolodjo Oct 9, 2024
a5e9503
adding new scens
adagolodjo Oct 9, 2024
21b4cdf
Refactor CosseratBase and tutorial scenes to update parameter handlin…
adagolodjo Oct 14, 2024
368f0d2
Refactor CosseratBase and tutorial scenes to update parameter handlin…
adagolodjo Oct 14, 2024
07fa31e
Enhance FEM object integration and update beam parameters
adagolodjo Oct 16, 2024
8f54ed3
Fix logging in SparseLDLSolver and update gravity in tutorial
adagolodjo Oct 30, 2024
04ec1c8
enhance and restructure FEM mesh handling and visualization
adagolodjo Nov 15, 2024
ef893b2
Merge branch 'master' of github.com:SofaDefrost/plugin.Cosserat
adagolodjo Nov 29, 2024
ee91fb7
merge master
adagolodjo Nov 29, 2024
795b81c
Merge remote-tracking branch 'upstream/master' into update_python_pre…
alxbilger Dec 3, 2024
78e8133
Merge branch 'master' of github.com:SofaDefrost/plugin.Cosserat
adagolodjo Dec 3, 2024
ecbd8b0
Refactor PCS_Example3.py: Remove unused code, fix variable names, and…
adagolodjo Dec 3, 2024
d4d4ce8
Merge branch 'master' of github.com:SofaDefrost/plugin.Cosserat
adagolodjo Dec 7, 2024
b3eabbb
merge master, and remove non necessary file
adagolodjo Dec 7, 2024
8780aaf
clean the test
adagolodjo Apr 12, 2025
671ea0a
add lie group
adagolodjo Apr 12, 2025
dcc5510
clean the test
adagolodjo Apr 12, 2025
26f730c
docs(lie-groups): add implementation roadmap and documentation
adagolodjo Apr 12, 2025
b218d74
Merge branch 'master' into update_python_prefabs
adagolodjo Apr 12, 2025
bf39cdc
docs: Add comprehensive Lie group documentation and utilities
adagolodjo Apr 12, 2025
21c1622
Merge remote-tracking branch 'origin/feature/lie-groups' and resolve …
adagolodjo Apr 12, 2025
e52b15b
Update CMakeLists files
adagolodjo Apr 12, 2025
fb5811f
Merge branch 'feature/lie-groups' into feature/comprehensive-improvem…
adagolodjo Apr 12, 2025
89f74f4
feat: Add BaseBeamHookeLawForceField and update beam force field impl…
adagolodjo Apr 13, 2025
53fa260
refactor(forcefield): Update BeamHookeLawForceField to inherit from B…
adagolodjo Apr 13, 2025
40ea643
Reorganize codebase structure and improve documentation
adagolodjo Apr 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/python3/cosserat/CosseratBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def _addRigidBaseNode(self):
template="Rigid3d",
name="RigidBaseMO",
showObjectScale=0.2,
position=positions
position=positions,
translation=self.translation,
rotation=self.rotation
)
rigidBaseNodeMo.showObject.setParent(self.showObject)

Expand Down Expand Up @@ -226,8 +228,8 @@ def _addCosseratFrame(self, framesF, curv_abs_inputS, curv_abs_outputF):
template="Rigid3d",
name="FramesMO",
position=framesF,
showIndices=self.params.beamGeoParams.showFramesObject,
showObject=self.params.beamGeoParams.showFramesObject,
showIndices=self.params.beamGeoParams.show_frames_indices,
showObject=self.params.beamGeoParams.show_frames_object,
showObjectScale=1.8, # Todo: remove this hard code
)

Expand Down
8 changes: 6 additions & 2 deletions examples/python3/useful/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def calculate_frame_parameters(beamGeoParams):
return frames_f, curv_abs_output_f, cable_position_f


def generate_edge_list(cable3DPos: List[List[float]]) -> List[int]:
def generate_edge_list(cable3DPos: List[List[float]]) -> list[list[int]]:
"""
Generate an edge list required in the EdgeSetTopologyContainer component.

Expand All @@ -78,7 +78,11 @@ def generate_edge_list(cable3DPos: List[List[float]]) -> List[int]:
List[int]: A list of indices forming edges in the EdgeSetTopologyContainer.
"""
number_of_points = len(cable3DPos)
return [i for i in range(number_of_points - 1) for _ in range(2)]
edges = []
for i in range(number_of_points - 1):
edges.append([i,i+1])
return edges



class CosseratGeometry:
Expand Down
24 changes: 15 additions & 9 deletions examples/python3/useful/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os


def addHeader(parentNode, multithreading=False, inverse=False, isConstrained=False, isContact=False):
def addHeader(parentNode, multithreading=False, inverse=False, isConstrained=False, isContact=False, params=None):
"""
Adds to rootNode the default headers for a simulation with contact. Also adds and returns three nodes:
- Settings
Expand Down Expand Up @@ -68,7 +68,7 @@ def addHeader(parentNode, multithreading=False, inverse=False, isConstrained=Fal

parentNode.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels '
'hideBoundingCollisionModels hideForceFields '
'hideInteractionForceFields hideWireframe showMechanicalMappings')
'showInteractionForceFields hideWireframe showMechanicalMappings')
if isConstrained:
parentNode.addObject('FreeMotionAnimationLoop', parallelCollisionDetectionAndFreeMotion=multithreading,
parallelODESolving=multithreading)
Expand All @@ -78,20 +78,26 @@ def addHeader(parentNode, multithreading=False, inverse=False, isConstrained=Fal
multithreading=multithreading, epsilon=1)
else:
parentNode.addObject('GenericConstraintSolver', name='ConstraintSolver', tolerance=1e-8, maxIterations=100,
multithreading=multithreading)
multithreading=multithreading, printLog=1)

if isContact:
contactHeader(parentNode)
contactHeader(parentNode, _contact_params=params.contactParams)


# components needed for contact modeling
def contactHeader(parentNode):
def contactHeader(parentNode, _contact_params=None):
parentNode.addObject('CollisionPipeline')
parentNode.addObject("DefaultVisualManagerLoop")
parentNode.addObject('RuleBasedContactManager', responseParams='mu=0.8', response='FrictionContactConstraint')
parentNode.addObject('BruteForceBroadPhase')
parentNode.addObject('BVHNarrowPhase')
parentNode.addObject('LocalMinDistance', alarmDistance=0.05, contactDistance=0.01)
if not _contact_params == None:
parentNode.addObject('RuleBasedContactManager', responseParams=_contact_params.responseParams,
response='FrictionContactConstraint')
parentNode.addObject('LocalMinDistance', alarmDistance=_contact_params.alarmDistance,
contactDistance=_contact_params.contactDistance)
else :
parentNode.addObject('RuleBasedContactManager', responseParams='mu=0.1', response='FrictionContactConstraint')
parentNode.addObject('LocalMinDistance', alarmDistance=0.05, contactDistance=0.01)


def addVisual(node):
Expand All @@ -105,7 +111,7 @@ def addVisual(node):
"""
node.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels hideCollisionModels '
'hideBoundingCollisionModels hideForceFields '
'hideInteractionForceFields hideWireframe showMechanicalMappings')
'showInteractionForceFields hideWireframe showMechanicalMappings')
return node


Expand Down Expand Up @@ -134,7 +140,7 @@ def addSolverNode(node, name='solverNode', template='CompressedRowSparseMatrixd'
if iterative:
solverNode.addObject('CGLinearSolver', name='Solver', template=template)
else:
solverNode.addObject('SparseLDLSolver', name='Solver', template=template)
solverNode.addObject('SparseLDLSolver', name='Solver', template=template, printLog=True)
if isConstrained:
solverNode.addObject('GenericConstraintCorrection', linearSolver=solverNode.Solver.getLinkPath())

Expand Down
5 changes: 3 additions & 2 deletions examples/python3/useful/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class BeamGeometryParameters:
) # The beam rigid base position as a list [x, y, z]

"""Parameters for the visualisation of the beam"""
showFramesObject: int = 1
show_frames_object: bool = True
show_frames_indices: bool = False
showRigidBaseObject: int = 1


Expand Down Expand Up @@ -71,7 +72,7 @@ class VisualParameters:
class ContactParameters:
"""Contact parameters"""

responseParams: str = "mu=0.8"
responseParams: str = "mu=0.0"
response: str = "FrictionContactConstraint"
alarmDistance: float = 0.05
contactDistance: float = 0.01
Expand Down
3 changes: 2 additions & 1 deletion src/Cosserat/constraint/CosseratActuatorConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ using sofa::core::ConstraintParams;
using sofa::linearalgebra::BaseVector;
using sofa::core::visual::VisualParams ;
using sofa::core::behavior::ConstraintResolution;
using softrobots::constraint::CableModel;


class MyCableForceConstraintResolution : public ConstraintResolution
Expand Down Expand Up @@ -114,7 +115,7 @@ class MyCableForceConstraintResolution : public ConstraintResolution
*
*/
template< class DataTypes >
class CosseratActuatorConstraint : public softrobots::constraint::CableModel<DataTypes>
class CosseratActuatorConstraint : public CableModel<DataTypes>
{
public:
SOFA_CLASS(SOFA_TEMPLATE(CosseratActuatorConstraint,DataTypes), SOFA_TEMPLATE(CableModel,DataTypes));
Expand Down
7 changes: 4 additions & 3 deletions src/Cosserat/constraint/QPSlidingConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ using sofa::linearalgebra::BaseVector ;
using sofa::core::ConstraintParams ;
using sofa::helper::ReadAccessor ;
using sofa::core::VecCoordId ;
using softrobots::constraint::CableModel;

using sofa::core::behavior::ConstraintResolution ;
//using sofa::component::constraint::lagrangian::model::ConstraintResolution;
Expand Down Expand Up @@ -145,7 +146,7 @@ class QPSlidingConstraint : public softrobots::constraint::CableModel<DataTypes>
/// Bring m_state in the current lookup context.
/// otherwise any access to the base::attribute would require
/// using the "this->" approach.
using SoftRobotsConstraint<DataTypes>::m_state ;
using softrobots::constraint::SoftRobotsConstraint<DataTypes>::m_state ;
////////////////////////// Inherited attributes ////////////////////////////
/// https://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html
/// Bring inherited attributes and function in the current lookup context.
Expand All @@ -160,8 +161,8 @@ class QPSlidingConstraint : public softrobots::constraint::CableModel<DataTypes>
using CableModel<DataTypes>::d_componentState ;
////////////////////////////////////////////////////////////////////////////
/// \brief internalInit
using SoftRobotsConstraint<DataTypes>::m_nbLines ;
using SoftRobotsConstraint<DataTypes>::m_constraintIndex ;
using softrobots::constraint::SoftRobotsConstraint<DataTypes>::m_nbLines ;
using softrobots::constraint::SoftRobotsConstraint<DataTypes>::m_constraintIndex ;

void internalInit();
};
Expand Down