40 win.setCameraAzimuthDeg(-50);
41 win.setCameraElevationDeg(40);
42 win.setCameraZoom(19);
43 win.setCameraPointingToPoint(2, 2, 0);
49 mrpt::make_aligned_shared<opengl::CGridPlaneXY>(
50 -20, 20, -20, 20, 0, 1);
51 obj->setColor(0.4, 0.4, 0.4);
52 theScene->insert(
obj);
64 theScene->insert(
obj);
71 theScene->insert(
obj);
77 obj->setName(
"slerp_obj");
79 theScene->insert(
obj);
83 win.unlockAccess3DScene();
85 cout <<
"\n Close the window to exit.\n";
88 static const double MOVE_PERIOD = 1.0;
89 static const double MOVE_PERIOD2 = 2 * MOVE_PERIOD;
94 double t = ::fmod(tic.
Tac(), MOVE_PERIOD2);
98 t = 1 - (
t - MOVE_PERIOD) / MOVE_PERIOD;
108 obj1->setPose(pose_interp);
116 win.unlockAccess3DScene();
120 std::this_thread::sleep_for(5ms);
134 catch (std::exception& e)
136 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
141 printf(
"Untyped exception!!");
double Tac() noexcept
Stops the stopwatch.
void slerp(const CQuaternion< T > &q0, const CQuaternion< T > &q1, const double t, CQuaternion< T > &q)
SLERP interpolation between two quaternions.
A high-performance stopwatch, with typical resolution of nanoseconds.
GLsizei GLsizei GLuint * obj
This base provides a set of functions for maths stuff.
mrpt::gui::CDisplayWindow3D::Ptr win
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CSetOfObjects::Ptr CornerXYZSimple(float scale=1.0, float lineWidth=1.0)
Returns three arrows representing a X,Y,Z 3D corner (just thick lines instead of complex arrows for f...
A RGB color - floats in the range [0,1].
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
The namespace for 3D scene representation and rendering.
GLenum GLsizei GLenum format
Classes for creating GUI windows for 2D and 3D visualization.
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.