VRPN 06.04 |
The vrpn_Poser_Remote class specifies a position and orientation to which a motion platform should go. It is the inverse of a vrpn_Tracker_Remote (which tells where a tracked object has moved to). Servers that include tracked objects and can also set the positions of these objects will implement both the Tracker and Poser interfaces. User code will control the object's position using the Poser interface and listen for reports of new positions on the Tracker interface. Selections from the #include file//------------------------------------------------------------------------------------ // Client Code // Open a poser that is on the other end of a connection for sending updates to it. class vrpn_Poser_Remote: public vrpn_Poser { public: // The name of the poser to connect to, including connection name, // for example "poser@magnesium.cs.unc.edu". If you already // have the connection open, you can specify it as the second parameter. // This allows both servers and clients in the same thread, for example. // If it is not specified, then the connection will be looked up based // on the name passed in. vrpn_Poser_Remote (const char* name, vrpn_Connection* c = NULL); // unregister all of the handlers registered with the connection virtual ~vrpn_Poser_Remote (void); // This routine calls the mainloop of the connection it's on virtual void mainloop(); // Routines to set the state of the poser int request_pose(struct timeval t, vrpn_float64 position[3], vrpn_float64 quaternion[4]); int request_pose_velocity(struct timeval t, vrpn_float64 position[3], vrpn_float64 quaternion[4], vrpn_float64 interval); }; Using a vrpn_Poser_RemoteA vrpn_Poser_Remote object is used by passing the name of the poser you want to connect to as a parameter to the constructor and then calling its mainloop() message each time through the program's main loop. While active, the poser device is controlled by setting the position or velocity. The position is sent using request_pose(). The poser clips the request to its active region and then moves to this location. The velocity is sent using request_pose_velocity(). |