Page 1 of 1

Linear and Angular Velocity and Acceleration

Posted: Fri Aug 26, 2011 8:23 am
by tklau
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!

Re: Linear and Angular Velocity and Acceleration

Posted: Fri Aug 26, 2011 3:05 pm
by NaturalPoint - Mike
Which functions and variables are you referencing?

Re: Linear and Angular Velocity and Acceleration

Posted: Fri Aug 26, 2011 6:53 pm
by tklau
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?

Re: Linear and Angular Velocity and Acceleration

Posted: Fri Aug 26, 2011 11:18 pm
by tklau
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!

Re: Linear and Angular Velocity and Acceleration

Posted: Mon Aug 29, 2011 1:43 pm
by beckdo
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.