Position.cpp
Go to the documentation of this file.
00001 
00012 // graspdb
00013 #include "graspdb/Position.h"
00014 
00015 using namespace std;
00016 using namespace rail::pick_and_place::graspdb;
00017 
00018 Position::Position(const double x, const double y, const double z)
00019 {
00020   // set position data
00021   x_ = x;
00022   y_ = y;
00023   z_ = z;
00024 }
00025 
00026 Position::Position(const geometry_msgs::Point &point)
00027 {
00028   // copy position data
00029   x_ = point.x;
00030   y_ = point.y;
00031   z_ = point.z;
00032 }
00033 
00034 Position::Position(const geometry_msgs::Vector3 &v)
00035 {
00036   // copy position data
00037   x_ = v.x;
00038   y_ = v.y;
00039   z_ = v.z;
00040 }
00041 
00042 Position::Position(const tf2::Vector3 &v)
00043 {
00044   // copy position data
00045   x_ = v.getX();
00046   y_ = v.getY();
00047   z_ = v.getZ();
00048 }
00049 
00050 void Position::setX(const double x)
00051 {
00052   x_ = x;
00053 }
00054 
00055 double Position::getX() const
00056 {
00057   return x_;
00058 }
00059 
00060 void Position::setY(const double y)
00061 {
00062   y_ = y;
00063 }
00064 
00065 double Position::getY() const
00066 {
00067   return y_;
00068 }
00069 
00070 void Position::setZ(const double z)
00071 {
00072   z_ = z;
00073 }
00074 
00075 double Position::getZ() const
00076 {
00077   return z_;
00078 }
00079 
00080 geometry_msgs::Point Position::toROSPointMessage() const
00081 {
00082   geometry_msgs::Point p;
00083   p.x = x_;
00084   p.y = y_;
00085   p.z = z_;
00086   return p;
00087 }
00088 
00089 geometry_msgs::Vector3 Position::toROSVector3Message() const
00090 {
00091   geometry_msgs::Vector3 v;
00092   v.x = x_;
00093   v.y = y_;
00094   v.z = z_;
00095   return v;
00096 }
00097 
00098 tf2::Vector3 Position::toTF2Vector3() const
00099 {
00100   tf2::Vector3 v(x_, y_, z_);
00101   return v;
00102 }
00103 


graspdb
Author(s): Russell Toris
autogenerated on Sun Mar 6 2016 11:38:59