58 const char *tracker_cfg_file_name = NULL);
62 int read_config_file(FILE *config_file,
const char *tracker_name);
63 void print_latest_report(
void);
66 int register_server_handlers(
void);
67 void get_local_t2r(vrpn_float64 *vec, vrpn_float64 *quat);
68 void get_local_u2s(vrpn_int32 sensor, vrpn_float64 *vec,
95 vrpn_float64 pos[3], d_quat[4];
96 vrpn_float64 vel[3], vel_quat[4];
98 vrpn_float64 acc[3], acc_quat[4];
99 vrpn_float64 acc_quat_dt;
100 struct timeval timestamp;
101 vrpn_int32 frame_count;
111 struct timeval watchdog_timestamp;
113 vrpn_float64 tracker2room[3], tracker2room_quat[4];
121 bool ensure_enough_unit2sensors(
unsigned num);
127 vrpn_float64 workspace_min[3], workspace_max[3];
132 virtual int encode_to(
char *buf);
134 virtual int encode_vel_to(
char *buf);
135 virtual int encode_acc_to(
char *buf);
136 virtual int encode_tracker2room_to(
char *buf);
137 virtual int encode_unit2sensor_to(
char *buf);
138 virtual int encode_workspace_to(
char *buf);
141 #ifndef VRPN_CLIENT_ONLY
142 #define VRPN_TRACKER_BUF_SIZE 100
147 const char *port =
"/dev/ttyS1",
long baud = 38400);
164 virtual void send_report(
void);
176 #if defined(VRPN_USE_LIBUSB_1_0)
177 struct libusb_device_handle;
178 struct libusb_context;
179 #define VRPN_TRACKER_USB_BUF_SIZE 1000
184 vrpn_uint16 product,
long baud = 115200);
203 virtual void send_report(
void);
217 #endif // VRPN_CLIENT_ONLY
228 vrpn_int32 sensors = 1, vrpn_float64 Hz = 1.0);
254 vrpn_int32 sensors = 1);
261 virtual int report_pose(
262 const int sensor,
const struct timeval t,
263 const vrpn_float64 position[3],
const vrpn_float64 quaternion[4],
265 virtual int report_pose_velocity(
266 const int sensor,
const struct timeval t,
267 const vrpn_float64 position[3],
const vrpn_float64 quaternion[4],
268 const vrpn_float64 interval,
270 virtual int report_pose_acceleration(
271 const int sensor,
const struct timeval t,
272 const vrpn_float64 position[3],
const vrpn_float64 quaternion[4],
273 const vrpn_float64 interval,
284 typedef struct _vrpn_TRACKERCB {
285 struct timeval msg_time;
288 vrpn_float64 quat[4];
297 typedef struct _vrpn_TRACKERVELCB {
298 struct timeval msg_time;
301 vrpn_float64 vel_quat[4];
311 typedef struct _vrpn_TRACKERACCCB {
312 struct timeval msg_time;
315 vrpn_float64 acc_quat[4];
316 vrpn_float64 acc_quat_dt;
326 typedef struct _vrpn_TRACKERTRACKER2ROOMCB {
327 struct timeval msg_time;
328 vrpn_float64 tracker2room[3];
329 vrpn_float64 tracker2room_quat[4];
334 typedef struct _vrpn_TRACKERUNIT2SENSORCB {
335 struct timeval msg_time;
337 vrpn_float64 unit2sensor[3];
338 vrpn_float64 unit2sensor_quat[4];
343 typedef struct _vrpn_TRACKERWORKSPACECB {
344 struct timeval msg_time;
345 vrpn_float64 workspace_min[3];
346 vrpn_float64 workspace_max[3];
388 int request_t2r_xform(
void);
390 int request_u2s_xform(
void);
392 int request_workspace(
void);
395 int set_update_rate(vrpn_float64 samplesPerSecond);
399 int reset_origin(
void);
408 virtual int register_change_handler(
void *userdata,
411 virtual int unregister_change_handler(
void *userdata,
416 virtual int register_change_handler(
void *userdata,
419 virtual int unregister_change_handler(
void *userdata,
424 virtual int register_change_handler(
void *userdata,
427 virtual int unregister_change_handler(
void *userdata,
433 register_change_handler(
void *userdata,
437 unregister_change_handler(
void *userdata,
447 return d_workspacechange_list.register_handler(userdata, handler);
453 return d_workspacechange_list.unregister_handler(userdata, handler);
461 return d_tracker2roomchange_list.register_handler(userdata, handler);
467 return d_tracker2roomchange_list.unregister_handler(userdata, handler);
475 bool ensure_enough_sensor_callbacks(
unsigned num);