local acceleration

59 views
Skip to first unread message

Zamir Syed

unread,
May 21, 2019, 1:18:34 PM5/21/19
to ProjectChrono
Hello All,

I have a question about getting local accelerations from a ChBody in a simulation.

It is straightforward to get global position, velocity, and accelerations via the member methods GetPos(), GetPos()_dt, GetPos()_dtdt; however, I have some confusion when transforming them to a local coordinate system.

I am using the PointAccelerationParentToLocal() method which the documentation describes as:






---------------
PointAccelerationParentToLocal(     const ChVector< Real > &      parentpos,
                                                               const ChVector< Real > &      parentspeed,
                                                               const ChVector< Real > &      parentacc
                                                          )
"Given the position of a point in parent frame coords, and assuming it has an absolute speed parentspeed and absolute acceleration parentacc, return the acceleration in local coords."
--------------

I would like to ask about two things in this documentation:
1) Is parentpos the position of the point in the parent coordinate system?
2) Is the parentspeed and parentacc the speed and acceleration of the parent frame, or is it the speed and acceleration of the point in parent coordinates?

I have tried the following unsuccessful code:
 carposition = car_array[0]->chassis->GetPos();
 carspeed = car_array[0]->chassis->GetPos_dt();
 caraccel = car_array[0]->chassis->GetPos_dtdt();
 localaccel = car_array[0]->chassis->PointAccelerationParentToLocal (carposition, carspeed, caraccel); //gives me all zeros...




Any help would be appreciated here. Also, thank you to the developers of Project Chrono for a high quality simulation product.




-Zamir



Message has been deleted

Zamir Syed

unread,
May 21, 2019, 2:17:46 PM5/21/19
to ProjectChrono

UPDATE:

When I replace the parentspeed and parentacc parameters with ChVector<>(0,0,0), I get much more reasonable acceleration values, i.e.,

carposition = car_array[0]->chassis->GetPos();
carspeed = (0,0,0);
caraccel = (0,0,0);

localaccel = car_array[0]->chassis->PointAccelerationParentToLocal (carposition, carspeed, caraccel);

...but I don't understand why.

-Zamir

Radu Serban

unread,
May 26, 2019, 12:12:29 PM5/26/19
to projec...@googlegroups.com

Hi Zamir,

The functions you are attempting to use deal with the case where the point on body also has relative motion to the body frame; i.e. it is not fixed in the body frame.
In particular, when you do something like:
  auto acc = body->PointAccelerationParentToLocal(body->GetPos(), body->GetPos_dt(), body->GetPos_dtdt());
you should indeed get (0,0,0) indicating that the point you specified (in this case the body center of mass) has 0 acceleration *with respect to the body frame*.

By the way, I realize that these functions have somewhat confusing names and are not all that well documented -- we will have to work on fixing that.

If I understand correctly what you are after, all you need to do is take the body acceleration expressed in the global frame (as reported by ChBody::GetPos_dtdt) and express it in the body local frame.  You can do this using, for example:
  auto acc_local = body->TransformDirectionParentToLocal(my_body->GetPos_dtdt());
This will give you the acceleration of the body origin (its center of mass) expressed in the (centroidal) body frame.

If you want to find the acceleration of some point *fixed* in the body frame, you could use something like:
  auto acc_global = body->PointAccelerationLocalToParent(local_point);
  auto acc_local = body->TransformDirectionParentToLocal(acc_global);
The first line will give you the acceleration of the body-fixed point, expressed in the global frame; the second one will express that acceleration in the (centroidal) body frame.

--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 post to this group, send email to projec...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/f11e226d-1ade-4e9e-8fd2-217ea9a49d18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zamir Syed

unread,
May 28, 2019, 12:42:28 PM5/28/19
to ProjectChrono
Thank you, Radu, for the very clear explanation.

Zamir
Reply all
Reply to author
Forward
0 new messages