Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

P_VRPNFeedback.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: P_VRPNFeedback.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.28 $       $Date: 2019/01/17 21:21:01 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  * This is Paul's new Tracker code -- pgrayson@ks.uiuc.edu
00019  *
00020  * This is a Feedback object that sends forces over the net through VRPN.
00021  *
00022  ***************************************************************************/
00023 #ifndef P_VRPNFEEDBACK_H
00024 #define P_VRPNFEEDBACK_H 
00025 
00026 #if defined(VMDVRPN)
00027 
00028 #include "P_Feedback.h"
00029 #include "vrpn_ForceDevice.h"  // for definitions of vrpn_float32
00030 
00032 class VRPNFeedback : public Feedback {
00033  private:
00034   vrpn_ForceDevice_Remote *fdv;
00035   vrpn_float32 F[3], jac[3][3]; // a force starting at the origin
00036 
00037  protected:
00038   virtual int do_start(const SensorConfig *);
00039 
00040  public:
00041   VRPNFeedback();
00042   ~VRPNFeedback();
00043  
00044   virtual const char *device_name() const { return "vrpnfeedback"; }
00045   virtual Feedback *clone() { return new VRPNFeedback; }
00046 
00047   virtual void update();
00048   inline virtual int alive() { // VRPN doesn't let us *really* check this :(
00049     if(fdv) if(fdv->connectionAvailable()) return 1;
00050     return 0;
00051   }
00052   virtual void addconstraint(float k, const float *location);
00053   virtual void addplaneconstraint(float k, const float *point,
00054                                   const float *normal);
00055   virtual void addforcefield(const float *origin, const float *force,
00056                              const float *jacobian);
00057   inline virtual void zeroforce();
00058   inline virtual void forceoff();
00059   virtual void sendforce(const float *initial_pos);
00060 };
00061 
00062 #endif
00063 
00064 #endif

Generated on Fri Mar 29 02:45:59 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002