vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Poser_Tek4662.h
Go to the documentation of this file.
1#ifndef vrpn_POSER_TEK4662_H
2#define vrpn_POSER_TEK4662_H
3#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API
4#include "vrpn_Poser.h" // for vrpn_Poser
5#include "vrpn_Serial.h" // for ::vrpn_SER_PARITY_NONE, etc
6#include "vrpn_Tracker.h" // for vrpn_Tracker
7
10
11// This code is for a Poser server that uses a Tektronix 4662 plotter in the
12// RS-232 mode. This is a 2D device.
13// This class also acts as a vrpn_Tracker so that it can report back the new positions
14// to the client. This lets the system operate in a closed-loop fashion.
15//
16// It assumes the following settings on the plotter: GIN terminator (none), no
17// DEL modification, device A, copy mode off, 1 stop bit, CR translation off,
18// low-speed plotting off, RS-232 interface enabled. It assumes that the plotter
19// is not in local mode and that the communications is through the Modem port.
20
21// If multiple requests for motion to a new location arrive while an ongoing
22// move is being made, all but the last are ignored.
23
25public:
26 vrpn_Poser_Tek4662(const char* name, vrpn_Connection* c,
27 const char * port, int baud = 1200, int bits = 8,
29
30 virtual ~vrpn_Poser_Tek4662();
31
32 virtual void mainloop();
33
34protected:
35 int d_serial_fd; //< File descriptor for the serial port we're using
36 unsigned char d_inbuf[1024]; //< Input buffer for characters from the plotter
37 int d_inbufcounter; //< How many characters have been read
38
39 float d_newx, d_newy; //< New location that we're supposed to go to
40 bool d_new_location_requested; //< Has a new location been requested since our last move?
41 int d_outstanding_requests; //< How many GIN requests are outstanding?
42
43 void reset(void);
44 void run();
45
46 static int VRPN_CALLBACK handle_change_message(void *userdata, vrpn_HANDLERPARAM p);
47 static int VRPN_CALLBACK handle_vel_change_message(void *userdata, vrpn_HANDLERPARAM p);
48};
49
50#endif
51
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
Generic connection class not specific to the transport mechanism.
This structure is what is passed to a vrpn_Connection message callback.
#define VRPN_API
#define VRPN_CALLBACK
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...
vrpn_SER_PARITY
Definition vrpn_Serial.h:15
@ vrpn_SER_PARITY_NONE
Definition vrpn_Serial.h:16