Changeset 432 in flair-src for trunk/lib/FlairMeta/src/MetaVrpnObject.cpp
- Timestamp:
- Jul 12, 2021, 11:19:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/MetaVrpnObject.cpp
r420 r432 27 27 #include <TabWidget.h> 28 28 #include <Matrix.h> 29 #include <AltitudeSensor.h> 29 30 30 31 using std::string; … … 33 34 using namespace flair::sensor; 34 35 using namespace flair::filter; 36 37 namespace flair { 38 namespace sensor { 39 class MetaVrpnObjectAltitudeSensor : public AltitudeSensor { 40 public: 41 MetaVrpnObjectAltitudeSensor(meta::MetaVrpnObject* parent,std::string name): AltitudeSensor(parent,name) { 42 this->parent=parent; 43 } 44 ~MetaVrpnObjectAltitudeSensor() { 45 } 46 47 //z and dz must be in uav's frame 48 float z(void) const { 49 Vector3Df uav_pos; 50 parent->GetPosition(uav_pos); 51 return -uav_pos.z; 52 } 53 float Vz(void) const { 54 Vector3Df uav_vel; 55 parent->GetSpeed(uav_vel); 56 return -uav_vel.z; 57 } 58 59 private: 60 meta::MetaVrpnObject* parent; 61 62 }; 63 }// end namespace sensor 64 }// end namespace flair 35 65 36 66 namespace flair { … … 80 110 xy_plot = new DataPlot2D(plot_tab->NewRow(), "xy", "y", -5, 5, "x", -5, 5); 81 111 xy_plot->AddCurve(Output()->Element(5, 0), Output()->Element(4, 0)); 112 113 altitudeSensor=new MetaVrpnObjectAltitudeSensor(this,name); 114 } 115 116 sensor::AltitudeSensor *MetaVrpnObject::GetAltitudeSensor(void) const { 117 return altitudeSensor; 82 118 } 83 119 … … 102 138 } 103 139 104 } // end namespace sensor140 } // end namespace meta 105 141 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.