Hi Radu, It is worth adding that the reason why I did this is the rotation matrix I got by this method :
auto rotation = m_vehicle->GetVehicle().GetAxle(0)->GetWheel(VehicleSide::LEFT)->GetSpindle()->GetA(); which should be expressed in front left wheel's COG frame, but it seems not. This function works well when I use it by the same way for getting ChBody's rotation matrix in Chrono::Engine module. Chao 在2023年6月12日星期一 UTC+8 13:35:45<Chao Zhang> 写道: > Hi Radu, Glad to receive your reply! > I mean get the wheel motion state expressed in wheel COG frame instead of > global reference frame. It is worth mention that the wheel motion state I > got in chrono vehicle API is expressed in global reference frame. > > Here is my code snippets > ChFrameMoving<> wheel_abs; > ChVector<> pos = ChVector<>(-5.068122e-01, 7.653546e-01, 3.099935e-01); > // Wheel COG position > ChFrameMoving<> wheel_loc(pos, QUNIT); > // Wheel local frame > m_vehicle->GetVehicle().GetWheel(0, > VehicleSide::LEFT)->GetSpindle()->TransformLocalToParent(wheel_loc, > wheel_abs); // Transform the global frame into COG frame > auto rotation = wheel_abs.GetA(); > // Get the rotation matrix in COG > frame > > The code bellow is what I said failed in updating the wheel translation > and rotation in my demo code. > > Best wished, > Chao > 在2023年6月11日星期日 UTC+8 00:23:12<Radu Serban> 写道: > >> I am not quite sure what exactly you are trying to do. Transforms (called >> “frames” in Chrono) can be concatenated and so you can express whatever >> frame into another one. Do you want to express the wheel frame into the >> chassis COG frame? Something else? And when you say “it seems to have >> failed” what does that mean? >> >> >> >> --Radu >> >> >> >> >> >> *From:* [email protected] <[email protected]> *On >> Behalf Of *Chao Zhang >> *Sent:* Saturday, June 10, 2023 4:43 AM >> *To:* ProjectChrono <[email protected]> >> *Subject:* [chrono] Getting rotation matrix of wheel in COG frame in >> Chrono::Vehicle >> >> >> >> Hi developers, >> >> I'm using the latest version of Chrono. Now I want to get the motion data >> of vehicle subsystems by invoking function GetState() in ChWheel. >> Unfortunately, the motion data I got was expressed in global reference >> frame, and I have tried using TransformParentToLocal to transform the >> rotation quaternion into COG reference, it seems to have failed. >> >> Any advice will be appreciated! >> >> >> >> Chao >> >> -- >> 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/e4e14824-9ad7-430e-ace3-d447982c0487n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/projectchrono/e4e14824-9ad7-430e-ace3-d447982c0487n%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/490d46a0-c4f9-4565-ace7-958da5969756n%40googlegroups.com.
