vrpn
07.33
Virtual Reality Peripheral Network
|
This class will turn an analog device such as a joystick or a camera. More...
#include <vrpn_Tracker_AnalogFly.h>
Public Member Functions | |
vrpn_Tracker_AnalogFly (const char *name, vrpn_Connection *trackercon, vrpn_Tracker_AnalogFlyParam *params, float update_rate, bool absolute=vrpn_FALSE, bool reportChanges=VRPN_FALSE, bool worldFrame=VRPN_FALSE) | |
virtual | ~vrpn_Tracker_AnalogFly (void) |
virtual void | mainloop () |
Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop(). More... | |
virtual void | reset (void) |
Reset the current matrix to zero and store it into the tracker position/quaternion location. More... | |
void | update (q_matrix_type &) |
![]() | |
vrpn_Tracker (const char *name, vrpn_Connection *c=NULL, const char *tracker_cfg_file_name=NULL) | |
virtual | ~vrpn_Tracker (void) |
int | read_config_file (FILE *config_file, const char *tracker_name) |
void | print_latest_report (void) |
int | register_server_handlers (void) |
void | get_local_t2r (vrpn_float64 *vec, vrpn_float64 *quat) |
void | get_local_u2s (vrpn_int32 sensor, vrpn_float64 *vec, vrpn_float64 *quat) |
![]() | |
vrpn_BaseClass (const char *name, vrpn_Connection *c=NULL) | |
Names the device and assigns or opens connection, calls registration methods. More... | |
virtual | ~vrpn_BaseClass () |
![]() | |
vrpn_BaseClassUnique () | |
virtual | ~vrpn_BaseClassUnique () |
Unregister all of the message handlers that were to be autodeleted. More... | |
vrpn_Connection * | connectionPtr () |
Returns a pointer to the connection this object is using. More... | |
Static Public Member Functions | |
static void VRPN_CALLBACK | handle_joystick (void *, const vrpn_ANALOGCB) |
static int VRPN_CALLBACK | handle_newConnection (void *, vrpn_HANDLERPARAM) |
![]() | |
static int VRPN_CALLBACK | handle_t2r_request (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_u2s_request (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_workspace_request (void *userdata, vrpn_HANDLERPARAM p) |
Protected Member Functions | |
void | update_matrix_based_on_values (double time_interval) |
void | convert_matrix_to_tracker (void) |
bool | shouldReport (double elapsedInterval) const |
int | setup_channel (vrpn_TAF_fullaxis *full) |
int | teardown_channel (vrpn_TAF_fullaxis *full) |
![]() | |
bool | ensure_enough_unit2sensors (unsigned num) |
virtual int | register_types (void) |
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail. More... | |
virtual int | encode_to (char *buf) |
virtual int | encode_vel_to (char *buf) |
virtual int | encode_acc_to (char *buf) |
virtual int | encode_tracker2room_to (char *buf) |
Encodes the "Tracker to Room" transformation into the buffer specified. More... | |
virtual int | encode_unit2sensor_to (char *buf) |
Encodes the "Unit to Sensor" transformation into the buffer specified. More... | |
virtual int | encode_workspace_to (char *buf) |
![]() | |
virtual int | init (void) |
Initialize things that the constructor can't. Returns 0 on success, -1 on failure. More... | |
virtual int | register_senders (void) |
Register the sender for this device (by default, the name of the device). Return 0 on success, -1 on fail. More... | |
![]() | |
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. More... | |
int | send_text_message (const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0) |
Sends a NULL-terminated text message from the device d_sender_id. More... | |
SendTextMessageBoundCall | send_text_message (vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL) |
Returns an object you can stream into to send a text message from the device like send_text_message(vrpn_TEXT_WARNING) << "Value of i is: " << i; This use requires including vrpn_SendTextMessageStreamProxy.h. More... | |
void | server_mainloop (void) |
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should be called by all servers in their mainloop() More... | |
void | client_mainloop (void) |
Handles functions that all clients should provide in their mainloop() (warning of no server, for example) Should be called by all clients in their mainloop() More... | |
Static Protected Member Functions | |
static void VRPN_CALLBACK | handle_analog_update (void *userdata, const vrpn_ANALOGCB info) |
static void VRPN_CALLBACK | handle_reset_press (void *userdata, const vrpn_BUTTONCB info) |
static void VRPN_CALLBACK | handle_clutch_press (void *userdata, const vrpn_BUTTONCB info) |
![]() | |
static int | encode_text_message_to_buffer (char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg) |
Encodes the body of the text message into a buffer, preparing for sending. More... | |
static int | decode_text_message_from_buffer (char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, const char *buf) |
Decodes the body of the text message from a buffer from the connection. More... | |
Additional Inherited Members | |
![]() | |
bool | shutup |
vrpn_MESSAGEHANDLER | handler |
vrpn_int32 | sender |
vrpn_int32 | type |
void * | userdata |
This class will turn an analog device such as a joystick or a camera.
Definition at line 105 of file vrpn_Tracker_AnalogFly.h.
vrpn_Tracker_AnalogFly::vrpn_Tracker_AnalogFly | ( | const char * | name, |
vrpn_Connection * | trackercon, | ||
vrpn_Tracker_AnalogFlyParam * | params, | ||
float | update_rate, | ||
bool | absolute = vrpn_FALSE , |
||
bool | reportChanges = VRPN_FALSE , |
||
bool | worldFrame = VRPN_FALSE |
||
) |
Definition at line 14 of file vrpn_Tracker_AnalogFly.C.
References vrpn_Tracker_AnalogFlyParam::clutch_name, vrpn_Tracker_AnalogFlyParam::reset_name, vrpn_Tracker_AnalogFlyParam::sx, vrpn_Tracker_AnalogFlyParam::sy, vrpn_Tracker_AnalogFlyParam::sz, vrpn_Tracker::timestamp, vrpn_gettimeofday, vrpn_got_first_connection, vrpn_Tracker_AnalogFlyParam::x, vrpn_Tracker_AnalogFlyParam::y, and vrpn_Tracker_AnalogFlyParam::z.
|
virtual |
Definition at line 156 of file vrpn_Tracker_AnalogFly.C.
References d_clutch_button, d_reset_button, d_sx, d_sy, d_sz, d_x, d_y, d_z, handle_clutch_press(), handle_reset_press(), teardown_channel(), and vrpn_Button_Remote::unregister_change_handler().
|
protected |
Definition at line 501 of file vrpn_Tracker_AnalogFly.C.
References d_currentMatrix, vrpn_Tracker::d_quat, and vrpn_Tracker::pos.
Referenced by reset().
|
staticprotected |
Definition at line 187 of file vrpn_Tracker_AnalogFly.C.
References vrpn_TAF_fullaxis::af, vrpn_TAF_fullaxis::axis, vrpn_TAF_axis::channel, vrpn_ANALOGCB::channel, d_absolute, vrpn_ANALOGCB::msg_time, vrpn_TAF_axis::offset, vrpn_TAF_axis::power, vrpn_TAF_axis::scale, and vrpn_TAF_fullaxis::value.
Referenced by setup_channel(), and teardown_channel().
|
staticprotected |
Definition at line 232 of file vrpn_Tracker_AnalogFly.C.
References vrpn_BUTTONCB::button, d_clutch_engaged, d_clutch_which, and vrpn_BUTTONCB::state.
Referenced by ~vrpn_Tracker_AnalogFly().
|
static |
|
static |
Definition at line 304 of file vrpn_Tracker_AnalogFly.C.
References vrpn_BaseClassUnique::userdata.
|
staticprotected |
Definition at line 218 of file vrpn_Tracker_AnalogFly.C.
References vrpn_BUTTONCB::button, d_which_button, reset(), and vrpn_BUTTONCB::state.
Referenced by ~vrpn_Tracker_AnalogFly().
|
virtual |
Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop().
Implements vrpn_BaseClass.
Definition at line 337 of file vrpn_Tracker_AnalogFly.C.
References vrpn_TAF_fullaxis::ana, d_absolute, d_clutch_button, vrpn_BaseClassUnique::d_connection, d_prevtime, d_reset_button, vrpn_BaseClassUnique::d_sender_id, d_sx, d_sy, d_sz, d_update_interval, d_x, d_y, d_z, vrpn_Tracker::encode_to(), vrpn_Analog_Remote::mainloop(), vrpn_Button_Remote::mainloop(), vrpn_Connection::pack_message(), vrpn_Tracker::position_m_id, vrpn_BaseClassUnique::server_mainloop(), shouldReport(), vrpn_Tracker::timestamp, update_matrix_based_on_values(), vrpn_CONNECTION_LOW_LATENCY, vrpn_gettimeofday, and vrpn_TimevalDurationSeconds().
|
virtual |
Reset the current matrix to zero and store it into the tracker position/quaternion location.
This is is not done for an absolute tracker, whose position and orientation are locked to the reports from the analog device.
Definition at line 323 of file vrpn_Tracker_AnalogFly.C.
References convert_matrix_to_tracker(), d_clutchMatrix, d_currentMatrix, d_initMatrix, d_prevtime, and vrpn_gettimeofday.
Referenced by handle_reset_press().
|
protected |
Definition at line 251 of file vrpn_Tracker_AnalogFly.C.
References vrpn_TAF_fullaxis::ana, vrpn_TAF_fullaxis::axis, vrpn_BaseClassUnique::d_connection, handle_analog_update(), vrpn_TAF_axis::name, and vrpn_Analog_Remote::register_change_handler().
|
protected |
Definition at line 517 of file vrpn_Tracker_AnalogFly.C.
Referenced by mainloop().
|
protected |
Definition at line 286 of file vrpn_Tracker_AnalogFly.C.
References vrpn_TAF_fullaxis::ana, handle_analog_update(), and vrpn_Analog_Remote::unregister_change_handler().
Referenced by ~vrpn_Tracker_AnalogFly().
void vrpn_Tracker_AnalogFly::update | ( | q_matrix_type & | ) |
|
protected |
|
protected |
Definition at line 126 of file vrpn_Tracker_AnalogFly.h.
Referenced by handle_analog_update(), and mainloop().
|
protected |
Definition at line 134 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 136 of file vrpn_Tracker_AnalogFly.h.
Referenced by handle_clutch_press().
|
protected |
Definition at line 137 of file vrpn_Tracker_AnalogFly.h.
|
protected |
Definition at line 135 of file vrpn_Tracker_AnalogFly.h.
Referenced by handle_clutch_press().
|
protected |
Definition at line 139 of file vrpn_Tracker_AnalogFly.h.
Referenced by reset().
|
protected |
Definition at line 139 of file vrpn_Tracker_AnalogFly.h.
Referenced by convert_matrix_to_tracker(), and reset().
|
protected |
Definition at line 139 of file vrpn_Tracker_AnalogFly.h.
Referenced by reset().
|
protected |
Definition at line 125 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and reset().
|
protected |
Definition at line 127 of file vrpn_Tracker_AnalogFly.h.
|
protected |
Definition at line 131 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 124 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop().
|
protected |
Definition at line 132 of file vrpn_Tracker_AnalogFly.h.
Referenced by handle_reset_press().
|
protected |
Definition at line 128 of file vrpn_Tracker_AnalogFly.h.
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().
|
protected |
Definition at line 130 of file vrpn_Tracker_AnalogFly.h.
Referenced by mainloop(), and ~vrpn_Tracker_AnalogFly().