29 #ifdef G2O_HAVE_OPENGL 37 using namespace Eigen;
41 VertexSE3::VertexSE3() :
52 for (
int i=0; i<7; i++)
61 for (
int i=0; i<7; i++)
79 for (
int i=0; i<6; i++)
80 *(params->
os) << est[i] <<
" ";
81 *(params->
os) << std::endl;
85 #ifdef G2O_HAVE_OPENGL 86 void drawTriangle(
float xSize,
float ySize){
88 glBegin(GL_TRIANGLES);
90 p[1] << -xSize, ySize, 0.;
91 p[2] << -xSize, -ySize, 0.;
92 for (
int i = 1; i < 2; ++i) {
93 Vector3F normal = (p[i] - p[0]).cross(p[i+1] - p[0]);
94 glNormal3f(normal.x(), normal.y(), normal.z());
95 glVertex3f(p[0].x(), p[0].y(), p[0].z());
96 glVertex3f(p[i].x(), p[i].y(), p[i].z());
97 glVertex3f(p[i+1].x(), p[i+1].y(), p[i+1].z());
103 _cacheDrawActions = 0;
109 if (_previousParams){
111 _triangleY = _previousParams->makeProperty<
FloatProperty>(_typeName +
"::TRIANGLE_Y", .05f);
123 initializeDrawActionsCache();
124 refreshPropertyPtrs(params_);
126 if (! _previousParams)
129 if (_show && !_show->value())
136 glMultMatrixd(that->
estimate().matrix().data());
139 drawUserData(that->
userData(), params_);
Eigen::Matrix< float, 3, 1, Eigen::ColMajor > Vector3F
#define __PRETTY_FUNCTION__
const Data * userData() const
the user data associated with this vertex
Isometry3D fromVectorQT(const Vector7d &v)
Abstract action that operates on a graph entity.
CacheContainer * cacheContainer()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
redefine this to do the action stuff. If successful, the action returns a pointer to itself ...
virtual void updateCache()
Eigen::Matrix< double, 7, 1 > Vector7d
const std::string & name() const
returns the name of an action, e.g "draw"
void drawArrow2D(float len, float head_width, float head_len)
virtual bool write(std::ostream &os) const
write the vertex to a stream
#define POSE_VERTEX_COLOR
VertexSE3WriteGnuplotAction()
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor > Isometry3D
Vector6d toVectorMQT(const Isometry3D &t)
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
const EstimateType & estimate() const
return the current estimate of the vertex
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
3D pose Vertex, represented as an Isometry3D
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
Vector7d toVectorQT(const Isometry3D &t)
Matrix< double, 6, 1, Eigen::ColMajor > Vector6d