Go to the documentation of this file.00001 #include "zyonz_nbv_geometric_simple_alg.h"
00002
00003 ZyonzNbvGeometricSimpleAlgorithm::ZyonzNbvGeometricSimpleAlgorithm(void):
00004 nbv_ptr_(boost::make_shared<geometry_msgs::PoseStamped> ())
00005 {
00006 }
00007
00008 ZyonzNbvGeometricSimpleAlgorithm::~ZyonzNbvGeometricSimpleAlgorithm(void)
00009 {
00010 }
00011
00012 void ZyonzNbvGeometricSimpleAlgorithm::config_update(Config& new_cfg, uint32_t level)
00013 {
00014 this->lock();
00015
00016
00017 this->config_=new_cfg;
00018
00019 this->unlock();
00020 }
00021
00022
00023 bool ZyonzNbvGeometricSimpleAlgorithm::isRunning(geometry_msgs::PoseStamped& viewpoint, geometry_msgs::PoseStamped& viewpoint_roi)
00024 {
00025
00026 tf::Quaternion tf_quat(tf::Quaternion::getIdentity());
00027
00028 if (viewpoint_roi.pose.position.x < 0.0)
00029 tf_quat.setEuler(M_PI_4/2,0.0, 0.0 );
00030 else
00031 tf_quat.setEuler(-M_PI_4/2,0.0, 0.0 );
00032
00033 tf::Transform TF(tf_quat);
00034
00035
00036 tf::Stamped<tf::Transform> w_tf_viewpoint;
00037 tf::poseStampedMsgToTF (viewpoint, w_tf_viewpoint);
00038
00039 tf::Stamped<tf::Transform> viewpoint_tf_roi;
00040 tf::poseStampedMsgToTF (viewpoint_roi, viewpoint_tf_roi);
00041
00042
00043 tf::Stamped<tf::Transform> w_tf_nbv (w_tf_viewpoint * viewpoint_tf_roi * TF * viewpoint_tf_roi.inverse(), ros::Time::now(), w_tf_viewpoint.frame_id_);
00044
00045 tf::poseStampedTFToMsg(w_tf_nbv, *nbv_ptr_);
00046
00047 return true;
00048 }
00049
00050 geometry_msgs::PoseStamped::Ptr ZyonzNbvGeometricSimpleAlgorithm::get_nbv () const
00051 {
00052 return nbv_ptr_;
00053 }
00054
00055
00056