Fix cross-section area calculation in HookeSeratPCSForceFieldRigid#170
Open
AppaSalif wants to merge 145 commits intoSofaDefrost:masterfrom
Open
Fix cross-section area calculation in HookeSeratPCSForceFieldRigid#170AppaSalif wants to merge 145 commits intoSofaDefrost:masterfrom
AppaSalif wants to merge 145 commits intoSofaDefrost:masterfrom
Conversation
Resolve remaining bugs related to SoftRobot plugin compilation issues…
….Cosserat into update_python_prefabs
…ify object creation
Simplify BeamGeometryParameters by removing unnecessary attributes and defaults.
Refactor: Move rigid node creation to `utils.py` and simplify `CosseratBase`.
…eters and Cosserat prefab
Refactor: Move rigid node creation to `utils.py` and simplify `CosseratBase`.
…eters and Cosserat prefab
Cleanning the prefab class and update the test scene regarding
…te_python_prefabs
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.
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small error in calculating the cross-section area.
Initially the area was A = M_PI * (r * r - rInner4); but rInner4 = rInnerrInnerrInnerrInner and not rInnerrInner