orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
teleop/events.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef EVENTS_H 00012 #define EVENTS_H 00013 00014 #include <hydroiceutil/eventqueue.h> 00015 00016 namespace teleop 00017 { 00018 00019 enum EventType 00020 { 00021 // user & network 00022 SentVelocityCommand=0, 00023 SentBicycleCommand, 00024 SentRepeatCommand, 00025 FailedToSendCommand, 00026 // network 00027 MixedCommand, 00028 IncrementCommand, 00029 RelativeCommand 00030 }; 00031 00032 class SentVelocityCommandEvent : public hydroiceutil::Event 00033 { 00034 public: 00035 SentVelocityCommandEvent( double vx, double vy, double w, bool vxLimit, bool vyLimit, bool wLimit ) : 00036 Event( SentVelocityCommand ), 00037 vx_(vx), 00038 vy_(vy), 00039 w_(w), 00040 vxLimit_(vxLimit), 00041 vyLimit_(vyLimit), 00042 wLimit_(wLimit) {}; 00043 00044 double vx_; 00045 double vy_; 00046 double w_; 00047 bool vxLimit_; 00048 bool vyLimit_; 00049 bool wLimit_; 00050 }; 00051 typedef IceUtil::Handle<SentVelocityCommandEvent> SentVelocityCommandEventPtr; 00052 00053 class SentBicycleCommandEvent : public hydroiceutil::Event 00054 { 00055 public: 00056 SentBicycleCommandEvent( double speed, double steerAngle, bool speedLimit, bool steerAngleLimit ) : 00057 Event( SentBicycleCommand ), 00058 speed_(speed), 00059 steerAngle_(steerAngle), 00060 speedLimit_(speedLimit), 00061 steerAngleLimit_(steerAngleLimit) {}; 00062 00063 double speed_; 00064 double steerAngle_; 00065 bool speedLimit_; 00066 bool steerAngleLimit_; 00067 }; 00068 typedef IceUtil::Handle<SentBicycleCommandEvent> SentBicycleCommandEventPtr; 00069 00070 class SentRepeatCommandEvent : public hydroiceutil::Event 00071 { 00072 public: 00073 SentRepeatCommandEvent() : 00074 Event( SentRepeatCommand ) {}; 00075 }; 00076 00077 class FailedToSendCommandEvent : public hydroiceutil::Event 00078 { 00079 public: 00080 FailedToSendCommandEvent() : 00081 Event( FailedToSendCommand ) {}; 00082 }; 00083 00084 class MixedCommandEvent : public hydroiceutil::Event 00085 { 00086 public: 00087 MixedCommandEvent( double lon, bool isLong, double tr, bool isTr, double ang, bool isAng ) : 00088 Event( MixedCommand ), 00089 longitudinal(lon), 00090 isLongIncrement(isLong), 00091 transverse(tr), 00092 isTransverseIncrement(isTr), 00093 angular(ang), 00094 isAngularIncrement(isAng) {}; 00095 00096 double longitudinal; 00097 bool isLongIncrement; 00098 double transverse; 00099 bool isTransverseIncrement; 00100 double angular; 00101 bool isAngularIncrement; 00102 }; 00103 typedef IceUtil::Handle<MixedCommandEvent> MixedCommandEventPtr; 00104 00105 class IncrementCommandEvent : public hydroiceutil::Event 00106 { 00107 public: 00108 IncrementCommandEvent( int lon, int tr, int ang ) : 00109 Event( IncrementCommand ), 00110 longitudinal(lon), 00111 transverse(tr), 00112 angular(ang) {}; 00113 00114 int longitudinal; 00115 int transverse; 00116 int angular; 00117 }; 00118 typedef IceUtil::Handle<IncrementCommandEvent> IncrementCommandEventPtr; 00119 00120 class RelativeCommandEvent : public hydroiceutil::Event 00121 { 00122 public: 00123 RelativeCommandEvent( double lon, double tr, double ang ) : 00124 Event( RelativeCommand ), 00125 longitudinal(lon), 00126 transverse(tr), 00127 angular(ang) {}; 00128 00129 double longitudinal; 00130 double transverse; 00131 double angular; 00132 }; 00133 typedef IceUtil::Handle<RelativeCommandEvent> RelativeCommandEventPtr; 00134 00135 00136 class TeleopEventQueueOptimizer : public hydroiceutil::EventQueueOptimizer 00137 { 00138 public: 00139 // this combine function adds the member variables of the two events 00140 virtual bool combine( hydroiceutil::EventPtr& existing, const hydroiceutil::EventPtr& extra ); 00141 }; 00142 00143 } // namespace 00144 00145 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)