Skip to content
Snippets Groups Projects
Select Git revision
  • 6f5396df27cd52d3882cce1dea00c69a7940ba93
  • main default protected
2 results

wing.h

Blame
  • wing.h 1.01 KiB
    #ifndef WING_
    #define WING_
    
    #include "ros/ros.h"
    #include "impl/abstract_robot_element.h"
    
    class Wing  : public Abstract_robot_element{
        private:
        tf2::Vector3 size_;
        std::vector<tf2::Transform> bounds_;
    
        public:
        Wing(tf2::Transform tf, tf2::Vector3 size) : size_(size){ 
            relative_tf_ = tf;
            bounds_.push_back(tf2::Transform(tf2::Quaternion(0,0,0,1), tf2::Vector3(size_.getX()/2.f, size_.getY()/2.f,0))); //++
            bounds_.push_back(tf2::Transform(tf2::Quaternion(0,0,0,1), tf2::Vector3(size_.getX()/2.f, size_.getY()/-2.f,0))); //+-
            bounds_.push_back(tf2::Transform(tf2::Quaternion(0,0,0,1), tf2::Vector3(size_.getX()/-2.f, size_.getY()/-2.f,0))); //--
            bounds_.push_back(tf2::Transform(tf2::Quaternion(0,0,0,1), tf2::Vector3(size_.getX()/-2.f, size_.getY()/2.f,0))); //-+
            }
        inline tf2::Vector3 size(){ return size_;}
        inline std::vector<tf2::Transform>& bounds() {return bounds_;}
        void update(tf2::Transform& tf) override {this->calc_world_tf(tf);}
    };
    
    #endif