fixed toi < 0.0 crash in AL-IPC#406
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical stability issue within the AL-IPC solver, specifically targeting a crash scenario where the time of impact ( Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a conditional check before calling advance_non_penetrate_positions, ensuring it's only executed when alpha exceeds a certain threshold. The review suggests replacing the magic number 1e-6 with a named constant, ideally m_global_active_set_manager->toi_threshold(), to enhance code readability, maintainability, and consistency.
| m_global_active_set_manager->post_ccd(); | ||
|
|
||
| m_global_active_set_manager->advance_non_penetrate_positions(alpha); | ||
| if(alpha > 1e-6) |
There was a problem hiding this comment.
Using a magic number like 1e-6 can make the code harder to understand and maintain. It's better to define it as a named constant to clarify its purpose. Consider using the existing configurable toi_threshold from GlobalActiveSetManager, as it seems to serve a similar purpose of defining a tolerance for the time of impact. This would improve consistency and make the threshold configurable without code changes.
if(alpha > m_global_active_set_manager->toi_threshold())
…und in AL-IPC Introduce `contact/al-ipc/alpha_lower_bound` (default 1e-6) to replace the hardcoded threshold guarding `advance_non_penetrate_positions`. Made-with: Cursor
No description provided.