abstract_robot.h
Go to the documentation of this file.
1 #ifndef ABSTRACT_ROBOT_
2 #define ABSTRACT_ROBOT_
3 
4 #include "ros/ros.h"
5 #include <tf2/LinearMath/Transform.h>
6 #include <bitset>
7 
9 
11  RML = 7,
12  RM_ = 6,
13  R_L = 5,
14  R__ = 4,
15  _ML = 3,
16  _M_ = 2,
17  __L = 1,
18  ___ = 0
19 };
20 
22 
26  protected:
27  std::string name_;
28  tf2::Vector3 size_;
29  tf2::Transform tf_;
30  tf2::Transform root_tf_;
31  std::vector<tf2::Transform> bounds_;
32  std::vector<tf2::Transform> robot_root_bounds_;
33 
34  public:
35  AbstractRobot(std::string name, tf2::Transform tf, tf2::Vector3 size);
36 
37  virtual std::string& name()=0;
38  virtual tf2::Transform& tf()=0;
39  virtual tf2::Vector3& size()=0;
40  virtual tf2::Transform& rootTf()=0;
41  virtual std::vector<tf2::Transform>& bounds()=0;
42  virtual std::vector<tf2::Transform>& robotRootBounds()=0;
43  virtual bool checkSingleObjectCollision(tf2::Transform& obj, std::string& robot_element, std::bitset<3>& panel_mask) =0;
44 
45 
46 
47  inline void size(tf2::Vector3& s) { size_ = s;}
48  inline void setTf(tf2::Transform& t) { tf_ = t;}
49  inline void rotate(float deg) {tf2::Quaternion rot; rot.setRPY(0,0,deg); tf2::Transform t(rot, tf2::Vector3(0,0,0)); tf_= tf_* t;}
50  inline void translate(tf2::Vector3 t) {tf2::Transform tf(tf2::Quaternion(0,0,0,1), t); tf_*=tf;}
51  virtual void notify()= 0;
52 
54 
61  float areaCalculation(tf2::Transform& A, tf2::Transform& B, tf2::Transform& C);
62 
63 };
64 
65 
66 #endif
AbstractRobot::notify
virtual void notify()=0
AbstractRobot::AbstractRobot
AbstractRobot(std::string name, tf2::Transform tf, tf2::Vector3 size)
Definition: abstract_robot.cpp:4
RML
@ RML
Definition: abstract_robot.h:11
AbstractRobot::bounds
virtual std::vector< tf2::Transform > & bounds()=0
R_L
@ R_L
Definition: abstract_robot.h:13
_M_
@ _M_
Definition: abstract_robot.h:16
AbstractRobot::rotate
void rotate(float deg)
Definition: abstract_robot.h:49
wing_config
wing_config
Definition: abstract_robot.h:10
AbstractRobot::setTf
void setTf(tf2::Transform &t)
Definition: abstract_robot.h:48
AbstractRobot::areaCalculation
float areaCalculation(tf2::Transform &A, tf2::Transform &B, tf2::Transform &C)
Triangle area calculator.
Definition: abstract_robot.cpp:22
AbstractRobot::tf
virtual tf2::Transform & tf()=0
___
@ ___
Definition: abstract_robot.h:18
AbstractRobot::bounds_
std::vector< tf2::Transform > bounds_
Bounds of table top surface.
Definition: abstract_robot.h:31
AbstractRobot::name
virtual std::string & name()=0
AbstractRobot::rootTf
virtual tf2::Transform & rootTf()=0
_ML
@ _ML
Definition: abstract_robot.h:15
AbstractRobot::root_tf_
tf2::Transform root_tf_
Robot root on table top.
Definition: abstract_robot.h:30
AbstractRobot
Abstract Robot implementation.
Definition: abstract_robot.h:25
AbstractRobot::size
virtual tf2::Vector3 & size()=0
AbstractRobot::tf_
tf2::Transform tf_
Pose of table.
Definition: abstract_robot.h:29
RM_
@ RM_
Definition: abstract_robot.h:12
R__
@ R__
Definition: abstract_robot.h:14
AbstractRobot::translate
void translate(tf2::Vector3 t)
Definition: abstract_robot.h:50
__L
@ __L
Definition: abstract_robot.h:17
AbstractRobot::size
void size(tf2::Vector3 &s)
Definition: abstract_robot.h:47
AbstractRobot::checkSingleObjectCollision
virtual bool checkSingleObjectCollision(tf2::Transform &obj, std::string &robot_element, std::bitset< 3 > &panel_mask)=0
AbstractRobot::name_
std::string name_
Name of robot.
Definition: abstract_robot.h:27
abstract_robot_element.h
AbstractRobot::robotRootBounds
virtual std::vector< tf2::Transform > & robotRootBounds()=0
AbstractRobot::size_
tf2::Vector3 size_
Size of table.
Definition: abstract_robot.h:28
AbstractRobot::robot_root_bounds_
std::vector< tf2::Transform > robot_root_bounds_
Bounds of robot arm as sub-region of table top.
Definition: abstract_robot.h:32


multi_cell_builder
Author(s): Matteo Anedda
autogenerated on Sun Apr 9 2023 23:59:51