Stop and start vehicle simulation by specified signal

36 views
Skip to first unread message

stefan

unread,
Oct 28, 2022, 2:36:29 AM10/28/22
to ProjectChrono
Hello everyone, 

Vehicle simulation in Chrono can be described as a game. A game can stop by specified signal,  is there some kind of API that can realize the function in Chrono


Marcel Offermans

unread,
Oct 28, 2022, 4:15:04 AM10/28/22
to projec...@googlegroups.com

Hello Stefan,

What exactly do you mean by "stop"?

In Chrono (and in most games) there is this thing called the game loop, which keeps performing (in this case) fixed time steps and does all the calculations for such a step (hopefully) within that time slot, then pauses until the next step.

The most obvious answer would be to just stop doing steps and you can easily do that in your code.

Greetings, Marcel


On 10/28/2022 8:36, stefan wrote:
Hello everyone, 

Vehicle simulation in Chrono can be described as a game. A game can stop by specified signal,  is there some kind of API that can realize the function in Chrono


--
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/1500e48e-1d67-4c58-97a1-735ea2750cf2n%40googlegroups.com.

Radu Serban

unread,
Oct 28, 2022, 4:21:45 AM10/28/22
to ProjectChrono

Stefan,

 

First of all, Chrono::Vehicle simulations are not “games”.  What this library provides is a mechanism to model and simulate vehicles at a certain level of fidelity (arguably more than many game physics engines). What you choose to do with Chrono::Vehicle is a different story; yes, you could build a game-like simulation around it.  All Chrono modules provide middleware libraries.  Functionality like the one you describe belongs in user code, not in the libraries.

 

--Radu

--

stefan

unread,
Oct 28, 2022, 7:04:49 AM10/28/22
to ProjectChrono
Hi Radu

I am very sorry for my inappropriate description and I just try to make my question easier to be understood. 
To be precise, I want to implement the debugging function during the access process of the control algorithm, so I hope the program can be paused according to my demand. 
By the way, I am doing some research in the tire model in chrono, and I found there may be a mistake in Chpac02Tire.cpp in line 616. The rhx1 should be replaced by rhy1.

Stefan

Radu Serban

unread,
Oct 28, 2022, 7:28:22 AM10/28/22
to ProjectChrono

Hi Stefan,

 

No need to apologize.  I don’t have anything against games per-se (in fact, a long time ago I worked for a gaming company).  I just wanted to clarify that Chrono & Chrono::Vehicle only provide the physics for whatever you want to model and simulate.  Everything else is the user/caller code building on top of it. 

 

As such, for what you are after, you should implement a mechanism for receiving (from user input or programmatically) a pause/run flag and then simply modify your simulation loop so that the state of the Chrono system is advanced only when that flag is set to “run”.  You may want to keep always make the rendering calls.  

 

If you use the Irrlicht run-time visualization system, there is a callback mechanism that allows you to add your own event receiver (for keyboard and mouse) which you can use for this purpose; see for example demo_MBS_suspension or demo_MBS_forklift which use such a custom event receiver.

 

Hope that this helps,
--Radu

 

P.S. Thank you for pointing out the potential issue in the Pac02 tire model! We’ll look at it and fix if needed.

Reply all
Reply to author
Forward
0 new messages