40 win.setCameraAzimuthDeg(-50);
41 win.setCameraElevationDeg(40);
42 win.setCameraZoom(19);
43 win.setCameraPointingToPoint(2, 2, 0);
48 auto obj = opengl::CGridPlaneXY::Create(-20, 20, -20, 20, 0, 1);
49 obj->setColor(0.4, 0.4, 0.4);
50 theScene->insert(
obj);
62 theScene->insert(
obj);
69 theScene->insert(
obj);
75 obj->setName(
"slerp_obj");
77 theScene->insert(
obj);
81 win.unlockAccess3DScene();
83 cout <<
"\n Close the window to exit.\n";
86 static const double MOVE_PERIOD = 1.0;
87 static const double MOVE_PERIOD2 = 2 * MOVE_PERIOD;
92 double t = ::fmod(tic.
Tac(), MOVE_PERIOD2);
96 t = 1 - (
t - MOVE_PERIOD) / MOVE_PERIOD;
106 obj1->setPose(pose_interp);
114 win.unlockAccess3DScene();
118 std::this_thread::sleep_for(5ms);
132 catch (
const std::exception& e)
139 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.
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
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.