vicon
ViconDriver.hpp
Go to the documentation of this file.
1 #ifndef __VICON_DRIVER_HPP__
2 #define __VICON_DRIVER_HPP__
3 
5 #include <base/Time.hpp>
6 #include <base/Eigen.hpp>
7 
9 #include <boost/shared_ptr.hpp>
10 
12 #include <Eigen/Core>
13 #include <Eigen/Geometry>
14 
15 #include <vector>
16 
17 namespace vicon
18 {
19 
20  class DriverImpl;
21 
32  class Driver
33  {
34  public:
36 
37  Driver();
38 
46  bool connect( const std::string& hostname, const unsigned int port = 801 );
47 
51  bool isConnected();
52 
56  void disconnect();
57 
65  bool getFrame( const base::Time& timeout = base::Time::fromSeconds(1.0) );
66 
70  base::Time getTimestamp();
71 
81  Eigen::Affine3d getSegmentTransform( const std::string& subjectName, const std::string& segmentName, bool& inFrame);
82 
84  Eigen::Affine3d getSegmentTransform( const std::string& subjectName, const std::string& segmentName) {
85  bool lin_frame;
86  return getSegmentTransform ( subjectName, segmentName, lin_frame );
87  }
88 
90  GetResult getLastResult() { return mLastResult; }
91 
98  std::vector<base::Vector3d> getUnlabeledMarkers();
99 
101  void getAxesDir ( int& x_dir, int& y_dir, int& z_dir );
102 
106  void setAxesDir ( int x_dir, int y_dir, int z_dir );
107 
108  private:
109  boost::shared_ptr<DriverImpl> impl;
110  GetResult mLastResult;
111  };
112 }
113 
114 #endif
bool isConnected()
Definition: ViconDriver.cpp:82
void disconnect()
Definition: ViconDriver.cpp:87
void setAxesDir(int x_dir, int y_dir, int z_dir)
Set axes directions.
GetResult getLastResult()
Definition: ViconDriver.hpp:90
void getAxesDir(int &x_dir, int &y_dir, int &z_dir)
Get axes direction.
Eigen::Affine3d getSegmentTransform(const std::string &subjectName, const std::string &segmentName)
Definition: ViconDriver.hpp:84
Eigen::Affine3d getSegmentTransform(const std::string &subjectName, const std::string &segmentName, bool &inFrame)
bool connect(const std::string &hostname, const unsigned int port=801)
Definition: ViconDriver.cpp:53
bool getFrame(const base::Time &timeout=base::Time::fromSeconds(1.0))
Definition: ViconDriver.cpp:93
std::vector< base::Vector3d > getUnlabeledMarkers()
base::Time getTimestamp()