Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion scenes/NeedleInsertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def createScene(root):
surfGeom="@Volume/collision/geom_tri",
shaftGeom="@Needle/bodyCollision/geom_body",
volGeom="@Volume/geom_tetra",
punctureForceThreshold=16,
punctureForceThreshold=1600,
tipDistThreshold=0.003,
drawcollision=True,
drawPointsScale=0.0001
Expand Down
2 changes: 1 addition & 1 deletion scenes/NeedleInsertionCycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def createScene(root):
surfGeom="@Volume/collision/geom_tri",
shaftGeom="@Needle/bodyCollision/geom_body",
volGeom="@Volume/geom_tetra",
punctureForceThreshold=2.,
punctureForceThreshold=200,
tipDistThreshold=0.003,
drawcollision=True,
drawPointsScale=0.0001
Expand Down
2 changes: 1 addition & 1 deletion scenes/NeedleInsertionHaptics.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def createScene(root):
surfGeom="@Volume/collision/geom_tri",
shaftGeom="@Needle/bodyCollision/geom_body",
volGeom="@Volume/geom_tetra",
punctureForceThreshold=1.,
punctureForceThreshold=100,
tipDistThreshold=0.01,
drawcollision=True,
drawPointsScale=0.0001
Expand Down
3 changes: 3 additions & 0 deletions src/CollisionAlgorithm/algorithm/InsertionAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,15 @@ InsertionAlgorithm::AlgorithmOutput InsertionAlgorithm::puncturePhase()
l_tipGeom->getContext()->get<MechStateTipType>();
const auto& lambda =
m_constraintSolver->getLambda()[mstate.get()].read()->getValue();
const auto dt = l_tipGeom->getContext()->getDt();
SReal norm{0_sreal};

for (const auto& l : lambda)
{
norm += l.norm();
}
// Convert impulse to force
norm /= dt;

if (norm > punctureForceThreshold)
{
Expand Down
Loading