Thank you very much for your reply. I have tried according to your method. There are some effects. Here's what I did: I removed the middle hinge of the second module and the third module, and the third module, first deleting the corresponding fit of the hinge and the third module, and then deleting the hinge, the third module and the wheel. The state appears as shown in the video, the third module and hinge are not set the collision model, so there is no collision with the ground, and the wheel is set the collision model, so it is on the ground. But they were not removed from the system. Please tell me how to solve this problem. Thank you so much!! video link:https://youtu.be/GUf6DjZAYLE
Jay 在2024年1月15日星期一 UTC+8 20:03:06<[email protected]> 写道: > Hi, > the problem is that, by removing only the bodies, the links that are bound > to such bodies will have dangling pointers. For the time being you can > remove the relative links by doing something like: > > Before the simulation loop: > > > > > > > > *myfoot = mysystem.SearchBody('M-410iB-300 > -3/M-410iB-300-12-1')myfoot_linklist = []for link in > mysystem.Get_linklist(): if (chrono.CastToChLinkMateGeneric(link)): > mate_link = chrono.CastToChLinkMateGeneric(link) if > (mate_link.GetBody1() == myfoot or mate_link.GetBody2() == myfoot): > myfoot_linklist.append(mate_link)* > > *removed = False* > > and in the simulation loop > > > > > > > > > > > > *while(vis.Run()): vis.BeginScene() vis.Render() > mysystem.DoStepDynamics(0.001) vis.EndScene() if mysystem.GetChTime() > > 1 and not removed: mysystem.RemoveBody(myfoot) for link in > myfoot_linklist: mysystem.RemoveLink(link) removed = True* > > However, we may add an option to *ChSystem::RemoveBody* to optionally > take care also of attached links. > > BTW, we are going to update that spider_robot demo soon with the latest > API changes. > > > > Il giorno sabato 13 gennaio 2024 alle 09:13:51 UTC+1 [email protected] > ha scritto: > >> Hello everyone. >> >> I custom modeled a wheelbarrow in solidwork and installed a motor on each >> wheel. As shown in the picture below. Where A,B, and C are the parts of the >> wheel and body. 1️⃣ and 2️⃣ indicate universal joints. >> After the modeling is complete, simulate in the pychrono simulator. I >> want to delete 2️⃣ and C at some point in the car's motion. Using this >> method Chsystem. Removebody () (HTTP: / / >> https://api.projectchrono.org/classchrono_1_1_ch_system.html#a6bcfccb9a810168596f0a53e02a8 >> >> 7b58). When I used it, it seemed to delete the unexpected "body" except for >> 2️⃣ and C. And the simulation freezes. Am I using it in a wrong way? >> I use the official documentation spiders code examples ( >> https://api.projectchrono.org/tutorial_pychrono_demo_spider_robot.html). >> I found that this problem also occurred, I deleted "bbody", but only left >> bbody. Remove the arm part of spider, it will also get stuck. >> Am I using it in a wrong way? Please help me take a look, thank you very >> much!! >> (video link:https://youtu.be/ewbHQHve4AE) >> Regard, >> Jay[image: CleanShot 2024-01-13 at [email protected]] >> >> -- 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/803dc445-292b-4808-8fa8-42d907d437b5n%40googlegroups.com.
