24 memset(
d_quat, 0, 4 *
sizeof(
float));
50 vrpn_uint8 * bufptr = buffer + 6;
52 for (
int i = 0; i < 4; i++) {
53 d_quat[i] = (vrpn_unbuffer_from_little_endian<vrpn_uint16>(bufptr) - 32768) / 32768.0;
67 memset(
pos, 0,
sizeof(vrpn_float64) * 3);
72 fprintf(stderr,
"SpacePoint tracker: can't write message: tossing\n");
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
virtual bool reconnect()
Tries to reconnect to an acceptable device. Call this if you suspect a hotplug event has occurred...
Accepts any device with the given vendor and product IDs.
Generic connection class not specific to the transport mechanism.
const unsigned SPACEPOINT_VENDOR
struct timeval _timestamp
vrpn_Connection * d_connection
Connection that this object talks to.
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)
const unsigned SPACEPOINT_PRODUCT
virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback.
vrpn_Tracker_SpacePoint(const char *name, vrpn_Connection *trackercon)
#define vrpn_gettimeofday
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_int32 d_sender_id
Sender ID registered with the connection.
virtual bool connected() const
Returns true iff the last device I/O succeeded.