vrpn
07.33
Virtual Reality Peripheral Network
|
Go to the documentation of this file.
12 #define M_PI 3.14159265358979323846
21 d_vel_scale_value(1.0),
23 d_rot_scale_value(1.0),
24 d_update_interval (update_rate ? (1/update_rate) : 1.0),
25 d_reportChanges (reportChanges)
34 for (i = 0; i < params->
num_axes; i++) {
67 fprintf(stderr,
"vrpn_Tracker_ButtonFly: "
95 fprintf(stderr,
"vrpn_Tracker_ButtonFly: "
114 for ( i =0; i< 4; i++)
115 for (
int j=0; j< 4; j++)
157 printf(
"vrpn_Tracker_ButtonFly: Adding local button %s\n",
163 printf(
"vrpn_Tracker_ButtonFly: Adding remote button %s\n",
167 if (full->
btn == NULL) {
168 fprintf(stderr,
"vrpn_Tracker_ButtonFly: "
169 "Can't open Button %s\n",full->
axis.
name);
185 if (full->
btn == NULL) {
return 0; }
208 double value_abs = fabs(value_scaled);
209 double value_powered;
212 if (value_offset >=0) {
234 double value_abs = fabs(value_scaled);
235 double value_powered;
238 if (value_offset >=0) {
267 if (info.
state == 1) {
268 double tx,ty,tz, rx,ry,rz;
269 q_matrix_type newMatrix;
281 q_euler_to_col_matrix(newMatrix, rz, ry, rx);
282 newMatrix[3][0] = tx; newMatrix[3][1] = ty; newMatrix[3][2] = tz;
311 printf(
"Get a new connection, reset virtual_Tracker\n");
374 fprintf(stderr,
"Tracker ButtonFly: cannot write message: tossing\n");
377 fprintf(stderr,
"Tracker ButtonFly: No valid connection\n");
405 (
double time_interval)
407 double tx,ty,tz, rx,ry,rz;
414 tx = ty = tz = rx = ry = rz = 0.0;
429 q_euler_to_col_matrix(diffM, rz, ry, rx);
430 diffM[3][0] = tx; diffM[3][1] = ty; diffM[3][2] = tz;
448 for (i=0; i< 3; i++) {
451 for (i=0; i< 4; i++) {
457 (
double elapsedInterval) {
int register_autodeleted_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER)
Registers a handler with the connection, and remembers to delete at destruction.
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
virtual int encode_to(char *buf)
double vrpn_TimevalDurationSeconds(struct timeval endT, struct timeval startT)
Return the number of seconds between startT and endT as a floating-point value.
vrpn_Tracker_ButtonFly * bf
const char * vrpn_got_first_connection
These are the strings that define the system-generated message types that tell when connections are r...
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
vrpn_Connection * d_connection
Connection that this object talks to.
virtual vrpn_int32 register_message_type(const char *name)
This structure is what is passed to a vrpn_Connection message callback.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
vrpn_float64 channel[vrpn_CHANNEL_MAX]
virtual int unregister_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
Generic connection class not specific to the transport mechanism.
#define vrpn_gettimeofday
virtual int register_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...