Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef LASER_JOINT_PROCESSOR_JOINT_IMAGER_H_
00036 #define LASER_JOINT_PROCESSOR_JOINT_IMAGER_H_
00037
00038 #include <opencv2/core/core.hpp>
00039 #include <settlerlib/sorted_deque.h>
00040 #include <joint_states_settler/deflated_joint_states.h>
00041 #include <calibration_msgs/DenseLaserSnapshot.h>
00042
00043 namespace laser_joint_processor
00044 {
00045
00046 class JointImager
00047 {
00048 public:
00049 JointImager();
00050 ~JointImager();
00051
00052 bool update(const calibration_msgs::DenseLaserSnapshot& snapshot,
00053 const settlerlib::SortedDeque<joint_states_settler::DeflatedJointStates>& cache,
00054 const ros::Duration& max_interp = ros::Duration(.25));
00055
00056 void displayImage(unsigned int i);
00057 void writeImage(unsigned int i, const std::string& filename);
00058 cv::Mat_<cv::Vec2f> getJointImage(unsigned int index) const;
00059
00060 protected:
00061 std::vector<cv::Mat_<cv::Vec2f> > images;
00062
00063 bool interpPosition(const ros::Time& target,
00064 const settlerlib::SortedDeque<joint_states_settler::DeflatedJointStates>& cache,
00065 std::vector<double>& result);
00066
00067 bool computeVelocity(const ros::Time& start, const ros::Time& end,
00068 const settlerlib::SortedDeque<joint_states_settler::DeflatedJointStates>& cache,
00069 std::vector<double>& result);
00070
00071 void allocateImages(unsigned int height, unsigned int width, unsigned int channels);
00072
00073 };
00074
00075 }
00076
00077
00078 #endif
00079