Getting rotation matrix of wheel in COG frame in Chrono::Vehicle

72 views
Skip to first unread message

Chao Zhang

unread,
Jun 9, 2023, 10:43:10 PM6/9/23
to ProjectChrono
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

Radu Serban

unread,
Jun 10, 2023, 12:23:12 PM6/10/23
to ProjectChrono

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

--
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/e4e14824-9ad7-430e-ace3-d447982c0487n%40googlegroups.com.

Chao Zhang

unread,
Jun 12, 2023, 1:35:45 AM6/12/23
to ProjectChrono
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

Chao Zhang

unread,
Jun 12, 2023, 10:07:05 PM6/12/23
to ProjectChrono
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
Reply all
Reply to author
Forward
0 new messages