File: simulation_io.hpp

package info (click to toggle)
pcl 1.13.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,524 kB
  • sloc: cpp: 518,578; xml: 28,792; ansic: 13,676; python: 334; lisp: 93; sh: 49; makefile: 30
file content (66 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (5)
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
58
59
60
61
62
63
64
65
66
#pragma once

#include <pcl/io/vtk_lib_io.h>
#include <pcl/simulation/camera.h>
#include <pcl/simulation/range_likelihood.h>
#include <pcl/simulation/scene.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>

#include <GL/glew.h>

#ifdef OPENGL_IS_A_FRAMEWORK
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#ifdef GLUT_IS_A_FRAMEWORK
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

namespace pcl {
namespace simulation {

class PCL_EXPORTS SimExample {
public:
  using Ptr = shared_ptr<SimExample>;
  using ConstPtr = shared_ptr<const SimExample>;

  SimExample(int argc, char** argv, int height, int width);
  void
  initializeGL(int argc, char** argv);

  Scene::Ptr scene_;
  Camera::Ptr camera_;
  RangeLikelihood::Ptr rl_;

  void
  doSim(Eigen::Isometry3d pose_in);

  void
  write_score_image(const float* score_buffer, std::string fname);

  void
  write_depth_image(const float* depth_buffer, std::string fname);

  void
  write_depth_image_uint(const float* depth_buffer, std::string fname);

  void
  write_rgb_image(const std::uint8_t* rgb_buffer, std::string fname);

private:
  std::uint16_t t_gamma[2048];

  // of platter, usually 640x480
  int height_;
  int width_;
};

} // namespace simulation
} // namespace pcl