-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVisualization.hpp
57 lines (42 loc) · 1.24 KB
/
Visualization.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef VISUALIZATION_HPP
#define VISUALIZATION_HPP
#include "Parcour.hpp"
#include <osg/ref_ptr>
#include <osg/Texture2D>
#include <osg/TextureRectangle>
#include <osg/Camera>
namespace osgViewer {
class Viewer;
}
namespace osg {
class Group;
}
class Visualization: public osg::Camera::DrawCallback
{
osg::ref_ptr<osg::Group> rootNode;
osgViewer::Viewer *viewer;
osg::ref_ptr<osg::TextureRectangle> rttTexture;
osg::ref_ptr<osg::Image> rttImage;
osg::ref_ptr<osg::Camera> rttCamera;
osg::ref_ptr<osg::PositionAttitudeTransform> robot;
mutable std::vector<uint8_t> imageData;
Parcour &parcour;
size_t width;
size_t height;
size_t textureWidth;
size_t textureHeight;
virtual void operator () (const osg::Camera& /*camera*/) const;
public:
Visualization(Parcour &parcour);
void setupScene();
void setRobotPose(const Eigen::Vector3d postion, const Eigen::Quaterniond &orientation);
void draw(const Eigen::Vector3d postion, const Eigen::Quaterniond &orientation);
void copyCameraImage(uint8_t *imageData);
void createHUD();
void addCamera();
osgViewer::Viewer *getViewer()
{
return viewer;
};
};
#endif // VISUALIZATION_HPP