ChFunction_Const use

29 views
Skip to first unread message

David Vieira

unread,
Nov 22, 2021, 5:43:19 AM11/22/21
to ProjectChrono
Hello everyone,

I try to use the demo_VEH_TireTestRig example and setting the SlipAngle with the function constant. However I would use negative values but the application crash. 7
I looked for the definition and the variable expected is a double, so I don't understand why I cannot use negative values.

Thank you in adavance !

David

Radu Serban

unread,
Nov 22, 2021, 8:06:31 AM11/22/21
to vieira...@gmail.com, ProjectChrono

David,

 

I cannot reproduce this issue.

Could you please provide

  • Version of Chrono you are using
  • OS and compiler
  • Exact error and crash information
  • Code snippet on how you are trying to set and initialize the rig (including how you set the slip angle function)?

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/9b9ef155-92ad-4cc0-b86b-1ad372c74eb4n%40googlegroups.com.

David Vieira

unread,
Nov 22, 2021, 10:14:39 AM11/22/21
to ProjectChrono
Hello Radu,

I modified the code to take the HMMWV wheel with a SMC contact soil method.
Indeed, I create the HMMWV vehicle to take the wheel and then the spindle.
So, I modified the ChTireTestRig class and main as follows :

After creating the vehicle I extract :
auto wheel = my_hmmwv.GetVehicle().GetAxle(0)->m_wheels[0];
auto tire = wheel->GetTire();

In the ChTireTestRig class I use:
m_spindle_body = m_wheel->GetSpindle();


Then the follow scenario is used :
rig.SetLongSpeedFunction(chrono_types::make_shared<ChFunction_Const>(1)); rig.SetAngSpeedFunction(chrono_types::make_shared<ChFunction_Ramp>(0, 0.1)); rig.SetSlipAngleFunction(chrono_types::make_shared<ChFunction_Const>(10 * CH_C_DEG_TO_RAD)); 
rig.Initialize();

Unfortunatly when the value is negative the running application starts but closes instantaniously without any error report.

The used Chrono version is 6.00 running on windows 11 under Visual Studio.

Thank you in advance !

David Vieira

unread,
Nov 22, 2021, 10:49:37 AM11/22/21
to ProjectChrono
Hello Radu,

I solved the problem. I  added a break condition in the main scope and in this situation (negative values)
the condition was satisfied causing the crash.

Thank you for your time.

Best reagards,

Radu Serban

unread,
Nov 22, 2021, 12:31:10 PM11/22/21
to vieira...@gmail.com, ProjectChrono

David,

 

Glad to hear you resolved the issue, but I’m not exactly sure I understand what/where the problem was.  What “condition was satisfied” causing the crash?

 

On a different note, you should be able to use whatever tire you want with the test rig without having to modify the ChTireTestRig class!  Unless I’m missing something, you can do what you want by simply modifying the demo code (or, better yet, writing your own).

Reply all
Reply to author
Forward
0 new messages