RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Poser_Tek4662.h
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
8class VRPN_API vrpn_Connection;
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
24class VRPN_API vrpn_Poser_Tek4662 : public vrpn_Poser, public vrpn_Tracker {
25public:
26 vrpn_Poser_Tek4662(const char* name, vrpn_Connection* c,
27 const char * port, int baud = 1200, int bits = 8,
28 vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE);
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
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Poser_Tek4662.h:24
virtual void mainloop()
定义 vrpn_Poser.h:18
定义 vrpn_Tracker.h:49
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...