robot.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, Willow Garage, Inc.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Neither the name of the Willow Garage, Inc. nor the names of its
00014  *       contributors may be used to endorse or promote products derived from
00015  *       this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 #ifndef RVIZ_ROBOT_H_
00031 #define RVIZ_ROBOT_H_
00032 
00033 #include "rviz/properties/forwards.h"
00034 #include "link_updater.h"
00035 
00036 #include <string>
00037 #include <map>
00038 
00039 #include <OGRE/OgreVector3.h>
00040 #include <OGRE/OgreQuaternion.h>
00041 #include <OGRE/OgreAny.h>
00042 
00043 namespace Ogre
00044 {
00045 class SceneManager;
00046 class Entity;
00047 class SceneNode;
00048 class Vector3;
00049 class Quaternion;
00050 class Any;
00051 class RibbonTrail;
00052 }
00053 
00054 namespace rviz
00055 {
00056 class Object;
00057 class Axes;
00058 }
00059 
00060 namespace planning_models
00061 {
00062 class KinematicModel;
00063 }
00064 
00065 namespace tf
00066 {
00067 class TransformListener;
00068 }
00069 
00070 namespace urdf
00071 {
00072 class Model;
00073 }
00074 
00075 class TiXmlElement;
00076 
00077 namespace rviz
00078 {
00079 
00080 class Robot;
00081 class RobotLink;
00082 class VisualizationManager;
00083 
00090 class Robot
00091 {
00092 public:
00093   Robot( VisualizationManager* manager, const std::string& name = "" );
00094   ~Robot();
00095 
00096   void setPropertyManager( PropertyManager* property_manager, const CategoryPropertyWPtr& parent );
00097 
00105   void load( TiXmlElement* root_element, urdf::Model &descr, bool visual = true, bool collision = true );
00106 
00110   void clear();
00111 
00112   void update(const LinkUpdater& updater);
00113 
00118   void setVisible( bool visible );
00119 
00124   void setVisualVisible( bool visible );
00125 
00130   void setCollisionVisible( bool visible );
00131 
00135   bool isVisualVisible();
00139   bool isCollisionVisible();
00140 
00141   void setAlpha(float a);
00142   float getAlpha() { return alpha_; }
00143 
00144   RobotLink* getLink( const std::string& name );
00145 
00146   const std::string& getName() { return name_; }
00147 
00148   Ogre::SceneNode* getVisualNode() { return root_visual_node_; }
00149   Ogre::SceneNode* getCollisionNode() { return root_collision_node_; }
00150   Ogre::SceneNode* getOtherNode() { return root_other_node_; }
00151 
00152   CategoryPropertyWPtr getLinksCategory() { return links_category_; }
00153 
00154   virtual void setPosition( const Ogre::Vector3& position );
00155   virtual void setOrientation( const Ogre::Quaternion& orientation );
00156   virtual void setScale( const Ogre::Vector3& scale );
00157   virtual const Ogre::Vector3& getPosition();
00158   virtual const Ogre::Quaternion& getOrientation();
00159 
00160 protected:
00162   void updateLinkVisibilities();
00163 
00164   Ogre::SceneManager* scene_manager_;
00165 
00166   typedef std::map< std::string, RobotLink* > M_NameToLink;
00167   M_NameToLink links_;                      
00168 
00169   Ogre::SceneNode* root_visual_node_;           
00170   Ogre::SceneNode* root_collision_node_;        
00171   Ogre::SceneNode* root_other_node_;
00172 
00173   bool visual_visible_;                         
00174   bool collision_visible_;                      
00175 
00176   VisualizationManager* vis_manager_;
00177   PropertyManager* property_manager_;
00178   CategoryPropertyWPtr parent_property_;
00179   CategoryPropertyWPtr links_category_;
00180 
00181   std::string name_;
00182   float alpha_;
00183 };
00184 
00185 } // namespace rviz
00186 
00187 #endif /* RVIZ_ROBOT_H_ */


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Mon Jan 6 2014 11:54:32