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

P_Feedback.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_Feedback.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.29 $       $Date: 2020/02/24 17:48:30 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  * This is Paul's new Tracker code -- pgrayson@ks.uiuc.edu
00019  *
00020  * A Feedback is a representation for force-feedback.  Subclass this for
00021  * specific haptic devices.
00022  *
00023  * Note that you have to call sendforce to actually do anything!
00024  *
00025  ***************************************************************************/
00026 
00027 #ifndef P_FEEDBACK_H
00028 #define P_FEEDBACK_H
00029 
00030 #include "P_SensorConfig.h"
00031 
00063 
00064 
00065 class Feedback {
00066 public:
00068   Feedback() { maxforce = -1.0f; }
00069   virtual ~Feedback() { };
00070 
00072   virtual const char *device_name() const = 0;
00073   virtual Feedback *clone() = 0;
00074 
00077   int start(const SensorConfig *config) {
00078     set_maxforce(config->getmaxforce());
00079     return do_start(config);
00080   }
00081 
00082   virtual void update() = 0;
00083 
00088   virtual void addconstraint(float k, const float *location) = 0;
00089   virtual void addforcefield(const float *origin, const float *force,
00090                              const float *jacobian) = 0;
00091   virtual void addplaneconstraint(float k, const float *point,
00092                                   const float *normal) = 0;
00093 
00096   virtual void zeroforce() = 0;
00097 
00099   virtual void forceoff() = 0;
00100 
00106   virtual void sendforce(const float *initial_pos) = 0;
00107 
00111   void set_maxforce(float m) { maxforce = m;    }
00112   float get_maxforce() const { return maxforce; }
00113 
00114 protected:
00115   float maxforce;
00116 
00118   virtual int do_start(const SensorConfig *) { return 1; }
00119 };
00120 
00121 #endif
00122 

Generated on Fri Oct 4 02:44:46 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002