00001 /* 00002 * VRPNTrackerClient.hpp 00003 * 00004 * Created on: Nov 30, 2012 00005 * Author: vgrabe 00006 */ 00007 00008 #ifndef VRPNTRACKERCLIENT_HPP_ 00009 #define VRPNTRACKERCLIENT_HPP_ 00010 00011 #include <ros/ros.h> 00012 #include <tf/transform_broadcaster.h> 00013 #include <vrpn_Tracker.h> 00014 00015 #include <geometry_msgs/TransformStamped.h> 00016 #include <geometry_msgs/PoseStamped.h> 00017 00018 #include <vrpn_tracker/VRPNTrackerClientOptions.hpp> 00019 00020 // Forward declaration 00021 void VRPN_CALLBACK viconTracker_handleTracker(void* userData, const vrpn_TRACKERCB t ); 00022 00023 class VRPNTrackerClient { 00024 protected: 00025 ros::NodeHandle nodeHandle; 00026 ros::Publisher pub; 00027 geometry_msgs::PoseStamped poseStamped; 00028 std::string childFrameID; 00029 00030 VRPNTrackerClientOptions *options; 00031 tf::TransformBroadcaster transBroadcaster; 00032 00033 vrpn_Tracker_Remote *vrpnTracker; 00034 00035 std::vector<float> opttrackRotationMatrix; 00036 00037 friend void VRPN_CALLBACK viconTracker_handleTracker(void* userData, const vrpn_TRACKERCB t ); 00038 public: 00039 VRPNTrackerClient(const std::string& objectName); 00040 virtual ~VRPNTrackerClient(); 00041 00042 void spin(); 00043 00044 void handleVRPNTrackerCB(const vrpn_TRACKERCB t); 00045 00046 private: 00047 std::vector<float> multMatrixVector(const std::vector<float> &mat, const std::vector<float> &vec); 00048 }; 00049 00050 #endif /* VRPNTRACKERCLIENT_HPP_ */