SpaceNavPrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 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 #ifndef _GAZEBO_SPACENAV_PRIVATE_HH_
18 #define _GAZEBO_SPACENAV_PRIVATE_HH_
19 
20 #define SCALE 512.0
21 
22 #include "gazebo/math/Vector3.hh"
23 #include "gazebo/transport/transport.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
31  {
33  public: SpaceNavPrivate()
34  {
35  this->pollThread = NULL;
36  this->stop = false;
37  this->buttons[0] = 0;
38  this->buttons[1] = 0;
39  }
40 
42  public: virtual ~SpaceNavPrivate()
43  {
44  this->stop = true;
45  if (this->pollThread)
46  this->pollThread->join();
47  delete this->pollThread;
48  this->pollThread = NULL;
49  }
50 
52  public: boost::thread *pollThread;
53 
55  public: bool stop;
56 
59 
62 
65 
68 
70  public: int buttons[2];
71  };
72  }
73 }
74 #endif
transport::PublisherPtr joyPub
Publisher pointer used to publish the messages.
Definition: SpaceNavPrivate.hh:61
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
virtual ~SpaceNavPrivate()
Destructor.
Definition: SpaceNavPrivate.hh:42
bool stop
Use to stop the additional thread that the plugin uses.
Definition: SpaceNavPrivate.hh:55
math::Vector3 deadbandTrans
Translation values below which joystick values return zero.
Definition: SpaceNavPrivate.hh:64
Private data for the SpaceNav class.
Definition: SpaceNavPrivate.hh:30
int buttons[2]
button states
Definition: SpaceNavPrivate.hh:70
SpaceNavPrivate()
Constructor.
Definition: SpaceNavPrivate.hh:33
#define NULL
Definition: CommonTypes.hh:31
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
boost::thread * pollThread
Additional thread.
Definition: SpaceNavPrivate.hh:52
math::Vector3 deadbandRot
Rotation values below which joystick values return zero.
Definition: SpaceNavPrivate.hh:67
transport::NodePtr node
Gazebo communication node pointer.
Definition: SpaceNavPrivate.hh:58