Hi, Actually, I have figured out something, but I have another question. I just inversed the master and slave of the motor joint, and it works! It makes sense to me because originally, the slave was a fixed object, and the system could not pull it back if it was a little out of track. But another question was raised: why does the code using ChBody and adding a box work???
Thanks, On Tuesday, March 19, 2024 at 3:55:20 PM UTC-4 Yaqing Wang wrote: > Hi, > > I am still having the problem that the "ChLinkMotorLinearPosition" fails > to serve as a prismatic link after some time. Note, this is a follow-up for > the page: hnxzOQ-u6Jc. > > So, I adapted a code from a previous successful one. It wants a "rod" to > be pushed by a motor linked to a fixed "LA". Both of them are collision > disabled. And the successful one says: > > ChVector<> rodsize(roda, rodb, rodc); > auto boxrod = std::make_shared<ChBoxShape>(); > boxrod->GetBoxGeometry().Size = rodsize; > auto rod = std::make_shared<ChBody>(collision_type); > rod->AddAsset(boxrod); > > I think I can replace this with: > > auto rod = std::make_shared<ChBodyEasyBox>(roda, rodb, rodc, 100, > material, collision_type); > > And the rod did not adhere to the LA and dropped. > I cannot tell where the difference comes from. I can see that this will > cause a position shift, but I think that should be fine, and compensating > it does not give a good result. > > The time steps I used were either 1e-5 or 1e-4, and both gave the same > result. I think 1e-5 is reasonably OK, and a smaller time step will make my > work really difficult. > > I am using Chrono v7, and please don't ask me to change to the newest one; > the newest one still has this problem. > Here is my code: > https://www.dropbox.com/scl/fi/xkr8y3r2v3cmqpyqslbtp/v2_fix_rot_sweep.zip?rlkey=04glqbshzq7yeszy6on659smj&dl=0 > . > > Would somebody help me again, please? :) > > Thanks, > > > -- 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/abf5962d-ad27-4543-a960-6671763a333cn%40googlegroups.com.
