INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

localise3delement.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 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 ORCAGUI_LOCALISE3D_GUI_ELEMENT_H
00012 #define ORCAGUI_LOCALISE3D_GUI_ELEMENT_H
00013 
00014 #include <orcaice/context.h>
00015 
00016 #include <orcaqgui3d/iknowsplatformposition.h>
00017 #include <orcaqgui3d/icestormelement3d.h>
00018 #include <orcaqgui3dfactory/localisepainter.h>
00019 
00020 namespace orcaqgui3d
00021 {
00022 
00023 class Localise3dElement
00024     : public orcaqgui3d::IceStormElement3d<LocalisePainter,
00025                              orca::Localise3dData,
00026                              orca::Localise3dPrx,
00027                              orca::Localise3dConsumer,
00028                              orca::Localise3dConsumerPrx>,
00029       public orcaqgui3d::IKnowsPlatformPosition
00030 {
00031 public:
00032     Localise3dElement( const hydroqguielementutil::GuiElementInfo &guiElementInfo,
00033                        const orcaice::Context                     &context,
00034                        bool                                        beginDisplayHistory = false,
00035                        int                                         timeoutMs = 30000 )
00036         : orcaqgui3d::IceStormElement3d<LocalisePainter,
00037                             orca::Localise3dData,
00038                             orca::Localise3dPrx,
00039                             orca::Localise3dConsumer,
00040                             orca::Localise3dConsumerPrx>( guiElementInfo, context, painter_, timeoutMs ),
00041           painter_( beginDisplayHistory ),
00042           x_(0),
00043           y_(0),
00044           yaw_(0),
00045           haveGeometry_(false)
00046         {}
00047 
00048     virtual bool isInGlobalCS() { return true; }
00049     virtual void iceStormConnectedEvent();
00050     virtual QStringList contextMenu();
00051     virtual void execute( int action );
00052     
00053     virtual void setColor( QColor color ) { painter_.setColor(color); }
00054     virtual void setFocus( bool inFocus ) { painter_.setFocus( inFocus ); };
00055     virtual void setUseTransparency( bool useTransparency ) { painter_.setUseTransparency( useTransparency ); };
00056 
00057     // Need a special update function to set (x,y,z,roll,pitch,yaw)
00058     // The Localise3dElement needs this because it's special kind of GuiElement:
00059     //   A platform has a position in the world and various other things are
00060     //   drawn with respect to that position.
00061     virtual void update();
00062 
00063     // Access to ML estimate.
00064     virtual float x() const { return x_; }
00065     virtual float y() const { return y_; }
00066     virtual float z() const { return z_; }
00067     virtual float roll() const { return roll_; }
00068     virtual float pitch() const { return pitch_; }
00069     virtual float yaw() const { return yaw_; }
00070     virtual int platformKnowledgeReliability() const { return 8; }
00071 
00072     osg::Node *osgNode() const { return painter_.osgNode(); }    
00073 
00074 private:
00075 
00076     LocalisePainter painter_;
00077 
00078     double x_;
00079     double y_;
00080     double z_;
00081     double roll_;
00082     double pitch_;
00083     double yaw_;
00084     
00085     void tryToGetGeometry();
00086     bool haveGeometry_;
00087 };
00088 
00089 }
00090 
00091 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5