Has been a success! Thank you very much!!!! 在2023年9月24日星期日 UTC+8 22:10:35<Radu Serban> 写道:
> I see. In that case, you should be able to use: > > env.vis.GetDevice().closeDevice() > > (this is Irrlicht-specific). > > > > Having said that, I just added a public function ChVisualSystem::Quit() > which does this for all available runtime visualization systems. With > this, you’ll simply do: > > env.vis.Quit() > > If you are building PyChrono from sources, pull the latest code and > rebuild. If you are using a conda package, it’ll take a while before new > packages are regenerated and uploaded to anaconda.org. > > > > --Radu > > > > *From:* [email protected] <[email protected]> *On > Behalf Of *Jay Sun > *Sent:* Sunday, September 24, 2023 3:11 PM > *To:* ProjectChrono <[email protected]> > *Subject:* Re: [chrono] Is there a function to end the render window? > > > > Thank you very much for your reply. I am using the building reinforcement > learning framework, the outer loop is for i_episode in range(sum_episode), > the inner loop is the while loop for every action of the agent (i.e. > while(vis.Run()), Using the break loop in the while inner loop does not > kill the render window, but clicking the keyboard "esc" or clicking the > cross in the upper right corner can kill the render window. I wonder if > there is a function that simulates keyboard typing "esc" to kill Windows, > or if there is a function that makes vis.Run() False. I record the screen ( > https://youtu.be/ZsANrfVMRqw), can focus on the task bar. The following > image is the code for my main function. > > 在2023年9月24日星期日 UTC+8 15:43:35<Radu Serban> 写道: > > Simply use a ‘break’ statement. See for example > https://github.com/projectchrono/chrono/blob/main/src/demos/python/vehicle/demo_VEH_SteeringController.py > > On a separate note, you can also interrupt the runtime visualization by > pressing the escape key. > > --Radu > > > > *From:* [email protected] <[email protected]> *On > Behalf Of *Jay Sun > *Sent:* Sunday, September 24, 2023 4:19 AM > *To:* ProjectChrono <[email protected]> > *Subject:* [chrono] Is there a function to end the render window? > > > > Hello everyone! > > > > I'm using pychrono now, I have met some problems. > > vis = veh. ChWheeledVehicleVisualSystemIrrlicht () is > established a visual environment. while rendering, the while vis.Run() : > loop is used. The condition for ending the loop is that when vis.Run() is > False, making vis.Run() False can only be done by manually clicking the > cross in the upper right corner of the rendering window (i.e., the close > button). Is there a function that turns off the current rendering in the > current program, or turns off the current button when a condition is > triggered? (Example: time = my_hmmwv.GetSystem().getchtime (). if time > 1, > end the render window.) > > Looking forward to your reply. Thanks very much!!!! > > > > Regard, > > Jay > > > > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/projectchrono/7a490c46-e882-4e6b-9614-aafceba3b8bdn%40googlegroups.com > > <https://groups.google.com/d/msgid/projectchrono/7a490c46-e882-4e6b-9614-aafceba3b8bdn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > 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 [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/projectchrono/cdc0d9ee-4ef6-46ba-8a14-13e626db1c0en%40googlegroups.com > > <https://groups.google.com/d/msgid/projectchrono/cdc0d9ee-4ef6-46ba-8a14-13e626db1c0en%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/2da6bf9e-d69b-4d3e-83db-714f46916f92n%40googlegroups.com.
