63 if (
typeid(*element).name() !=
_typeName)
return nullptr;
72 for (
int i = 0; i < 6; i++) *(params->
os) << est[i] <<
" ";
73 *(params->
os) << std::endl;
78void drawTriangle(
float xSize,
float ySize) {
80 glBegin(GL_TRIANGLES);
82 p[1] << -xSize, ySize, 0.;
83 p[2] << -xSize, -ySize, 0.;
84 for (
int i = 1; i < 2; ++i) {
85 Vector3F normal = (p[i] - p[0]).cross(p[i + 1] - p[0]);
86 glNormal3f(normal.x(), normal.y(), normal.z());
87 glVertex3f(p[0].x(), p[0].y(), p[0].z());
88 glVertex3f(p[i].x(), p[i].y(), p[i].z());
89 glVertex3f(p[i + 1].x(), p[i + 1].y(), p[i + 1].z());
94VertexSE3DrawAction::VertexSE3DrawAction()
95 : DrawAction(typeid(VertexSE3).name()),
98 _cacheDrawActions = 0;
101bool VertexSE3DrawAction::refreshPropertyPtrs(
102 HyperGraphElementAction::Parameters* params_) {
104 if (_previousParams) {
106 _typeName +
"::TRIANGLE_X", .2f);
108 _typeName +
"::TRIANGLE_Y", .05f);
116HyperGraphElementAction* VertexSE3DrawAction::operator()(
117 HyperGraph::HyperGraphElement* element,
118 HyperGraphElementAction::Parameters* params_) {
119 if (
typeid(*element).name() != _typeName)
return nullptr;
120 initializeDrawActionsCache();
121 refreshPropertyPtrs(params_);
123 if (!_previousParams)
return this;
125 if (_show && !_show->value())
return this;
127 VertexSE3* that =
static_cast<VertexSE3*
>(element);
131 glMultMatrixd(that->estimate().matrix().cast<
double>().eval().data());
133 _triangleX->value() * .3f);
134 drawCache(that->cacheContainer(), params_);
135 drawUserData(that->userData(), params_);
const EstimateType & estimate() const
return the current estimate of the vertex
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
Abstract action that operates on a graph entity.
virtual void updateCache()
VertexSE3WriteGnuplotAction()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
3D pose Vertex, represented as an Isometry3
virtual bool write(std::ostream &os) const
write the vertex to a stream
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Isometry3 fromVectorQT(const Vector7 &v)
Vector6 toVectorMQT(const Isometry3 &t)
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
Vector7 toVectorQT(const Isometry3 &t)
void drawArrow2D(float len, float head_width, float head_len)
Eigen::Matrix< float, 3, 1, Eigen::ColMajor > Vector3F
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor > Isometry3
Property< float > FloatProperty
#define POSE_VERTEX_COLOR