Gear/proportional mapping #4988
Replies: 3 comments 8 replies
-
|
Hi @Alex-srj Nice first steps : why have you started from the SquareMapping? A proportional mapping would be an Identity mapping just with a |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I am trying to simulate a scene containing 2 gears. My first thought was to create 2 nodes and use a mapping between their MechanicalObjects ($\theta_2 = \theta_1r_1/r_2 = \theta_1r$ , direction of rotation is not important at this stage). I looked through the available mappings and, correct me if i am wrong, the closest thing i found was IdentityMapping and SquareMapping. Since i am not completely sure on what functions i should and should not re-implement, i tried modifying the SquareMapping to create my own ProportionalMapping. The .h, .cpp, and .inl files are attached in ProportionalMapping.zip.
I added the files to the linear mapping folder of sofa, modified the CMakeLists.txt, recompiled the code, and tested it with the following scene:
Even though the DOFs of both nodes are coupled with the desired ratio$r$ , the result is incorrect. Mathematically speaking, the equations of motion of the disks are:
which gives:
I checked the output of MatrixAccessController to see the system matrix and the right hand side and got:
Any help would be appreciated. Thanks in advance !
Beta Was this translation helpful? Give feedback.
All reactions