Skip to content

Fix cross-section area calculation in HookeSeratPCSForceFieldRigid#170

Open
AppaSalif wants to merge 145 commits intoSofaDefrost:masterfrom
AppaSalif:patch-5
Open

Fix cross-section area calculation in HookeSeratPCSForceFieldRigid#170
AppaSalif wants to merge 145 commits intoSofaDefrost:masterfrom
AppaSalif:patch-5

Conversation

@AppaSalif
Copy link
Copy Markdown

Small error in calculating the cross-section area.
Initially the area was A = M_PI * (r * r - rInner4); but rInner4 = rInnerrInnerrInnerrInner and not rInnerrInner

Resolve remaining bugs related to SoftRobot plugin compilation issues…
Simplify BeamGeometryParameters by removing unnecessary attributes and defaults.
Refactor: Move rigid node creation to `utils.py` and simplify `CosseratBase`.
Refactor: Move rigid node creation to `utils.py` and simplify `CosseratBase`.
Cleanning the prefab class and update the test scene regarding
Let me know if you'd like to refine this further!
Refactor event key handling and add new cable-driven Cosserat beam scene

- Updated key event handling in geo_cable_driven_cosserat_beam.py to use
string-based key comparison for + and - keys.
- Fixed minor formatting issue by adding missing comma in
RestShapeSpringsForceField.
- Added new scene file geo_cosserat_cable_driven_cosserat_beam.py for
simulating cable-driven Cosserat beams, with detailed parameter
definitions for beam geometry and physics.
- Introduced PullingCosseratCable controller in
pulling_cosserat_cable.py to handle cable pulling mechanics.
- Replaced BeamPhysicsParameters with BeamPhysicsParametersNoInertia in
tuto_5.py for more specific physical simulations.
…g and fix typos

- Changed 'beam_params' to 'params' in CosseratBase for better clarity.
- Updated parameter references in tutorial scenes (tuto_4.py, tuto_5.py)
to match new naming conventions.
- Refined BeamPhysicsParameters to use NoInertia where applicable.
- Fixed typos (e.g., 'rotateFromEuler' comment and variable names like
'nbFrames' to 'nb_frames').
- Added rigid base spring force field in CosseratBase for better beam
control.
- Organized imports and cleaned up unused variables in the tutorial
scenes.
Modify addFEMObject function to return solver and points nodes
Update beam parameters in tutorial scenes (tuto_3, tuto_4, tuto_5)
Refactor FEM object creation in tuto_5 scene
Adjust cable constraint parameters and mapping in tuto_5
Minor code cleanup and parameter naming consistency improvements
- Disabled `printLog` in `SparseLDLSolver` within `header.py` for
cleaner output.
- Set `root_node.gravity` to `[0, -9.81, 0]` in `tuto_5.py` for
realistic gravitational effect.
- Added flexibility in constraint setup for `cable_node` by introducing
`is_constrained` parameter.
- Included missing `return root_node` statement to ensure complete scene
creation in `createScene()`.
Added new functions attach_mesh_with_springs,
attach_3d_points_to_meca_with_barycentric_mapping, and
add_finger_mesh_force_field_Object to modularize and simplify FEM mesh
handling and visualization.
Introduced show_mecha_visual for toggling visibility of mechanical
objects and indices.
Replaced addFEMObject with add_finger_mesh_force_field_Object for
improved clarity and functionality.
Updated tuto_5.py to utilize new FEM mesh functions, enabling better
integration and enhanced visualization.
Removed redundant code and refactored solver and geometry attachment
logic for better maintainability.
adagolodjo and others added 29 commits December 23, 2025 17:58
- Create CosseratILQRController.h with full iLQR implementation
- Backward pass: dynamic programming with Riccati recursion
- Forward pass: Cosserat dynamics simulation
- Line search with Armijo condition
- Uses SE3::composeJacobians() from Phase 2 for dynamics linearization
- Feedback gains K_t computed via Q-function approximation
- Cost function: position/rotation tracking + control effort
- Ready for testing and examples

Architecture:
- State: x = [T_1, ..., T_N] ∈ SE(3)^N
- Control: u = [strain_1, ..., strain_N] ∈ ℝ^{6N}
- Dynamics: T_{k+1} = T_k * exp(L * u_k)

Co-Authored-By: Warp <agent@warp.dev>
- Create CosseratParameterEstimator.h (253 lines)
  * Gradient descent optimization for E, G, I, A parameters
  * MSE cost with regularization
  * Finite differences gradient computation
  * Convergence monitoring

- Create test_parameter_estimation.cpp (181 lines)
  * Test parameter recovery from synthetic data
  * Test robustness with noisy measurements
  * Test convergence behavior

- Create parameter_calibration.cpp (164 lines)
  * Full calibration example with 20 diverse configurations
  * Measurement noise simulation
  * Convergence achieves 40% cost reduction

- Update IMPLEMENTATION_PLAN.md
  * Mark Phase 3.2 and 3.3 complete
  * Update status to 100% (Phases 1-3)

- Update Tests/CMakeLists.txt to include new tests

Phase 3 (Trajectory Optimization) now complete:
✅ 3.1: Trajectory optimizer with corrected backpropagation
✅ 3.2: iLQR controller for SE(3) trajectory tracking
✅ 3.3: Physical parameter estimator (E, G, I, A)

Co-Authored-By: Warp <agent@warp.dev>
- Fix tangent adjoint storage bug (use references instead of copies)
- Remove duplicate code in applyJT constraint version
- Implement complete applyJ method with velocity propagation
- Add bounds checking with assertions
- Add cassert include
- Remove commented legacy code blocks
- Optimize debug output with guards
- Created HookeSeratDiscretMappingTest.cpp with 6 test cases
- Tests cover initialization, zero strain, Jacobian validation, curved beams
- Added finite difference Jacobian validation
- Updated task tracker and created walkthrough documentation
- Added const qualifier to getTangAdjointMatrix() in SectionInfo
- Added const qualifier to getTangAdjointMatrix() in FrameInfo
- Fixes compilation errors when calling on const references in applyJ
- Build verified successfully
- Rename variables in CosseratILQRController.h to avoid shadowing 'k'
- Fix static call to non-static member composeJacobians
- Verify build success
…eProximity + fix bugs

- Fuse computeProximity and computeNeedleProximity into a single
  computeProximityImpl(x1, x2, fixLastPoint) to eliminate ~370 lines
  of duplicated code.

- Fix min_dist criterion: use true 3D Euclidean distance (P-closest).norm()
  instead of the projection parameter |fact_v|, which was not a distance.

- Fix direction frame inconsistency: normal t1 now always comes from
  direction[best_j] (current segment's frame) instead of direction[szDst-1]
  (always the last frame, incorrect in the else-branch).

- Remove m_toModel = m_fromModel1 in init() which silently overrode the
  correctly assigned output model.

- Remove debug printf("init\n") left in production code.

- Remove unnecessary deep copies (from=x1, dst=x2); use const references.

- Replace NULL with nullptr (C++11).

- Fix d_drawArrows and d_lastPointIsFixed descriptions (copy-paste errors).

- Remove large blocks of commented-out dead code.

- Fix closing namespace comment: was '// namespace sofa',
  now '// namespace Cosserat::mapping'.
…ookeserat-mapping

Feature/improve hookeserat mapping
# Conflicts:
#	examples/python3/cosserat/CosseratBase.py
#	src/Cosserat/forcefield/BeamHookeLawForceField.inl
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
- Add new mapping functionality in HookeSeratDiscretMapping
- Update corresponding unit tests
- Add slides documentation for liegroups
- Add getting started tutorial test
Small error in calculating the cross-section area.
Initially the area was A = M_PI * (r * r - rInner4); but rInner4 = rInner*rInner*rInner*rInner and not rInner*rInner
AppaSalif

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants