Linear and Angular Velocity and Acceleration

Post Reply
tklau
Posts: 3
Joined: Wed Mar 02, 2011 1:57 am

Linear and Angular Velocity and Acceleration

Post by tklau » Fri Aug 26, 2011 8:23 am

I'm wondering if TrackingTools estimates the linear and angular velocities and accelerations?

I found some protected variables related to velocities in the sample codes. But don't know how to access them.

I guess these variables are commonly used in many applications. It will save some hussle of building a filter if TT already have it.

Thanks!

NaturalPoint - Mike
Posts: 1896
Joined: Tue Feb 01, 2011 8:41 am
Location: Corvallis, OR

Re: Linear and Angular Velocity and Acceleration

Post by NaturalPoint - Mike » Fri Aug 26, 2011 3:05 pm

Which functions and variables are you referencing?

tklau
Posts: 3
Joined: Wed Mar 02, 2011 1:57 am

Re: Linear and Angular Velocity and Acceleration

Post by tklau » Fri Aug 26, 2011 6:53 pm

In "vrpn_Tracker.h",
// Description of the next report to go out
vrpn_int32 d_sensor; // Current sensor
vrpn_float64 pos[3], d_quat[4]; // Current pose, (x,y,z), (qx,qy,qz,qw)
vrpn_float64 vel[3], vel_quat[4]; // Cur velocity and dQuat/vel_quat_dt
vrpn_float64 vel_quat_dt; // delta time (in secs) for vel_quat
vrpn_float64 acc[3], acc_quat[4]; // Cur accel and d2Quat/acc_quat_dt2
Can user access these variables?

tklau
Posts: 3
Joined: Wed Mar 02, 2011 1:57 am

Re: Linear and Angular Velocity and Acceleration

Post by tklau » Fri Aug 26, 2011 11:18 pm

How can user access the linear and rotational velocity and acceleration of a rigid body using TT?

Using this callback handler?
// (un)Register a callback handler to handle an acceleration change
virtual int register_change_handler(void *userdata,
vrpn_TRACKERACCCHANGEHANDLER handler, vrpn_int32 sensor = vrpn_ALL_SENSORS);
virtual int unregister_change_handler(void *userdata,
vrpn_TRACKERACCCHANGEHANDLER handler, vrpn_int32 sensor = vrpn_ALL_SENSORS);
A piece of example would help a lot. Thanks!

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 519
Joined: Tue Jan 02, 2007 2:02 pm

Re: Linear and Angular Velocity and Acceleration

Post by beckdo » Mon Aug 29, 2011 1:43 pm

You wouldn't want to use the callback handler. You basically will call TT_Update() and then you can get the rigid body's position and orientation from TT_TrackableLocation.

We don't calculate the linear and rotational velocity/acceleration for you so you'll need to perform the calculation yourself currently. However, you have the position & orientation so all the standard formulas and approaches for calculating these will work.

Post Reply