Skip to content
Snippets Groups Projects
Commit 4b79492f authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add viz::Path and viz::Line to ArViz example

parent 5b737f7f
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@
#include <ArmarXCore/libraries/DecoupledSingleComponent/Decoupled.h>
#include <RobotAPI/components/ArViz/Client/Client.h>
#include <RobotAPI/components/ArViz/Client/elements/Line.h>
namespace armarx
......@@ -170,7 +171,37 @@ namespace armarx
layer.add(arrow);
}
std::vector<Eigen::Vector3f> pathPoints {
{ -800, 0, 500 },
{ -1000, 0, 500 },
{ -1000, 200, 500 },
};
Eigen::Vector3f additionalPoint = {-1000, 200, 700};
{
viz::Path path = viz::Path("path")
.color(simox::Color::lime())
.width(10);
path.points(pathPoints);
path.addPoint(additionalPoint);
layer.add(path);
}
pathPoints.push_back(additionalPoint);
{
const Eigen::Vector3f offset = - 300 * Eigen::Vector3f::UnitX();
for (size_t i = 0; i < pathPoints.size() - 1; i += 2)
{
viz::Line line = viz::Line("line " + std::to_string(i) + " -> " + std::to_string(i+1))
.fromTo(pathPoints.at(i) + offset, pathPoints.at(i+1) + offset)
.color(simox::Color::magenta()).lineWidth(10)
;
layer.add(line);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment