All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WrenchVisual.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _WRENCHVISUAL_HH_
19 #define _WRENCHVISUAL_HH_
20 
21 #include <string>
22 #include <vector>
23 
25 #include "gazebo/msgs/MessageTypes.hh"
27 
28 namespace gazebo
29 {
30  namespace rendering
31  {
34 
35  class DynamicLines;
36 
39  class WrenchVisual : public Visual
40  {
45  public: WrenchVisual(const std::string &_name, VisualPtr _vis,
46  const std::string &_topicName);
47 
49  public: virtual ~WrenchVisual();
50 
53  public: void Load(ConstJointPtr &_msg);
54 
57  public: void SetEnabled(bool _enabled);
58 
60  private: void OnMsg(ConstWrenchStampedPtr &_msg);
61 
63  private: void Update();
64 
66  private: transport::NodePtr node;
67 
69  private: transport::SubscriberPtr wrenchSub;
70 
72  private: Ogre::SceneNode *coneXNode;
73 
75  private: Ogre::SceneNode *coneYNode;
76 
78  private: Ogre::SceneNode *coneZNode;
79 
81  private: Ogre::SceneNode *forceNode;
82 
84  private: DynamicLines *forceLine;
85 
87  private: boost::shared_ptr<msgs::WrenchStamped const> wrenchMsg;
88 
90  private: bool receivedMsg;
91 
93  private: bool enabled;
94 
96  private: boost::mutex mutex;
97 
99  private: std::vector<event::ConnectionPtr> connections;
100  };
102  }
103 }
104 #endif