From 43339a9ae4df19621e04b2c2f6cb62392ab983aa Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Mon, 25 Sep 2017 04:11:46 -0700 Subject: [PATCH] Prepare release 0.7 --- .gitignore | 14 - 3rdparty/CMakeLists.txt | 145 + 3rdparty/atidaq/CMakeLists.txt | 23 + 3rdparty/atidaq/CMakeLists.txt.in | 183 + 3rdparty/atidaq/atidaq-config.cmake.in | 13 + 3rdparty/atidaq/atidaq.patch | 24 + 3rdparty/boost/CMakeLists.txt | 17 + 3rdparty/bullet/CMakeLists.txt | 16 + 3rdparty/coin/CMakeLists.txt | 27 + 3rdparty/eigen/CMakeLists.txt | 16 + 3rdparty/libiconv/CMakeLists.txt | 22 + 3rdparty/libiconv/CMakeLists.txt.in | 843 + 3rdparty/libiconv/config.h.cmake.in | 926 ++ 3rdparty/libiconv/libiconv-1.15.patch | 29 + 3rdparty/libiconv/libiconv-config.cmake.in | 12 + 3rdparty/libxml2/CMakeLists.txt | 15 + 3rdparty/libxslt/CMakeLists.txt | 15 + 3rdparty/nlopt/CMakeLists.txt | 16 + 3rdparty/ode/CMakeLists.txt | 14 + 3rdparty/patch.exe.manifest | 10 + 3rdparty/pqp/CMakeLists.txt | 14 + 3rdparty/simage/CMakeLists.txt | 15 + 3rdparty/solid/CMakeLists.txt | 14 + 3rdparty/soqt/CMakeLists.txt | 27 + 3rdparty/zlib/CMakeLists.txt | 16 + CMakeLists.txt | 311 +- Doxyfile.in | 1749 --- LICENSE.GPL | 674 - Modules/FindAtidaq.cmake | 33 - Modules/FindBullet.cmake | 171 - Modules/FindCgal.cmake | 103 - Modules/FindCoin.cmake | 81 - Modules/FindComedi.cmake | 33 - Modules/FindEigen.cmake | 38 - Modules/FindIconv.cmake | 59 - Modules/FindLibXml2.cmake | 52 - Modules/FindLibdc1394.cmake | 66 - Modules/FindOde.cmake | 100 - Modules/FindPqp.cmake | 53 - Modules/FindSoQt.cmake | 81 - Modules/FindSolid.cmake | 73 - Modules/FindZLIB.cmake | 55 - cmake/CPackConfig.cmake | 259 + cmake/CPackProjectConfig.cmake | 3 + cmake/FindATIDAQ.cmake | 146 + cmake/FindBullet.cmake | 350 + cmake/FindCoin.cmake | 158 + cmake/FindComedi.cmake | 145 + cmake/FindEigen3.cmake | 92 + cmake/FindFCL.cmake | 155 + cmake/FindNLopt.cmake | 149 + cmake/FindODE.cmake | 170 + cmake/FindPQP.cmake | 151 + cmake/FindRTAI.cmake | 157 + cmake/FindSOLID3.cmake | 150 + cmake/FindSoQt.cmake | 155 + cmake/FindXenomai.cmake | 204 + cmake/Findccd.cmake | 150 + cmake/FindcifX.cmake | 151 + cmake/Findlibdc1394.cmake | 173 + cmake/Findlibiconv.cmake | 155 + cmake/Findlibxml2.cmake | 159 + cmake/Findlibxslt.cmake | 153 + cmake/Findzlib.cmake | 154 + cmake/Qt4AutomocMocOptionsBoost.cmake | 45 + cmake/WixExtra.wxs.in | 23 + cmake/WixPatch.xml.in | 19 + cmake/WixUIBanner.bmp | Bin 0 -> 85896 bytes cmake/WixUIDialog.bmp | Bin 0 -> 461816 bytes cmake/WixUI_FeatureTreeNoLicense.wxs | 66 + debian/changelog | 5 + {extras/debian => debian}/compat | 0 debian/control | 105 + debian/copyright | 31 + debian/librl-demos.install | 3 + debian/librl-dev.install | 3 + debian/librl-doc.install | 1 + debian/librl-examples.install | 2 + debian/librl-extras.install | 3 + debian/librl.install | 1 + debian/rules | 16 + demos/CMakeLists.txt | 68 + demos/rlAxisControllerDemo/CMakeLists.txt | 6 +- .../rlAxisControllerDemo.cpp | 122 +- demos/rlCameraDemo/CMakeLists.txt | 10 +- demos/rlCameraDemo/rlCameraDemo.cpp | 8 +- demos/rlCoachKin/CMakeLists.txt | 102 +- demos/rlCoachKin/ConfigurationDelegate.cpp | 16 +- demos/rlCoachKin/ConfigurationDelegate.h | 14 +- demos/rlCoachKin/ConfigurationModel.cpp | 66 +- demos/rlCoachKin/ConfigurationModel.h | 8 +- demos/rlCoachKin/MainWindow.cpp | 90 +- demos/rlCoachKin/MainWindow.h | 41 +- demos/rlCoachKin/OperationalDelegate.cpp | 16 +- demos/rlCoachKin/OperationalDelegate.h | 14 +- demos/rlCoachKin/OperationalModel.cpp | 98 +- demos/rlCoachKin/OperationalModel.h | 8 +- demos/rlCoachKin/Server.cpp | 4 + demos/rlCoachKin/Server.h | 12 +- demos/rlCoachKin/SoGradientBackground.cpp | 109 + demos/rlCoachKin/SoGradientBackground.h | 59 + demos/rlCoachKin/Socket.cpp | 128 +- demos/rlCoachKin/Socket.h | 8 +- demos/rlCoachKin/rlCoachKin.cpp | 6 +- ...CoachKin.desktop => rlCoachKin.desktop.in} | 2 +- demos/rlCoachMdl/CMakeLists.txt | 102 +- demos/rlCoachMdl/ConfigurationDelegate.cpp | 23 +- demos/rlCoachMdl/ConfigurationDelegate.h | 14 +- demos/rlCoachMdl/ConfigurationModel.cpp | 76 +- demos/rlCoachMdl/ConfigurationModel.h | 8 +- demos/rlCoachMdl/MainWindow.cpp | 175 +- demos/rlCoachMdl/MainWindow.h | 55 +- demos/rlCoachMdl/OperationalDelegate.cpp | 16 +- demos/rlCoachMdl/OperationalDelegate.h | 14 +- demos/rlCoachMdl/OperationalModel.cpp | 146 +- demos/rlCoachMdl/OperationalModel.h | 8 +- demos/rlCoachMdl/Server.cpp | 4 + demos/rlCoachMdl/Server.h | 12 +- demos/rlCoachMdl/SoGradientBackground.cpp | 109 + demos/rlCoachMdl/SoGradientBackground.h | 59 + demos/rlCoachMdl/Socket.cpp | 141 +- demos/rlCoachMdl/Socket.h | 8 +- demos/rlCoachMdl/rlCoachMdl.cpp | 11 +- ...CoachMdl.desktop => rlCoachMdl.desktop.in} | 2 +- demos/rlCollisionDemo/BodyDelegate.cpp | 103 + demos/rlCollisionDemo/BodyDelegate.h | 58 + demos/rlCollisionDemo/BodyModel.cpp | 240 + demos/rlCollisionDemo/BodyModel.h | 64 + demos/rlCollisionDemo/CMakeLists.txt | 109 +- demos/rlCollisionDemo/MainWindow.cpp | 332 +- demos/rlCollisionDemo/MainWindow.h | 40 +- .../rlCollisionDemo/SoGradientBackground.cpp | 109 + demos/rlCollisionDemo/SoGradientBackground.h | 59 + demos/rlCollisionDemo/TestWidget.cpp | 102 - demos/rlCollisionDemo/rlCollisionDemo.cpp | 27 +- ...emo.desktop => rlCollisionDemo.desktop.in} | 2 +- demos/rlDenavitHartenbergDemo/CMakeLists.txt | 4 +- .../rlDenavitHartenbergDemo.cpp | 22 +- demos/rlDynamics1Demo/CMakeLists.txt | 4 +- demos/rlDynamics1Demo/rlDynamics1Demo.cpp | 31 +- demos/rlDynamics2Demo/CMakeLists.txt | 4 +- demos/rlDynamics2Demo/rlDynamics2Demo.cpp | 27 +- demos/rlEulerAnglesDemo/CMakeLists.txt | 17 + .../rlEulerAnglesDemo.cpp} | 49 +- demos/rlFilterDemo/CMakeLists.txt | 29 + demos/rlFilterDemo/rlKalmanDemo.cpp | 89 + demos/rlFilterDemo/rlKalmanDemo2.cpp | 96 + demos/rlFilterDemo/rlLowPassDemo.cpp | 81 + demos/rlGripperDemo/CMakeLists.txt | 25 +- demos/rlGripperDemo/rlGripperDemo.cpp | 71 +- demos/rlInterpolatorDemo/CMakeLists.txt | 4 +- .../rlInterpolatorDemo/rlInterpolatorDemo.cpp | 256 +- demos/rlInversePositionDemo/CMakeLists.txt | 19 +- .../rlInversePositionDemo.cpp | 81 +- demos/rlJacobianDemo/CMakeLists.txt | 4 +- demos/rlJacobianDemo/rlJacobianDemo.cpp | 14 +- demos/rlKalmanDemo/CMakeLists.txt | 11 - demos/rlKalmanDemo/rlKalmanDemo.cpp | 106 - demos/rlLaserDemo/CMakeLists.txt | 4 +- demos/rlLaserDemo/rlLaserDemo.cpp | 16 +- demos/rlLoadXmlDemo/CMakeLists.txt | 4 +- demos/rlLoadXmlDemo/rlLoadXmlDemo.cpp | 34 +- demos/rlPcaDemo/CMakeLists.txt | 4 +- demos/rlPcaDemo/rlPcaDemo.cpp | 10 +- demos/rlPlanDemo/CMakeLists.txt | 132 +- demos/rlPlanDemo/ConfigurationDelegate.cpp | 21 +- demos/rlPlanDemo/ConfigurationDelegate.h | 14 +- demos/rlPlanDemo/ConfigurationModel.cpp | 23 +- demos/rlPlanDemo/ConfigurationModel.h | 8 +- demos/rlPlanDemo/ConfigurationSpaceModel.cpp | 245 + demos/rlPlanDemo/ConfigurationSpaceModel.h | 63 + demos/rlPlanDemo/ConfigurationSpaceScene.cpp | 123 +- demos/rlPlanDemo/ConfigurationSpaceScene.h | 27 +- demos/rlPlanDemo/ConfigurationSpaceThread.cpp | 39 +- demos/rlPlanDemo/ConfigurationSpaceThread.h | 18 +- demos/rlPlanDemo/GraphicsView.cpp | 54 + .../GraphicsView.h} | 33 +- demos/rlPlanDemo/MainWindow.cpp | 1759 ++- demos/rlPlanDemo/MainWindow.h | 107 +- demos/rlPlanDemo/PlannerModel.cpp | 138 +- demos/rlPlanDemo/PlannerModel.h | 8 +- demos/rlPlanDemo/SoGradientBackground.cpp | 109 + demos/rlPlanDemo/SoGradientBackground.h | 59 + demos/rlPlanDemo/Thread.cpp | 142 +- demos/rlPlanDemo/Thread.h | 14 +- demos/rlPlanDemo/Viewer.cpp | 178 +- demos/rlPlanDemo/Viewer.h | 28 +- demos/rlPlanDemo/rlPlanDemo.cpp | 18 +- ...PlanDemo.desktop => rlPlanDemo.desktop.in} | 2 +- demos/rlPolynomialRootsDemo/CMakeLists.txt | 17 + .../rlPolynomialRootsDemo.cpp | 60 + demos/rlPrmDemo/CMakeLists.txt | 14 +- demos/rlPrmDemo/rlPrmDemo.cpp | 32 +- demos/rlPumaDemo/CMakeLists.txt | 4 +- demos/rlPumaDemo/rlPumaDemo.cpp | 18 +- demos/rlQuaternionDemo/CMakeLists.txt | 4 +- demos/rlQuaternionDemo/rlQuaternionDemo.cpp | 334 +- demos/rlRangeSensorDemo/CMakeLists.txt | 4 +- demos/rlRangeSensorDemo/rlRangeSensorDemo.cpp | 9 +- demos/rlRodriguesDemo/CMakeLists.txt | 11 - demos/rlSimulator/CMakeLists.txt | 157 + demos/rlSimulator/ConfigurationDelegate.cpp | 158 + demos/rlSimulator/ConfigurationDelegate.h | 128 + demos/rlSimulator/ConfigurationModel.cpp | 419 + demos/rlSimulator/ConfigurationModel.h | 133 + demos/rlSimulator/MainWindow.cpp | 557 + demos/rlSimulator/MainWindow.h | 196 + demos/rlSimulator/OperationalDelegate.cpp | 100 + demos/rlSimulator/OperationalDelegate.h | 58 + demos/rlSimulator/OperationalModel.cpp | 254 + demos/rlSimulator/OperationalModel.h | 61 + demos/rlSimulator/Server.cpp | 48 + demos/rlSimulator/Server.h | 52 + demos/rlSimulator/SoGradientBackground.cpp | 109 + demos/rlSimulator/SoGradientBackground.h | 59 + demos/rlSimulator/Socket.cpp | 198 + demos/rlSimulator/Socket.h | 49 + demos/rlSimulator/rlSimulator.cpp | 60 + demos/rlSimulator/rlSimulator.desktop.in | 8 + .../CMakeLists.txt | 37 +- .../rlSixAxisForceTorqueSensorDemo.cpp | 125 +- demos/rlSocketDemo/CMakeLists.txt | 33 + demos/rlSocketDemo/rlSocketDemoClient.cpp | 85 + demos/rlSocketDemo/rlSocketDemoServer.cpp | 107 + demos/rlSpatialDemo/CMakeLists.txt | 4 +- demos/rlSpatialDemo/rlSpatialDemo.cpp | 2 +- demos/rlThreadsDemo/CMakeLists.txt | 23 +- demos/rlThreadsDemo/rlThreadsDemo.cpp | 55 +- demos/rlTimerDemo/CMakeLists.txt | 22 +- demos/rlTimerDemo/rlTimerDemo.cpp | 26 +- .../rlTrapezoidalVelocityDemo/CMakeLists.txt | 4 +- .../rlTrapezoidalVelocityDemo.cpp | 4 +- demos/rlViewDemo/CMakeLists.txt | 75 +- demos/rlViewDemo/rlViewDemo.cpp | 38 +- ...ViewDemo.desktop => rlViewDemo.desktop.in} | 2 +- doc/CMakeLists.txt | 13 + doc/Doxyfile.in | 2380 +++ doc/extra.css | 4 + doc/extra.js | 20 + doc/extra.sty | 3 + examples/CMakeLists.txt | 28 +- examples/rlkin/box-6d-300505.xml | 194 + examples/rlkin/rlkin.xsd | 133 +- examples/rlkin/rlkin2dot.xsl | 54 + examples/rlkin/unimation-puma560.xml | 2 +- examples/rlmdl/comau-smart5-nj4-220-27.xml | 350 + examples/rlmdl/planar2.param.xml | 124 + examples/rlmdl/rlmdl.xsd | 199 +- examples/rlmdl/rlmdl2dot.xsl | 54 + examples/rlmdl/unimation-puma560.xml | 6 + .../rlplan/mitsubishi-rv6sl_boxes_prm.xml | 95 - .../mitsubishi-rv6sl_boxes_rrtConCon.xml | 93 - examples/rlplan/rlplan.xsd | 486 +- examples/rlplan/staeubli-tx60l_wall_prm.xml | 93 - .../rlplan/staeubli-tx60l_wall_rrtConCon.xml | 91 - .../rlplan/unimation-puma560_boxes_prm.xml | 5 - .../unimation-puma560_boxes_rrtConCon.xml | 5 - examples/rlsg/box-6d-300505_maze.wrl | 51 + ...-tx60l_wall.xml => box-6d-300505_maze.xml} | 9 +- examples/rlsg/maze.wrl | 362 + .../rlsg/mitsubishi-rv6sl.convex/link0.wrl | 469 - .../rlsg/mitsubishi-rv6sl.convex/link1.wrl | 891 -- .../rlsg/mitsubishi-rv6sl.convex/link2.wrl | 739 - .../rlsg/mitsubishi-rv6sl.convex/link3.wrl | 829 - .../rlsg/mitsubishi-rv6sl.convex/link4.wrl | 1051 -- .../rlsg/mitsubishi-rv6sl.convex/link5.wrl | 789 - .../rlsg/mitsubishi-rv6sl.convex/link6.wrl | 463 - .../mitsubishi-rv6sl.wrl | 63 - examples/rlsg/mitsubishi-rv6sl/link0.wrl | 2806 ---- examples/rlsg/mitsubishi-rv6sl/link1.wrl | 1992 --- examples/rlsg/mitsubishi-rv6sl/link2.wrl | 3135 ---- examples/rlsg/mitsubishi-rv6sl/link3.wrl | 1829 --- examples/rlsg/mitsubishi-rv6sl/link4.wrl | 4063 ----- examples/rlsg/mitsubishi-rv6sl/link5.wrl | 1487 -- examples/rlsg/mitsubishi-rv6sl/link6.wrl | 835 - .../mitsubishi-rv6sl/mitsubishi-rv6sl.wrl | 63 - .../rlsg/mitsubishi-rv6sl_boxes.convex.wrl | 14 - .../rlsg/mitsubishi-rv6sl_boxes.convex.xml | 17 - examples/rlsg/mitsubishi-rv6sl_boxes.wrl | 14 - examples/rlsg/mitsubishi-rv6sl_boxes.xml | 17 - examples/rlsg/rlsg.xsd | 41 +- examples/rlsg/staeubli-tx60l.convex/link0.wrl | 489 - examples/rlsg/staeubli-tx60l.convex/link1.wrl | 1337 -- examples/rlsg/staeubli-tx60l.convex/link2.wrl | 1017 -- examples/rlsg/staeubli-tx60l.convex/link3.wrl | 913 -- examples/rlsg/staeubli-tx60l.convex/link4.wrl | 701 - examples/rlsg/staeubli-tx60l.convex/link5.wrl | 257 - examples/rlsg/staeubli-tx60l.convex/link6.wrl | 161 - .../staeubli-tx60l.convex/staeubli-tx60l.wrl | 63 - examples/rlsg/staeubli-tx60l/link0.wrl | 3328 ---- examples/rlsg/staeubli-tx60l/link1.wrl | 3726 ----- examples/rlsg/staeubli-tx60l/link2.wrl | 1821 --- examples/rlsg/staeubli-tx60l/link3.wrl | 3114 ---- examples/rlsg/staeubli-tx60l/link4.wrl | 12773 ---------------- examples/rlsg/staeubli-tx60l/link5.wrl | 558 - examples/rlsg/staeubli-tx60l/link6.wrl | 635 - .../rlsg/staeubli-tx60l/staeubli-tx60l.wrl | 63 - examples/rlsg/staeubli-tx60l_wall.convex.wrl | 15 - examples/rlsg/staeubli-tx60l_wall.convex.xml | 17 - examples/rlsg/staeubli-tx60l_wall.wrl | 15 - examples/rlsg/unimation-puma560.convex.wrl | 11 - .../unimation-puma560.xml | 2 +- examples/rlsg/unimation-puma560.wrl | 11 - .../unimation-puma560/unimation-puma560.wrl | 110 +- .../unimation-puma560.xml} | 4 +- .../rlsg/unimation-puma560_boxes.convex.wrl | 8 +- examples/rlsg/unimation-puma560_boxes.wrl | 8 +- examples/rlsg/wall.wrl | 733 - examples/unimation-puma560.mdl.sg.xml | 9 + examples/vrml.lang | 127 + extras/3rdpartylicenses/LICENSE.BSL.txt | 23 - extras/3rdpartylicenses/LICENSE.FREE_USE.txt | 22 - extras/3rdpartylicenses/LICENSE.GPL.txt | 674 - extras/3rdpartylicenses/LICENSE.LGPL.txt | 165 - extras/3rdpartylicenses/LICENSE_QPL.txt | 110 - extras/3rdpartylicenses/all_sources.txt | 31 - extras/3rdpartylicenses/boost.txt | 23 - extras/3rdpartylicenses/bullet.txt | 19 - extras/3rdpartylicenses/cgal.txt | 42 - extras/3rdpartylicenses/coin.txt | 339 - extras/3rdpartylicenses/eigen.txt | 373 - extras/3rdpartylicenses/ode.txt | 502 - extras/3rdpartylicenses/pqp.txt | 33 - extras/3rdpartylicenses/qt.txt | 377 - extras/3rdpartylicenses/simage.txt | 8 - extras/3rdpartylicenses/solid.txt | 62 - extras/3rdpartylicenses/soqt.txt | 11 - extras/3rdpartylicenses/xml2.txt | 27 - extras/3rdpartylicenses/zlib.txt | 115 - extras/CMakeLists.txt | 12 + extras/byu2wrl/CMakeLists.txt | 27 + extras/byu2wrl/byu2wrl.cpp | 111 + extras/csv2wrl/CMakeLists.txt | 29 + extras/csv2wrl/csv2wrl.cpp | 80 + extras/debian/README.txt | 35 - extras/debian/changelog | 29 - extras/debian/control | 58 - extras/debian/copyright | 58 - extras/debian/librl-dev.install | 4 - extras/debian/librl.install | 3 - extras/debian/rules | 18 - extras/tris2wrl/CMakeLists.txt | 27 + extras/tris2wrl/tris2wrl.cpp | 159 + extras/w32installer/CMakeLists.txt | 386 - extras/w32installer/README.txt | 48 - extras/wrlview/CMakeLists.txt | 76 +- extras/wrlview/MainWindow.cpp | 322 +- extras/wrlview/MainWindow.h | 46 +- extras/wrlview/SoGradientBackground.cpp | 109 + extras/wrlview/SoGradientBackground.h | 59 + extras/wrlview/wrlview.cpp | 26 +- rl-config.cmake.in | 26 +- robotics-library.ico | Bin 10620 -> 13870 bytes robotics-library.svg | 12 +- src/CMakeLists.txt | 41 + src/rl/hal/{TcpSocket.cpp => AnalogInput.cpp} | 20 +- src/rl/hal/AnalogInput.h | 59 + src/rl/hal/AnalogInputReader.cpp | 55 + src/rl/hal/AnalogInputReader.h | 58 + src/rl/hal/AnalogInputWriter.cpp | 51 + src/rl/hal/AnalogInputWriter.h | 58 + ...ubishiH7Exception.cpp => AnalogOutput.cpp} | 15 +- src/rl/hal/AnalogOutput.h | 59 + src/rl/hal/AnalogOutputReader.cpp | 55 + src/rl/hal/AnalogOutputReader.h | 58 + src/rl/hal/AnalogOutputWriter.cpp | 51 + src/rl/hal/AnalogOutputWriter.h | 58 + src/rl/hal/Ati.cpp | 54 +- src/rl/hal/Ati.h | 30 +- src/rl/hal/AxisController.cpp | 11 +- src/rl/hal/AxisController.h | 14 +- src/rl/hal/CMakeLists.txt | 261 +- src/rl/hal/Camera.h | 6 +- src/rl/hal/CartesianForceSensor.cpp | 42 + src/rl/hal/CartesianForceSensor.h | 55 + src/rl/hal/CartesianPositionActuator.cpp | 4 +- src/rl/hal/CartesianPositionActuator.h | 8 +- src/rl/hal/CartesianPositionSensor.cpp | 4 +- src/rl/hal/CartesianPositionSensor.h | 10 +- src/rl/hal/CartesianVelocitySensor.cpp | 42 + src/rl/hal/CartesianVelocitySensor.h | 55 + src/rl/hal/Coach.cpp | 100 +- src/rl/hal/Coach.h | 34 +- src/rl/hal/Com.h | 6 +- src/rl/hal/ComException.cpp | 5 + src/rl/hal/ComException.h | 8 +- src/rl/hal/Comedi.cpp | 14 +- src/rl/hal/Comedi.h | 10 +- .../hal/{UdpSocket.cpp => CyclicDevice.cpp} | 21 +- src/rl/hal/CyclicDevice.h | 60 + src/rl/hal/Dc1394Camera.cpp | 644 +- src/rl/hal/Dc1394Camera.h | 60 +- src/rl/hal/Device.h | 14 +- src/rl/hal/DeviceException.cpp | 5 + src/rl/hal/DeviceException.h | 8 +- src/rl/hal/DigitalInput.cpp | 42 + src/rl/hal/{TcpSocket.h => DigitalInput.h} | 16 +- src/rl/hal/DigitalInputReader.cpp | 42 + src/rl/hal/DigitalInputReader.h | 57 + src/rl/hal/DigitalInputWriter.cpp | 63 + .../DigitalInputWriter.h} | 40 +- src/rl/hal/DigitalOutput.cpp | 42 + src/rl/hal/{UdpSocket.h => DigitalOutput.h} | 16 +- src/rl/hal/DigitalOutputReader.cpp | 42 + src/rl/hal/DigitalOutputReader.h | 57 + src/rl/hal/DigitalOutputWriter.cpp | 63 + src/rl/hal/DigitalOutputWriter.h | 59 + src/rl/hal/Endian.cpp | 473 + src/rl/hal/Endian.h | 282 + src/rl/hal/Exception.cpp | 27 + src/rl/hal/Exception.h | 11 +- src/rl/hal/Fieldbus.cpp | 42 + src/rl/hal/Fieldbus.h | 57 + src/rl/hal/ForceSensor.h | 10 +- src/rl/hal/Gnuplot.cpp | 36 +- src/rl/hal/Gnuplot.h | 13 +- src/rl/hal/Gripper.h | 6 +- src/rl/hal/HilscherCifx.cpp | 206 + src/rl/hal/HilscherCifx.h | 90 + src/rl/hal/JointAccelerationActuator.cpp | 42 + src/rl/hal/JointAccelerationActuator.h | 55 + src/rl/hal/JointCurrentSensor.cpp | 42 + ...ishiH7Exception.h => JointCurrentSensor.h} | 20 +- src/rl/hal/JointPositionActuator.cpp | 4 +- src/rl/hal/JointPositionActuator.h | 8 +- src/rl/hal/JointPositionSensor.cpp | 4 +- src/rl/hal/JointPositionSensor.h | 10 +- src/rl/hal/JointTorqueActuator.cpp | 4 +- src/rl/hal/JointTorqueActuator.h | 8 +- src/rl/hal/JointTorqueSensor.cpp | 4 +- src/rl/hal/JointTorqueSensor.h | 10 +- src/rl/hal/JointVelocityActuator.cpp | 4 +- src/rl/hal/JointVelocityActuator.h | 8 +- src/rl/hal/JointVelocitySensor.cpp | 4 +- src/rl/hal/JointVelocitySensor.h | 10 +- src/rl/hal/Jr3.cpp | 51 +- src/rl/hal/Jr3.h | 25 +- src/rl/hal/LeuzeRs4.cpp | 275 +- src/rl/hal/LeuzeRs4.h | 43 +- src/rl/hal/Lidar.h | 8 +- src/rl/hal/MitsubishiH7.cpp | 1147 +- src/rl/hal/MitsubishiH7.h | 532 +- src/rl/hal/MitsubishiR3.cpp | 991 ++ src/rl/hal/MitsubishiR3.h | 430 + src/rl/hal/RangeSensor.h | 12 +- src/rl/hal/SchmersalLss300.cpp | 159 +- src/rl/hal/SchmersalLss300.h | 37 +- src/rl/hal/SchunkFpsF5.cpp | 118 +- src/rl/hal/SchunkFpsF5.h | 33 +- src/rl/hal/Serial.cpp | 260 +- src/rl/hal/Serial.h | 37 +- src/rl/hal/SickLms200.cpp | 312 +- src/rl/hal/SickLms200.h | 37 +- src/rl/hal/SickS300.cpp | 53 +- src/rl/hal/SickS300.h | 24 +- src/rl/hal/SixAxisForceTorqueSensor.h | 10 +- src/rl/hal/Socket.cpp | 741 +- src/rl/hal/Socket.h | 131 +- src/rl/hal/TimeoutException.h | 6 +- src/rl/hal/TorqueSensor.h | 10 +- src/rl/hal/UniversalRobotsDashboard.cpp | 589 + src/rl/hal/UniversalRobotsDashboard.h | 141 + src/rl/hal/UniversalRobotsRealtime.cpp | 378 + src/rl/hal/UniversalRobotsRealtime.h | 202 + src/rl/hal/UniversalRobotsRtde.cpp | 1247 ++ src/rl/hal/UniversalRobotsRtde.h | 443 + src/rl/hal/WeissException.cpp | 153 + src/rl/hal/WeissException.h | 90 + src/rl/hal/WeissKms40.cpp | 525 + src/rl/hal/WeissKms40.h | 176 + src/rl/hal/WeissWsg50.cpp | 527 +- src/rl/hal/WeissWsg50.h | 174 +- src/rl/hal/endian.cpp | 201 - src/rl/hal/endian.h | 118 - src/rl/hal/types.h | 43 - src/rl/kin/CMakeLists.txt | 84 +- src/rl/kin/Element.h | 6 +- src/rl/kin/Exception.h | 6 +- src/rl/kin/Frame.h | 6 +- src/rl/kin/Joint.h | 13 +- src/rl/kin/Kinematics.cpp | 252 +- src/rl/kin/Kinematics.h | 146 +- src/rl/kin/Link.h | 13 +- src/rl/kin/Prismatic.cpp | 5 +- src/rl/kin/Prismatic.h | 6 +- src/rl/kin/Puma.cpp | 36 +- src/rl/kin/Puma.h | 14 +- src/rl/kin/Revolute.cpp | 5 +- src/rl/kin/Revolute.h | 6 +- src/rl/kin/Rhino.cpp | 14 +- src/rl/kin/Rhino.h | 14 +- src/rl/kin/Transform.cpp | 4 +- src/rl/kin/Transform.h | 6 +- src/rl/mainpage.dox | 68 + src/rl/math/Array.h | 48 + src/rl/math/CMakeLists.txt | 121 +- .../{util/MutexLocker.h => math/Circular.h} | 30 +- src/rl/math/CircularVector2.h | 207 + src/rl/math/CircularVector3.h | 214 + src/rl/math/Function.h | 114 + src/rl/math/GnatNearestNeighbors.h | 706 + src/rl/math/Kalman.h | 283 +- .../math/KdtreeBoundingBoxNearestNeighbors.h | 709 + src/rl/math/KdtreeNearestNeighbors.h | 579 + src/rl/math/LinearNearestNeighbors.h | 301 + src/rl/math/{Cubic.h => LowPass.h} | 74 +- src/rl/math/Matrix.h | 41 +- src/rl/math/MatrixBaseAddons.h | 70 +- .../NestedFunction.h} | 76 +- src/rl/math/Pid.h | 34 +- src/rl/math/Polynomial.h | 665 + src/rl/math/PolynomialQuaternion.h | 290 + src/rl/math/Quaternion.h | 9 +- src/rl/math/QuaternionBaseAddons.h | 218 +- src/rl/math/Quintic.h | 126 - src/rl/math/Real.h | 35 +- src/rl/math/Rotation.h | 8 +- src/rl/math/Spatial.h | 37 +- src/rl/math/Spline.h | 928 ++ src/rl/math/SplineQuaternion.h | 387 + src/rl/math/Transform.h | 219 +- src/rl/math/TransformAddons.h | 215 + src/rl/math/TrapezoidalVelocity.h | 8 +- src/rl/math/TypeTraits.h | 178 + src/rl/math/Unit.h | 10 +- src/rl/math/Vector.h | 41 +- src/rl/math/metrics/L2.h | 136 + src/rl/math/metrics/L2Squared.h | 140 + .../{ => spatial}/ArticulatedBodyInertia.h | 65 +- .../{ => spatial}/ArticulatedBodyInertia.hxx | 26 +- src/rl/math/{ => spatial}/ForceVector.h | 51 +- src/rl/math/{ => spatial}/ForceVector.hxx | 12 +- src/rl/math/{ => spatial}/MotionVector.h | 51 +- src/rl/math/{ => spatial}/MotionVector.hxx | 22 +- src/rl/math/{ => spatial}/PlueckerTransform.h | 99 +- .../math/{ => spatial}/PlueckerTransform.hxx | 90 +- src/rl/math/{ => spatial}/RigidBodyInertia.h | 57 +- .../math/{ => spatial}/RigidBodyInertia.hxx | 16 +- src/rl/mdl/Body.cpp | 20 +- src/rl/mdl/Body.h | 14 +- src/rl/mdl/CMakeLists.txt | 111 +- src/rl/mdl/Compound.cpp | 12 +- src/rl/mdl/Compound.h | 16 +- src/rl/mdl/Cylindrical.cpp | 4 +- src/rl/mdl/Cylindrical.h | 8 +- src/rl/mdl/Dynamic.cpp | 75 +- src/rl/mdl/Dynamic.h | 258 +- src/rl/mdl/Element.cpp | 2 +- src/rl/mdl/Element.h | 6 +- src/rl/mdl/Exception.h | 6 +- src/rl/mdl/Factory.h | 6 +- src/rl/mdl/Fixed.h | 6 +- src/rl/mdl/Frame.h | 6 +- src/rl/mdl/Helical.cpp | 6 +- src/rl/mdl/Helical.h | 6 +- src/rl/mdl/InverseKinematics.cpp | 17 + src/rl/mdl/InverseKinematics.h | 33 + src/rl/mdl/JacobianInverseKinematics.cpp | 104 + src/rl/mdl/JacobianInverseKinematics.h | 45 + src/rl/mdl/Joint.cpp | 49 +- src/rl/mdl/Joint.h | 34 +- src/rl/mdl/Kinematic.cpp | 89 +- src/rl/mdl/Kinematic.h | 190 +- src/rl/mdl/Metric.cpp | 29 + src/rl/mdl/Metric.h | 10 +- src/rl/mdl/Model.cpp | 228 +- src/rl/mdl/Model.h | 106 +- src/rl/mdl/NloptInverseKinematics.cpp | 152 + src/rl/mdl/NloptInverseKinematics.h | 50 + src/rl/mdl/Prismatic.cpp | 2 +- src/rl/mdl/Prismatic.h | 6 +- src/rl/mdl/Revolute.cpp | 17 +- src/rl/mdl/Revolute.h | 8 +- src/rl/mdl/Spherical.cpp | 44 + src/rl/mdl/Spherical.h | 18 +- src/rl/mdl/Transform.cpp | 4 +- src/rl/mdl/Transform.h | 6 +- src/rl/mdl/UrdfFactory.cpp | 361 + src/rl/mdl/UrdfFactory.h | 53 + src/rl/mdl/World.h | 6 +- src/rl/mdl/XmlFactory.cpp | 322 +- src/rl/mdl/XmlFactory.h | 6 +- src/rl/plan/AddRrtConCon.cpp | 74 +- src/rl/plan/AddRrtConCon.h | 24 +- src/rl/plan/AdvancedOptimizer.cpp | 6 +- src/rl/plan/AdvancedOptimizer.h | 6 +- src/rl/plan/BridgeSampler.cpp | 16 +- src/rl/plan/BridgeSampler.h | 20 +- src/rl/plan/CMakeLists.txt | 127 +- src/rl/plan/DistanceModel.cpp | 14 +- src/rl/plan/DistanceModel.h | 6 +- src/rl/plan/Eet.cpp | 251 +- src/rl/plan/Eet.h | 97 +- src/rl/plan/Exception.h | 6 +- src/rl/plan/GaussianSampler.cpp | 40 +- src/rl/plan/GaussianSampler.h | 28 +- src/rl/plan/GnatNearestNeighbors.cpp | 140 + src/rl/plan/GnatNearestNeighbors.h | 87 + .../KdtreeBoundingBoxNearestNeighbors.cpp | 98 + .../plan/KdtreeBoundingBoxNearestNeighbors.h | 73 + src/rl/plan/KdtreeNearestNeighbors.cpp | 98 + src/rl/plan/KdtreeNearestNeighbors.h | 73 + src/rl/plan/LinearNearestNeighbors.cpp | 74 + src/rl/plan/LinearNearestNeighbors.h | 65 + src/rl/plan/MatrixPtr.h | 10 +- src/rl/plan/Metric.cpp | 93 + src/rl/plan/Metric.h | 83 + src/rl/plan/Model.cpp | 156 +- src/rl/plan/Model.h | 20 +- src/rl/plan/NearestNeighbors.cpp | 48 + .../NearestNeighbors.h} | 57 +- src/rl/plan/Optimizer.cpp | 6 +- src/rl/plan/Optimizer.h | 6 +- src/rl/plan/Orthogonal_k_neighbor_search.h | 145 - src/rl/plan/Planner.cpp | 12 +- src/rl/plan/Planner.h | 21 +- src/rl/plan/Prm.cpp | 276 +- src/rl/plan/Prm.h | 108 +- src/rl/plan/PrmUtilityGuided.cpp | 40 +- src/rl/plan/PrmUtilityGuided.h | 40 +- src/rl/plan/RealList.h | 8 +- src/rl/plan/RecursiveVerifier.cpp | 6 +- src/rl/plan/RecursiveVerifier.h | 10 +- src/rl/plan/Rrt.cpp | 292 +- src/rl/plan/Rrt.h | 104 +- src/rl/plan/RrtCon.cpp | 21 +- src/rl/plan/RrtCon.h | 16 +- src/rl/plan/RrtConCon.cpp | 35 +- src/rl/plan/RrtConCon.h | 16 +- src/rl/plan/RrtDual.cpp | 42 +- src/rl/plan/RrtDual.h | 8 +- src/rl/plan/RrtExtCon.cpp | 35 +- src/rl/plan/RrtExtCon.h | 6 +- src/rl/plan/RrtExtExt.cpp | 35 +- src/rl/plan/RrtExtExt.h | 6 +- src/rl/plan/RrtGoalBias.cpp | 26 +- src/rl/plan/RrtGoalBias.h | 20 +- src/rl/plan/Sampler.cpp | 12 +- src/rl/plan/Sampler.h | 10 +- src/rl/plan/SequentialVerifier.cpp | 6 +- src/rl/plan/SequentialVerifier.h | 6 +- src/rl/plan/SimpleModel.cpp | 4 +- src/rl/plan/SimpleModel.h | 6 +- src/rl/plan/SimpleOptimizer.cpp | 2 +- src/rl/plan/SimpleOptimizer.h | 6 +- src/rl/plan/TransformPtr.h | 10 +- src/rl/plan/UniformSampler.cpp | 33 +- src/rl/plan/UniformSampler.h | 23 +- src/rl/plan/Vector3List.h | 8 +- src/rl/plan/Vector3Ptr.h | 10 +- src/rl/plan/VectorList.h | 8 +- src/rl/plan/VectorPtr.h | 10 +- src/rl/plan/Verifier.cpp | 2 +- src/rl/plan/Verifier.h | 6 +- src/rl/plan/Viewer.h | 8 +- src/rl/plan/WorkspaceMetric.cpp | 69 + src/rl/plan/WorkspaceMetric.h | 71 + src/rl/plan/WorkspaceSphere.cpp | 8 - src/rl/plan/WorkspaceSphere.h | 27 +- src/rl/plan/WorkspaceSphereExplorer.cpp | 61 +- src/rl/plan/WorkspaceSphereExplorer.h | 38 +- src/rl/plan/WorkspaceSphereList.h | 8 +- src/rl/plan/WorkspaceSphereVector.h | 6 +- src/rl/sg/Body.cpp | 4 +- src/rl/sg/Body.h | 18 +- src/rl/sg/CMakeLists.txt | 227 +- src/rl/sg/DepthScene.cpp | 64 + src/rl/sg/DepthScene.h | 13 +- src/rl/sg/DistanceScene.cpp | 10 +- src/rl/sg/DistanceScene.h | 6 +- src/rl/sg/Exception.h | 6 +- src/rl/sg/Model.h | 10 +- src/rl/sg/RaycastScene.h | 6 +- src/rl/sg/Scene.cpp | 113 +- src/rl/sg/Scene.h | 15 +- src/rl/sg/Shape.cpp | 2 +- src/rl/sg/Shape.h | 8 +- src/rl/sg/SimpleScene.h | 6 +- src/rl/sg/bullet/Body.cpp | 18 +- src/rl/sg/bullet/Body.h | 12 +- src/rl/sg/bullet/Model.h | 6 +- src/rl/sg/bullet/Scene.cpp | 175 +- src/rl/sg/bullet/Scene.h | 50 +- src/rl/sg/bullet/Shape.cpp | 85 +- src/rl/sg/bullet/Shape.h | 20 +- src/rl/sg/fcl/Body.cpp | 111 + src/rl/sg/fcl/Body.h | 74 + src/rl/sg/fcl/Model.cpp | 108 + src/rl/sg/fcl/Model.h | 70 + src/rl/sg/fcl/Scene.cpp | 347 + src/rl/sg/fcl/Scene.h | 137 + src/rl/sg/fcl/Shape.cpp | 252 + src/rl/sg/fcl/Shape.h | 88 + src/rl/sg/ode/Body.cpp | 28 +- src/rl/sg/ode/Body.h | 12 +- src/rl/sg/ode/Model.cpp | 4 +- src/rl/sg/ode/Model.h | 8 +- src/rl/sg/ode/Scene.cpp | 194 +- src/rl/sg/ode/Scene.h | 32 +- src/rl/sg/ode/Shape.cpp | 165 +- src/rl/sg/ode/Shape.h | 25 +- src/rl/sg/pqp/Body.cpp | 4 +- src/rl/sg/pqp/Body.h | 8 +- src/rl/sg/pqp/Model.h | 6 +- src/rl/sg/pqp/Scene.cpp | 32 +- src/rl/sg/pqp/Scene.h | 11 +- src/rl/sg/pqp/Shape.cpp | 22 +- src/rl/sg/pqp/Shape.h | 14 +- src/rl/sg/so/Body.cpp | 22 +- src/rl/sg/so/Body.h | 10 +- src/rl/sg/so/Model.cpp | 6 +- src/rl/sg/so/Model.h | 8 +- src/rl/sg/so/Scene.cpp | 6 +- src/rl/sg/so/Scene.h | 11 +- src/rl/sg/so/Shape.cpp | 16 +- src/rl/sg/so/Shape.h | 12 +- src/rl/sg/solid/Body.cpp | 4 +- src/rl/sg/solid/Body.h | 6 +- src/rl/sg/solid/Model.cpp | 2 +- src/rl/sg/solid/Model.h | 6 +- src/rl/sg/solid/Scene.cpp | 74 +- src/rl/sg/solid/Scene.h | 13 +- src/rl/sg/solid/Shape.cpp | 53 +- src/rl/sg/solid/Shape.h | 15 +- src/rl/std/CMakeLists.txt | 17 + src/rl/std/chrono | 53 + src/rl/std/condition_variable | 50 + src/rl/std/future | 62 + src/rl/std/iterator | 68 + src/rl/std/mutex | 76 + src/rl/std/random | 61 + src/rl/std/regex | 73 + src/rl/std/string | 69 + src/rl/std/thread | 52 + src/rl/util/CMakeLists.txt | 120 +- src/rl/util/Semaphore.h | 117 - src/rl/util/Thread.h | 142 - src/rl/util/Timer.h | 139 - src/rl/util/process.h | 127 + src/rl/util/rtai/chrono.h | 103 + src/rl/util/rtai/thread.h | 498 + src/rl/util/{Mutex.h => thread.h} | 86 +- src/rl/util/xenomai/chrono.h | 103 + src/rl/util/xenomai/condition_variable.h | 317 + src/rl/util/xenomai/mutex.h | 285 + src/rl/util/xenomai/thread.h | 503 + src/rl/xml/Attribute.h | 118 +- src/rl/xml/CMakeLists.txt | 100 +- src/rl/xml/Document.h | 101 +- src/rl/xml/DomParser.h | 36 +- src/rl/xml/Exception.h | 8 +- src/rl/xml/Namespace.h | 40 +- src/rl/xml/Node.h | 274 +- src/rl/xml/NodeSet.h | 105 + src/rl/xml/Object.h | 250 +- src/rl/xml/Path.h | 70 +- src/rl/xml/Schema.h | 36 +- src/rl/xml/Stylesheet.h | 190 + tests/CMakeLists.txt | 30 + tests/rlCircularTest/CMakeLists.txt | 14 + tests/rlCircularTest/rlCircularTest.cpp | 137 + tests/rlCollisionTest/CMakeLists.txt | 51 + tests/rlCollisionTest/rlCollisionTest.cpp | 209 + .../rlCollisionTest/rlSceneCollisionTest.cpp | 106 + tests/rlCollisionTest/twotori.wrl | 42 + tests/rlCollisionTest/twotori.xml | 11 + tests/rlDynamicsTest/CMakeLists.txt | 18 +- tests/rlDynamicsTest/rlDynamicsTest.cpp | 61 +- tests/rlEetTest/CMakeLists.txt | 79 + tests/rlEetTest/rlEetTest.cpp | 207 + tests/rlHalEndianTest/CMakeLists.txt | 4 +- tests/rlHalEndianTest/rlHalEndianTest.cpp | 245 +- .../rlInverseKinematicsKinTest/CMakeLists.txt | 27 + .../rlInverseKinematicsKinTest.cpp} | 40 +- .../rlInverseKinematicsMdlTest/CMakeLists.txt | 27 + .../rlInverseKinematicsMdlTest.cpp | 145 + tests/rlInverseKinematicsTest/CMakeLists.txt | 37 - tests/rlJacobianKinTest/CMakeLists.txt | 21 + tests/rlJacobianKinTest/rlJacobianKinTest.cpp | 90 + tests/rlJacobianMdlTest/CMakeLists.txt | 21 + tests/rlJacobianMdlTest/rlJacobianMdlTest.cpp | 96 + tests/rlMathDeltaTest/CMakeLists.txt | 14 + tests/rlMathDeltaTest/rlMathDeltaTest.cpp | 102 + tests/rlNearestNeighborsTest/CMakeLists.txt | 34 + tests/rlNearestNeighborsTest/iterator.h | 108 + .../rlNearestNeighborsTest.cpp | 209 + tests/rlPrmTest/CMakeLists.txt | 96 +- tests/rlPrmTest/rlPrmTest.cpp | 117 +- tests/rlSplineTest/CMakeLists.txt | 120 + .../rlSplineTest/rlPolynomialExtremaTest.cpp | 64 + tests/rlSplineTest/rlPolynomialTest.cpp | 125 + .../rlQuarticLinearQuarticTest.cpp | 154 + .../rlSplineTest/rlSexticLinearSexticTest.cpp | 158 + tests/rlSplineTest/rlSplineScaleTest.cpp | 76 + tests/rlSplineTest/rlSplineTest.cpp | 124 + .../rlSplineTest/rlSplineTranslationTest.cpp | 102 + .../rlTrapezoidalAccelerationTest.cpp | 174 + 797 files changed, 52567 insertions(+), 72634 deletions(-) delete mode 100644 .gitignore create mode 100644 3rdparty/CMakeLists.txt create mode 100644 3rdparty/atidaq/CMakeLists.txt create mode 100644 3rdparty/atidaq/CMakeLists.txt.in create mode 100644 3rdparty/atidaq/atidaq-config.cmake.in create mode 100644 3rdparty/atidaq/atidaq.patch create mode 100644 3rdparty/boost/CMakeLists.txt create mode 100644 3rdparty/bullet/CMakeLists.txt create mode 100644 3rdparty/coin/CMakeLists.txt create mode 100644 3rdparty/eigen/CMakeLists.txt create mode 100644 3rdparty/libiconv/CMakeLists.txt create mode 100644 3rdparty/libiconv/CMakeLists.txt.in create mode 100644 3rdparty/libiconv/config.h.cmake.in create mode 100644 3rdparty/libiconv/libiconv-1.15.patch create mode 100644 3rdparty/libiconv/libiconv-config.cmake.in create mode 100644 3rdparty/libxml2/CMakeLists.txt create mode 100644 3rdparty/libxslt/CMakeLists.txt create mode 100644 3rdparty/nlopt/CMakeLists.txt create mode 100644 3rdparty/ode/CMakeLists.txt create mode 100644 3rdparty/patch.exe.manifest create mode 100644 3rdparty/pqp/CMakeLists.txt create mode 100644 3rdparty/simage/CMakeLists.txt create mode 100644 3rdparty/solid/CMakeLists.txt create mode 100644 3rdparty/soqt/CMakeLists.txt create mode 100644 3rdparty/zlib/CMakeLists.txt delete mode 100644 Doxyfile.in delete mode 100644 LICENSE.GPL delete mode 100644 Modules/FindAtidaq.cmake delete mode 100644 Modules/FindBullet.cmake delete mode 100644 Modules/FindCgal.cmake delete mode 100644 Modules/FindCoin.cmake delete mode 100644 Modules/FindComedi.cmake delete mode 100644 Modules/FindEigen.cmake delete mode 100644 Modules/FindIconv.cmake delete mode 100644 Modules/FindLibXml2.cmake delete mode 100644 Modules/FindLibdc1394.cmake delete mode 100644 Modules/FindOde.cmake delete mode 100644 Modules/FindPqp.cmake delete mode 100644 Modules/FindSoQt.cmake delete mode 100644 Modules/FindSolid.cmake delete mode 100644 Modules/FindZLIB.cmake create mode 100644 cmake/CPackConfig.cmake create mode 100644 cmake/CPackProjectConfig.cmake create mode 100644 cmake/FindATIDAQ.cmake create mode 100644 cmake/FindBullet.cmake create mode 100644 cmake/FindCoin.cmake create mode 100644 cmake/FindComedi.cmake create mode 100644 cmake/FindEigen3.cmake create mode 100644 cmake/FindFCL.cmake create mode 100644 cmake/FindNLopt.cmake create mode 100644 cmake/FindODE.cmake create mode 100644 cmake/FindPQP.cmake create mode 100644 cmake/FindRTAI.cmake create mode 100644 cmake/FindSOLID3.cmake create mode 100644 cmake/FindSoQt.cmake create mode 100644 cmake/FindXenomai.cmake create mode 100644 cmake/Findccd.cmake create mode 100644 cmake/FindcifX.cmake create mode 100644 cmake/Findlibdc1394.cmake create mode 100644 cmake/Findlibiconv.cmake create mode 100644 cmake/Findlibxml2.cmake create mode 100644 cmake/Findlibxslt.cmake create mode 100644 cmake/Findzlib.cmake create mode 100644 cmake/Qt4AutomocMocOptionsBoost.cmake create mode 100644 cmake/WixExtra.wxs.in create mode 100644 cmake/WixPatch.xml.in create mode 100644 cmake/WixUIBanner.bmp create mode 100644 cmake/WixUIDialog.bmp create mode 100644 cmake/WixUI_FeatureTreeNoLicense.wxs create mode 100644 debian/changelog rename {extras/debian => debian}/compat (100%) create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/librl-demos.install create mode 100644 debian/librl-dev.install create mode 100644 debian/librl-doc.install create mode 100644 debian/librl-examples.install create mode 100644 debian/librl-extras.install create mode 100644 debian/librl.install create mode 100644 debian/rules create mode 100644 demos/CMakeLists.txt create mode 100644 demos/rlCoachKin/SoGradientBackground.cpp create mode 100644 demos/rlCoachKin/SoGradientBackground.h rename demos/rlCoachKin/{rlCoachKin.desktop => rlCoachKin.desktop.in} (57%) create mode 100644 demos/rlCoachMdl/SoGradientBackground.cpp create mode 100644 demos/rlCoachMdl/SoGradientBackground.h rename demos/rlCoachMdl/{rlCoachMdl.desktop => rlCoachMdl.desktop.in} (57%) create mode 100644 demos/rlCollisionDemo/BodyDelegate.cpp create mode 100644 demos/rlCollisionDemo/BodyDelegate.h create mode 100644 demos/rlCollisionDemo/BodyModel.cpp create mode 100644 demos/rlCollisionDemo/BodyModel.h create mode 100644 demos/rlCollisionDemo/SoGradientBackground.cpp create mode 100644 demos/rlCollisionDemo/SoGradientBackground.h delete mode 100644 demos/rlCollisionDemo/TestWidget.cpp rename demos/rlCollisionDemo/{rlCollisionDemo.desktop => rlCollisionDemo.desktop.in} (73%) create mode 100644 demos/rlEulerAnglesDemo/CMakeLists.txt rename demos/{rlRodriguesDemo/rlRodriguesDemo.cpp => rlEulerAnglesDemo/rlEulerAnglesDemo.cpp} (50%) create mode 100644 demos/rlFilterDemo/CMakeLists.txt create mode 100644 demos/rlFilterDemo/rlKalmanDemo.cpp create mode 100644 demos/rlFilterDemo/rlKalmanDemo2.cpp create mode 100644 demos/rlFilterDemo/rlLowPassDemo.cpp delete mode 100644 demos/rlKalmanDemo/CMakeLists.txt delete mode 100644 demos/rlKalmanDemo/rlKalmanDemo.cpp create mode 100644 demos/rlPlanDemo/ConfigurationSpaceModel.cpp create mode 100644 demos/rlPlanDemo/ConfigurationSpaceModel.h create mode 100644 demos/rlPlanDemo/GraphicsView.cpp rename demos/{rlCollisionDemo/TestWidget.h => rlPlanDemo/GraphicsView.h} (78%) create mode 100644 demos/rlPlanDemo/SoGradientBackground.cpp create mode 100644 demos/rlPlanDemo/SoGradientBackground.h rename demos/rlPlanDemo/{rlPlanDemo.desktop => rlPlanDemo.desktop.in} (67%) create mode 100644 demos/rlPolynomialRootsDemo/CMakeLists.txt create mode 100644 demos/rlPolynomialRootsDemo/rlPolynomialRootsDemo.cpp delete mode 100644 demos/rlRodriguesDemo/CMakeLists.txt create mode 100644 demos/rlSimulator/CMakeLists.txt create mode 100644 demos/rlSimulator/ConfigurationDelegate.cpp create mode 100644 demos/rlSimulator/ConfigurationDelegate.h create mode 100644 demos/rlSimulator/ConfigurationModel.cpp create mode 100644 demos/rlSimulator/ConfigurationModel.h create mode 100644 demos/rlSimulator/MainWindow.cpp create mode 100644 demos/rlSimulator/MainWindow.h create mode 100644 demos/rlSimulator/OperationalDelegate.cpp create mode 100644 demos/rlSimulator/OperationalDelegate.h create mode 100644 demos/rlSimulator/OperationalModel.cpp create mode 100644 demos/rlSimulator/OperationalModel.h create mode 100644 demos/rlSimulator/Server.cpp create mode 100644 demos/rlSimulator/Server.h create mode 100644 demos/rlSimulator/SoGradientBackground.cpp create mode 100644 demos/rlSimulator/SoGradientBackground.h create mode 100644 demos/rlSimulator/Socket.cpp create mode 100644 demos/rlSimulator/Socket.h create mode 100644 demos/rlSimulator/rlSimulator.cpp create mode 100644 demos/rlSimulator/rlSimulator.desktop.in create mode 100644 demos/rlSocketDemo/CMakeLists.txt create mode 100644 demos/rlSocketDemo/rlSocketDemoClient.cpp create mode 100644 demos/rlSocketDemo/rlSocketDemoServer.cpp rename demos/rlViewDemo/{rlViewDemo.desktop => rlViewDemo.desktop.in} (68%) create mode 100644 doc/CMakeLists.txt create mode 100644 doc/Doxyfile.in create mode 100644 doc/extra.css create mode 100644 doc/extra.js create mode 100644 doc/extra.sty create mode 100644 examples/rlkin/box-6d-300505.xml create mode 100644 examples/rlkin/rlkin2dot.xsl create mode 100644 examples/rlmdl/comau-smart5-nj4-220-27.xml create mode 100644 examples/rlmdl/planar2.param.xml create mode 100644 examples/rlmdl/rlmdl2dot.xsl delete mode 100644 examples/rlplan/mitsubishi-rv6sl_boxes_prm.xml delete mode 100644 examples/rlplan/mitsubishi-rv6sl_boxes_rrtConCon.xml delete mode 100644 examples/rlplan/staeubli-tx60l_wall_prm.xml delete mode 100644 examples/rlplan/staeubli-tx60l_wall_rrtConCon.xml create mode 100644 examples/rlsg/box-6d-300505_maze.wrl rename examples/rlsg/{staeubli-tx60l_wall.xml => box-6d-300505_maze.xml} (74%) create mode 100644 examples/rlsg/maze.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link0.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link1.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link2.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link3.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link4.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link5.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/link6.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl.convex/mitsubishi-rv6sl.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link0.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link1.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link2.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link3.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link4.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link5.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/link6.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl/mitsubishi-rv6sl.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl_boxes.convex.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl_boxes.convex.xml delete mode 100644 examples/rlsg/mitsubishi-rv6sl_boxes.wrl delete mode 100644 examples/rlsg/mitsubishi-rv6sl_boxes.xml delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link0.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link1.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link2.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link3.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link4.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link5.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/link6.wrl delete mode 100644 examples/rlsg/staeubli-tx60l.convex/staeubli-tx60l.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link0.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link1.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link2.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link3.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link4.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link5.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/link6.wrl delete mode 100644 examples/rlsg/staeubli-tx60l/staeubli-tx60l.wrl delete mode 100644 examples/rlsg/staeubli-tx60l_wall.convex.wrl delete mode 100644 examples/rlsg/staeubli-tx60l_wall.convex.xml delete mode 100644 examples/rlsg/staeubli-tx60l_wall.wrl delete mode 100644 examples/rlsg/unimation-puma560.convex.wrl rename examples/rlsg/{ => unimation-puma560.convex}/unimation-puma560.xml (91%) delete mode 100644 examples/rlsg/unimation-puma560.wrl rename examples/rlsg/{unimation-puma560.convex.xml => unimation-puma560/unimation-puma560.xml} (80%) delete mode 100644 examples/rlsg/wall.wrl create mode 100644 examples/unimation-puma560.mdl.sg.xml create mode 100644 examples/vrml.lang delete mode 100644 extras/3rdpartylicenses/LICENSE.BSL.txt delete mode 100644 extras/3rdpartylicenses/LICENSE.FREE_USE.txt delete mode 100644 extras/3rdpartylicenses/LICENSE.GPL.txt delete mode 100644 extras/3rdpartylicenses/LICENSE.LGPL.txt delete mode 100644 extras/3rdpartylicenses/LICENSE_QPL.txt delete mode 100644 extras/3rdpartylicenses/all_sources.txt delete mode 100644 extras/3rdpartylicenses/boost.txt delete mode 100644 extras/3rdpartylicenses/bullet.txt delete mode 100644 extras/3rdpartylicenses/cgal.txt delete mode 100644 extras/3rdpartylicenses/coin.txt delete mode 100644 extras/3rdpartylicenses/eigen.txt delete mode 100644 extras/3rdpartylicenses/ode.txt delete mode 100644 extras/3rdpartylicenses/pqp.txt delete mode 100644 extras/3rdpartylicenses/qt.txt delete mode 100644 extras/3rdpartylicenses/simage.txt delete mode 100644 extras/3rdpartylicenses/solid.txt delete mode 100644 extras/3rdpartylicenses/soqt.txt delete mode 100644 extras/3rdpartylicenses/xml2.txt delete mode 100644 extras/3rdpartylicenses/zlib.txt create mode 100644 extras/CMakeLists.txt create mode 100644 extras/byu2wrl/CMakeLists.txt create mode 100644 extras/byu2wrl/byu2wrl.cpp create mode 100644 extras/csv2wrl/CMakeLists.txt create mode 100644 extras/csv2wrl/csv2wrl.cpp delete mode 100644 extras/debian/README.txt delete mode 100644 extras/debian/changelog delete mode 100644 extras/debian/control delete mode 100644 extras/debian/copyright delete mode 100644 extras/debian/librl-dev.install delete mode 100644 extras/debian/librl.install delete mode 100644 extras/debian/rules create mode 100644 extras/tris2wrl/CMakeLists.txt create mode 100644 extras/tris2wrl/tris2wrl.cpp delete mode 100644 extras/w32installer/CMakeLists.txt delete mode 100644 extras/w32installer/README.txt create mode 100644 extras/wrlview/SoGradientBackground.cpp create mode 100644 extras/wrlview/SoGradientBackground.h create mode 100644 src/CMakeLists.txt rename src/rl/hal/{TcpSocket.cpp => AnalogInput.cpp} (81%) create mode 100644 src/rl/hal/AnalogInput.h create mode 100644 src/rl/hal/AnalogInputReader.cpp create mode 100644 src/rl/hal/AnalogInputReader.h create mode 100644 src/rl/hal/AnalogInputWriter.cpp create mode 100644 src/rl/hal/AnalogInputWriter.h rename src/rl/hal/{MitsubishiH7Exception.cpp => AnalogOutput.cpp} (81%) create mode 100644 src/rl/hal/AnalogOutput.h create mode 100644 src/rl/hal/AnalogOutputReader.cpp create mode 100644 src/rl/hal/AnalogOutputReader.h create mode 100644 src/rl/hal/AnalogOutputWriter.cpp create mode 100644 src/rl/hal/AnalogOutputWriter.h create mode 100644 src/rl/hal/CartesianForceSensor.cpp create mode 100644 src/rl/hal/CartesianForceSensor.h create mode 100644 src/rl/hal/CartesianVelocitySensor.cpp create mode 100644 src/rl/hal/CartesianVelocitySensor.h rename src/rl/hal/{UdpSocket.cpp => CyclicDevice.cpp} (82%) create mode 100644 src/rl/hal/CyclicDevice.h create mode 100644 src/rl/hal/DigitalInput.cpp rename src/rl/hal/{TcpSocket.h => DigitalInput.h} (84%) create mode 100644 src/rl/hal/DigitalInputReader.cpp create mode 100644 src/rl/hal/DigitalInputReader.h create mode 100644 src/rl/hal/DigitalInputWriter.cpp rename src/rl/{util/MutexTryLocker.h => hal/DigitalInputWriter.h} (71%) create mode 100644 src/rl/hal/DigitalOutput.cpp rename src/rl/hal/{UdpSocket.h => DigitalOutput.h} (84%) create mode 100644 src/rl/hal/DigitalOutputReader.cpp create mode 100644 src/rl/hal/DigitalOutputReader.h create mode 100644 src/rl/hal/DigitalOutputWriter.cpp create mode 100644 src/rl/hal/DigitalOutputWriter.h create mode 100644 src/rl/hal/Endian.cpp create mode 100644 src/rl/hal/Endian.h create mode 100644 src/rl/hal/Fieldbus.cpp create mode 100644 src/rl/hal/Fieldbus.h create mode 100644 src/rl/hal/HilscherCifx.cpp create mode 100644 src/rl/hal/HilscherCifx.h create mode 100644 src/rl/hal/JointAccelerationActuator.cpp create mode 100644 src/rl/hal/JointAccelerationActuator.h create mode 100644 src/rl/hal/JointCurrentSensor.cpp rename src/rl/hal/{MitsubishiH7Exception.h => JointCurrentSensor.h} (79%) create mode 100644 src/rl/hal/MitsubishiR3.cpp create mode 100644 src/rl/hal/MitsubishiR3.h create mode 100644 src/rl/hal/UniversalRobotsDashboard.cpp create mode 100644 src/rl/hal/UniversalRobotsDashboard.h create mode 100644 src/rl/hal/UniversalRobotsRealtime.cpp create mode 100644 src/rl/hal/UniversalRobotsRealtime.h create mode 100644 src/rl/hal/UniversalRobotsRtde.cpp create mode 100644 src/rl/hal/UniversalRobotsRtde.h create mode 100644 src/rl/hal/WeissException.cpp create mode 100644 src/rl/hal/WeissException.h create mode 100644 src/rl/hal/WeissKms40.cpp create mode 100644 src/rl/hal/WeissKms40.h delete mode 100644 src/rl/hal/endian.cpp delete mode 100644 src/rl/hal/endian.h delete mode 100644 src/rl/hal/types.h create mode 100644 src/rl/mainpage.dox create mode 100644 src/rl/math/Array.h rename src/rl/{util/MutexLocker.h => math/Circular.h} (81%) create mode 100644 src/rl/math/CircularVector2.h create mode 100644 src/rl/math/CircularVector3.h create mode 100644 src/rl/math/Function.h create mode 100644 src/rl/math/GnatNearestNeighbors.h create mode 100644 src/rl/math/KdtreeBoundingBoxNearestNeighbors.h create mode 100644 src/rl/math/KdtreeNearestNeighbors.h create mode 100644 src/rl/math/LinearNearestNeighbors.h rename src/rl/math/{Cubic.h => LowPass.h} (63%) rename src/rl/{hal/Dc1394CameraException.cpp => math/NestedFunction.h} (58%) create mode 100644 src/rl/math/Polynomial.h create mode 100644 src/rl/math/PolynomialQuaternion.h delete mode 100644 src/rl/math/Quintic.h create mode 100644 src/rl/math/Spline.h create mode 100644 src/rl/math/SplineQuaternion.h create mode 100644 src/rl/math/TransformAddons.h create mode 100644 src/rl/math/TypeTraits.h create mode 100644 src/rl/math/metrics/L2.h create mode 100644 src/rl/math/metrics/L2Squared.h rename src/rl/math/{ => spatial}/ArticulatedBodyInertia.h (70%) rename src/rl/math/{ => spatial}/ArticulatedBodyInertia.hxx (73%) rename src/rl/math/{ => spatial}/ForceVector.h (71%) rename src/rl/math/{ => spatial}/ForceVector.hxx (86%) rename src/rl/math/{ => spatial}/MotionVector.h (73%) rename src/rl/math/{ => spatial}/MotionVector.hxx (78%) rename src/rl/math/{ => spatial}/PlueckerTransform.h (55%) rename src/rl/math/{ => spatial}/PlueckerTransform.hxx (62%) rename src/rl/math/{ => spatial}/RigidBodyInertia.h (71%) rename src/rl/math/{ => spatial}/RigidBodyInertia.hxx (83%) create mode 100644 src/rl/mdl/InverseKinematics.cpp create mode 100644 src/rl/mdl/InverseKinematics.h create mode 100644 src/rl/mdl/JacobianInverseKinematics.cpp create mode 100644 src/rl/mdl/JacobianInverseKinematics.h create mode 100644 src/rl/mdl/NloptInverseKinematics.cpp create mode 100644 src/rl/mdl/NloptInverseKinematics.h create mode 100644 src/rl/mdl/UrdfFactory.cpp create mode 100644 src/rl/mdl/UrdfFactory.h create mode 100644 src/rl/plan/GnatNearestNeighbors.cpp create mode 100644 src/rl/plan/GnatNearestNeighbors.h create mode 100644 src/rl/plan/KdtreeBoundingBoxNearestNeighbors.cpp create mode 100644 src/rl/plan/KdtreeBoundingBoxNearestNeighbors.h create mode 100644 src/rl/plan/KdtreeNearestNeighbors.cpp create mode 100644 src/rl/plan/KdtreeNearestNeighbors.h create mode 100644 src/rl/plan/LinearNearestNeighbors.cpp create mode 100644 src/rl/plan/LinearNearestNeighbors.h create mode 100644 src/rl/plan/Metric.cpp create mode 100644 src/rl/plan/Metric.h create mode 100644 src/rl/plan/NearestNeighbors.cpp rename src/rl/{hal/Dc1394CameraException.h => plan/NearestNeighbors.h} (64%) delete mode 100644 src/rl/plan/Orthogonal_k_neighbor_search.h create mode 100644 src/rl/plan/WorkspaceMetric.cpp create mode 100644 src/rl/plan/WorkspaceMetric.h create mode 100644 src/rl/sg/fcl/Body.cpp create mode 100644 src/rl/sg/fcl/Body.h create mode 100644 src/rl/sg/fcl/Model.cpp create mode 100644 src/rl/sg/fcl/Model.h create mode 100644 src/rl/sg/fcl/Scene.cpp create mode 100644 src/rl/sg/fcl/Scene.h create mode 100644 src/rl/sg/fcl/Shape.cpp create mode 100644 src/rl/sg/fcl/Shape.h create mode 100644 src/rl/std/CMakeLists.txt create mode 100644 src/rl/std/chrono create mode 100644 src/rl/std/condition_variable create mode 100644 src/rl/std/future create mode 100644 src/rl/std/iterator create mode 100644 src/rl/std/mutex create mode 100644 src/rl/std/random create mode 100644 src/rl/std/regex create mode 100644 src/rl/std/string create mode 100644 src/rl/std/thread delete mode 100644 src/rl/util/Semaphore.h delete mode 100644 src/rl/util/Thread.h delete mode 100644 src/rl/util/Timer.h create mode 100644 src/rl/util/process.h create mode 100644 src/rl/util/rtai/chrono.h create mode 100644 src/rl/util/rtai/thread.h rename src/rl/util/{Mutex.h => thread.h} (59%) create mode 100644 src/rl/util/xenomai/chrono.h create mode 100644 src/rl/util/xenomai/condition_variable.h create mode 100644 src/rl/util/xenomai/mutex.h create mode 100644 src/rl/util/xenomai/thread.h create mode 100644 src/rl/xml/NodeSet.h create mode 100644 src/rl/xml/Stylesheet.h create mode 100644 tests/CMakeLists.txt create mode 100644 tests/rlCircularTest/CMakeLists.txt create mode 100644 tests/rlCircularTest/rlCircularTest.cpp create mode 100644 tests/rlCollisionTest/CMakeLists.txt create mode 100644 tests/rlCollisionTest/rlCollisionTest.cpp create mode 100644 tests/rlCollisionTest/rlSceneCollisionTest.cpp create mode 100644 tests/rlCollisionTest/twotori.wrl create mode 100644 tests/rlCollisionTest/twotori.xml create mode 100644 tests/rlEetTest/CMakeLists.txt create mode 100644 tests/rlEetTest/rlEetTest.cpp create mode 100644 tests/rlInverseKinematicsKinTest/CMakeLists.txt rename tests/{rlInverseKinematicsTest/rlInverseKinematicsTest.cpp => rlInverseKinematicsKinTest/rlInverseKinematicsKinTest.cpp} (79%) create mode 100644 tests/rlInverseKinematicsMdlTest/CMakeLists.txt create mode 100644 tests/rlInverseKinematicsMdlTest/rlInverseKinematicsMdlTest.cpp delete mode 100644 tests/rlInverseKinematicsTest/CMakeLists.txt create mode 100644 tests/rlJacobianKinTest/CMakeLists.txt create mode 100644 tests/rlJacobianKinTest/rlJacobianKinTest.cpp create mode 100644 tests/rlJacobianMdlTest/CMakeLists.txt create mode 100644 tests/rlJacobianMdlTest/rlJacobianMdlTest.cpp create mode 100644 tests/rlMathDeltaTest/CMakeLists.txt create mode 100644 tests/rlMathDeltaTest/rlMathDeltaTest.cpp create mode 100644 tests/rlNearestNeighborsTest/CMakeLists.txt create mode 100644 tests/rlNearestNeighborsTest/iterator.h create mode 100644 tests/rlNearestNeighborsTest/rlNearestNeighborsTest.cpp create mode 100644 tests/rlSplineTest/CMakeLists.txt create mode 100644 tests/rlSplineTest/rlPolynomialExtremaTest.cpp create mode 100644 tests/rlSplineTest/rlPolynomialTest.cpp create mode 100644 tests/rlSplineTest/rlQuarticLinearQuarticTest.cpp create mode 100644 tests/rlSplineTest/rlSexticLinearSexticTest.cpp create mode 100644 tests/rlSplineTest/rlSplineScaleTest.cpp create mode 100644 tests/rlSplineTest/rlSplineTest.cpp create mode 100644 tests/rlSplineTest/rlSplineTranslationTest.cpp create mode 100644 tests/rlSplineTest/rlTrapezoidalAccelerationTest.cpp diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dae47476..00000000 --- a/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -*.a -*.app -*.dll -*.dylib -*.exe -*.la -*.lai -*.lib -*.lo -*.o -*.obj -*.out -*.slo -*.so diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt new file mode 100644 index 00000000..7854eb6a --- /dev/null +++ b/3rdparty/CMakeLists.txt @@ -0,0 +1,145 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(3rdparty) + +include(ExternalProject) + +if(WIN32) + ExternalProject_Add( + patch + URL https://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/patch-2.5.9-7-bin.zip + URL_MD5 b9c8b31d62f4b2e4f1887bbb63e8a905 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND + ${CMAKE_COMMAND} -E copy /bin/patch.exe ${CMAKE_CURRENT_BINARY_DIR}/patch.exe && + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/patch.exe.manifest ${CMAKE_CURRENT_BINARY_DIR}/patch.exe.manifest + ) + set(PATCH_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/patch.exe) +else() + ExternalProject_Add( + patch + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + ) + set(PATCH_EXECUTABLE patch) +endif() + +add_subdirectory(atidaq) +add_subdirectory(boost) +add_subdirectory(bullet) +add_subdirectory(eigen) +add_subdirectory(libiconv) +add_subdirectory(nlopt) +add_subdirectory(ode) +add_subdirectory(pqp) +add_subdirectory(simage) +add_subdirectory(solid) +add_subdirectory(zlib) + +add_subdirectory(libxml2) +add_subdirectory(coin) + +add_subdirectory(libxslt) +add_subdirectory(soqt) + +set( + CPACK_INSTALL_CMAKE_PROJECTS + "${CMAKE_CURRENT_BINARY_DIR}/atidaq/atidaq-prefix/src/atidaq-build;atidaq;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/bullet/bullet-prefix/src/bullet-build;bullet;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/coin/coin-prefix/src/coin-build;coin;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/eigen/eigen-prefix/src/eigen-build;eigen;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/libiconv/libiconv-prefix/src/libiconv-build;libiconv;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/libxml2/libxml2-prefix/src/libxml2-build;libxml2;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/libxslt/libxslt-prefix/src/libxslt-build;libxslt;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/nlopt/nlopt-prefix/src/nlopt-build;nlopt;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/ode/ode-prefix/src/ode-build;ode;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/pqp/pqp-prefix/src/pqp-build;pqp;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/simage/simage-prefix/src/simage-build;simage;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/solid/solid-prefix/src/solid-build;solid;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/soqt/soqt-prefix/src/soqt-build;soqt;ALL;/" + "${CMAKE_CURRENT_BINARY_DIR}/zlib/zlib-prefix/src/zlib-build;zlib;ALL;/" +) + +set( + CPACK_INSTALLED_DIRECTORIES + ${CMAKE_CURRENT_BINARY_DIR}/boost/boost-prefix/src/boost/boost ${CMAKE_INSTALL_INCLUDEDIR}/boost +) + +set(CPACK_PACKAGE_VERSION_MAJOR 0) +set(CPACK_PACKAGE_VERSION_MINOR 7) +set(CPACK_PACKAGE_VERSION_PATCH 0) + +set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) + +if(MSVC) + if(CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+)\\.([0-9])([0-9]*)\\.([0-9]+)\\.") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18) + math(EXPR LINKER_VERSION_MAJOR "${CMAKE_MATCH_1} - 5") + else() + math(EXPR LINKER_VERSION_MAJOR "${CMAKE_MATCH_1} - 6") + endif() + set(PLATFORM_TOOLSET_MAJOR ${LINKER_VERSION_MAJOR}) + set(PLATFORM_TOOLSET_MINOR ${CMAKE_MATCH_2}) + set(LINKER_VERSION "${LINKER_VERSION_MAJOR}.${CMAKE_MATCH_2}${CMAKE_MATCH_3}.${CMAKE_MATCH_4}") + endif() + if(CMAKE_CL_64) + set(CPACK_PACKAGE_FILE_NAME "rl-3rdparty-${CPACK_PACKAGE_VERSION}-msvc-${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}-x64") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${CPACK_PACKAGE_VERSION}\\\\MSVC\\\\${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}\\\\x64") + set(CPACK_PACKAGE_NAME "Robotics Library ${CPACK_PACKAGE_VERSION} Third-Party Dependencies - MSVC ${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR} (x64)") + else() + set(CPACK_PACKAGE_FILE_NAME "rl-3rdparty-${CPACK_PACKAGE_VERSION}-msvc-${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}-x86") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${CPACK_PACKAGE_VERSION}\\\\MSVC\\\\${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}\\\\x86") + set(CPACK_PACKAGE_NAME "Robotics Library ${CPACK_PACKAGE_VERSION} Third-Party Dependencies - MSVC ${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR} (x86)") + endif() +else() + set(CPACK_PACKAGE_FILE_NAME "rl-3rdparty-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "rl-${CPACK_PACKAGE_VERSION}") + set(CPACK_PACKAGE_NAME "Robotics Library ${CPACK_PACKAGE_VERSION} Third-Party Dependencies") +endif() + +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.roboticslibrary.org/contact") +set(CPACK_DEBIAN_PACKAGE_NAME "librl-3rdparty") +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_NSIS_DISPLAY_NAME ${CPACK_PACKAGE_NAME}) +set(CPACK_NSIS_EXECUTABLES_DIRECTORY ${CMAKE_INSTALL_BINDIR}) +set(CPACK_NSIS_HELP_LINK "https://www.roboticslibrary.org/contact") +set(CPACK_NSIS_INSTALLED_ICON_NAME Uninstall.exe) +set(CPACK_NSIS_MODIFY_PATH ON) +set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../robotics-library.ico) +set(CPACK_NSIS_MUI_UNIICON ${CMAKE_CURRENT_SOURCE_DIR}/../robotics-library.ico) +set(CPACK_NSIS_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) +set(CPACK_NSIS_URL_INFO_ABOUT "https://www.roboticslibrary.org/contact") +set(CPACK_PACKAGE_CONTACT "Robotics Library Team ") +set(CPACK_PACKAGE_VENDOR "Robotics Library") +set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CPackProjectConfig.cmake) +set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") +set(CPACK_RPM_PACKAGE_NAME "rl-3rdparty") +set(CPACK_RPM_PACKAGE_SUMMARY "Robotics Library Third-Party Dependencies") +set(CPACK_RPM_PACKAGE_URL "https://www.roboticslibrary.org/contact") +set(CPACK_WIX_EXTENSIONS "WiXUtilExtension") +set( + CPACK_WIX_EXTRA_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/WixExtra.wxs + ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/WixUI_FeatureTreeNoLicense.wxs +) +set(CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/WixPatch.xml) +set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../robotics-library.ico) +set(CPACK_WIX_PROGRAM_MENU_FOLDER ${CPACK_PACKAGE_NAME}) +set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://www.roboticslibrary.org/contact") +set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://www.roboticslibrary.org/") +set(CPACK_WIX_ROOT_FEATURE_TITLE "Robotics Library Third-Party Dependencies") +set(CPACK_WIX_UI_BANNER ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/WixUIBanner.bmp) +set(CPACK_WIX_UI_DIALOG ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/WixUIDialog.bmp) +set(CPACK_WIX_UI_REF "WixUI_FeatureTreeNoLicense") + +configure_file(../cmake/WixExtra.wxs.in ${CMAKE_CURRENT_BINARY_DIR}/WixExtra.wxs) +configure_file(../cmake/WixPatch.xml.in ${CMAKE_CURRENT_BINARY_DIR}/WixPatch.xml) + +set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT system) +include(InstallRequiredSystemLibraries) + +include(CPack) diff --git a/3rdparty/atidaq/CMakeLists.txt b/3rdparty/atidaq/CMakeLists.txt new file mode 100644 index 00000000..1db2abdc --- /dev/null +++ b/3rdparty/atidaq/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(atidaq) + +include(ExternalProject) + +if(NOT WIN32) + set(PATCH_BINARY "--binary") +endif() + +ExternalProject_Add( + atidaq + DEPENDS patch + URL http://www.ati-ia.com/library/software/daq_ft/ATIDAQ%20C%20Library.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/ATIDAQ%20C%20Library.zip + URL_MD5 02c26650792927a09202196c574522cd + PATCH_COMMAND + ${PATCH_EXECUTABLE} -p1 -t -N ${PATCH_BINARY} < ${CMAKE_CURRENT_SOURCE_DIR}/atidaq.patch && + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/atidaq-config.cmake.in /atidaq-config.cmake.in && + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in /CMakeLists.txt + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/atidaq/CMakeLists.txt.in b/3rdparty/atidaq/CMakeLists.txt.in new file mode 100644 index 00000000..3c5a5383 --- /dev/null +++ b/3rdparty/atidaq/CMakeLists.txt.in @@ -0,0 +1,183 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(atidaq) + +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) + +set(VERSION_MAJOR 1) +set(VERSION_MINOR 0) +set(VERSION_PATCH 7) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + +if(WIN32) + set(BUILD_SHARED_LIBS OFF) +else() + option(BUILD_SHARED_LIBS "Build shared libraries" ON) +endif() + +set( + HDRS + ATIDAQ/ascii.h + ATIDAQ/asciitab.h + ATIDAQ/dom.h + ATIDAQ/ftconfig.h + ATIDAQ/ftrt.h + ATIDAQ/ftsharedrt.h + ATIDAQ/iasciitab.h + ATIDAQ/latin1tab.h + ATIDAQ/nametab.h + ATIDAQ/stack.h + ATIDAQ/utf8tab.h + ATIDAQ/xmldef.h + ATIDAQ/xmlparse.h + ATIDAQ/xmlrole.h + ATIDAQ/xmltok.h + ATIDAQ/xmltok_impl.h +) + +set( + SRCS + ATIDAQ/dom.c + ATIDAQ/expatls.c + ATIDAQ/ftconfig.c + ATIDAQ/ftrt.c + ATIDAQ/node.c + ATIDAQ/stack.c + ATIDAQ/xmlparse.c + ATIDAQ/xmlrole.c + ATIDAQ/xmltok.c +) + +add_library(atidaq ${HDRS} ${SRCS}) + +target_include_directories( + atidaq + INTERFACE + $ + $/${CMAKE_INSTALL_INCLUDEDIR}> +) + +if(UNIX) + target_link_libraries(atidaq m) +endif() + +set_target_properties(atidaq PROPERTIES DEBUG_POSTFIX d VERSION ${VERSION}) + +install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/atidaq COMPONENT development) + +install( + TARGETS atidaq + EXPORT atidaq + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime +) + +if(BUILD_SHARED_LIBS) + install( + TARGETS atidaq + EXPORT atidaq + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY + ) +endif() + +if(MSVC AND BUILD_SHARED_LIBS AND ${CMAKE_MAJOR_VERSION} GREATER 2 AND ${CMAKE_MINOR_VERSION} GREATER 0) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug) +endif() + +add_executable(calinfo Samples/calinfo.c) +target_link_libraries(calinfo atidaq) + +install( + TARGETS calinfo + COMPONENT programs + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +add_executable(ftconvert Samples/ftconvert.c) +target_link_libraries(ftconvert atidaq) + +install( + TARGETS ftconvert + COMPONENT programs + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +configure_package_config_file( + atidaq-config.cmake.in atidaq-config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/atidaq-${VERSION} +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/atidaq-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/atidaq-${VERSION} + COMPONENT development +) + +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/atidaq-config-version.cmake + VERSION ${VERSION} + COMPATIBILITY ExactVersion +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/atidaq-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/atidaq-${VERSION} + COMPONENT development +) + +install( + EXPORT atidaq + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/atidaq-${VERSION} + NAMESPACE atidaq:: + FILE atidaq-export.cmake + COMPONENT development +) + +set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime) +set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime) +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libatidaq") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libatidaq-dev") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.ati-ia.com/Products/ft/software/daq_software.aspx") +set(CPACK_DEBIAN_PACKAGE_NAME "libatidaq") +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "libatidaq") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "libatidaq-utils") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libatidaq") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "libatidaq-utils") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs") +set(CPACK_NSIS_PACKAGE_NAME "ATIDAQ ${VERSION}") +set(CPACK_NSIS_URL_INFO_ABOUT ${CPACK_DEBIAN_PACKAGE_HOMEPAGE}) +set(CPACK_PACKAGE_CONTACT "info@ati-ia.com") +set(CPACK_PACKAGE_DISPLAY_NAME "ATIDAQ ${VERSION}") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "ATIDAQ-${VERSION}") +set(CPACK_PACKAGE_NAME "atidaq") +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/readme.txt) +set(CPACK_RPM_COMPONENT_INSTALL ON) +set(CPACK_RPM_development_PACKAGE_NAME "atidaq-devel") +set(CPACK_RPM_development_PACKAGE_REQUIRES "atidaq") +set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") +set(CPACK_RPM_PACKAGE_NAME "atidaq") +set(CPACK_RPM_PACKAGE_URL ${CPACK_DEBIAN_PACKAGE_HOMEPAGE}) +set(CPACK_RPM_programs_PACKAGE_NAME "atidaq-utils") +set(CPACK_RPM_programs_PACKAGE_REQUIRES "atidaq") +set(CPACK_RPM_runtime_PACKAGE_NAME "atidaq") +set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "atidaq-utils") + +if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") +endif() + +include(CPack) diff --git a/3rdparty/atidaq/atidaq-config.cmake.in b/3rdparty/atidaq/atidaq-config.cmake.in new file mode 100644 index 00000000..d0b918a1 --- /dev/null +++ b/3rdparty/atidaq/atidaq-config.cmake.in @@ -0,0 +1,13 @@ +set(ATIDAQ_VERSION "@VERSION@") +set(ATIDAQ_VERSION_MAJOR "@VERSION_MAJOR@") +set(ATIDAQ_VERSION_MINOR "@VERSION_MINOR@") +set(ATIDAQ_VERSION_PATCH "@VERSION_PATCH@") + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/atidaq-export.cmake") + +set(ATIDAQ_DEFINITIONS "") +set(ATIDAQ_INCLUDE_DIRS "") +set(ATIDAQ_LIBRARY_DIRS "") +set(ATIDAQ_LIBRARIES "atidaq::atidaq") diff --git a/3rdparty/atidaq/atidaq.patch b/3rdparty/atidaq/atidaq.patch new file mode 100644 index 00000000..c2a529b5 --- /dev/null +++ b/3rdparty/atidaq/atidaq.patch @@ -0,0 +1,24 @@ +diff -Naur ATIDAQ%20C%20Library.orig/Samples/calinfo.c ATIDAQ%20C%20Library/Samples/calinfo.c +--- ATIDAQ%20C%20Library.orig/Samples/calinfo.c 2013-06-17 15:28:44.974930600 +0200 ++++ ATIDAQ%20C%20Library/Samples/calinfo.c 2015-11-14 15:52:05.938150000 +0100 +@@ -29,7 +29,7 @@ + + #include + #include +-#include "..\ATIDAQ\ftconfig.h" ++#include "../ATIDAQ/ftconfig.h" + + int main(int argc, char *argv[]) { + char *calfilepath; // name of calibration file +diff -Naur ATIDAQ%20C%20Library.orig/Samples/ftconvert.c ATIDAQ%20C%20Library/Samples/ftconvert.c +--- ATIDAQ%20C%20Library.orig/Samples/ftconvert.c 2013-06-17 15:28:44.993932500 +0200 ++++ ATIDAQ%20C%20Library/Samples/ftconvert.c 2015-11-14 15:52:01.514088300 +0100 +@@ -32,7 +32,7 @@ + + #include + #include +-#include "..\atidaq\ftconfig.h" ++#include "../ATIDAQ/ftconfig.h" + + int main(int argc, char *argv[]) { + char *calfilepath; // name of calibration file diff --git a/3rdparty/boost/CMakeLists.txt b/3rdparty/boost/CMakeLists.txt new file mode 100644 index 00000000..9d31d140 --- /dev/null +++ b/3rdparty/boost/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(boost) + +include(ExternalProject) +include(GNUInstallDirs) + +ExternalProject_Add( + boost + URL https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/boost_1_65_1.tar.bz2 + URL_MD5 41d7542ce40e171f3f7982aff008ff0d + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /boost ${CMAKE_INSTALL_FULL_INCLUDEDIR}/boost +) diff --git a/3rdparty/bullet/CMakeLists.txt b/3rdparty/bullet/CMakeLists.txt new file mode 100644 index 00000000..7e1146aa --- /dev/null +++ b/3rdparty/bullet/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(bullet) + +include(ExternalProject) + +ExternalProject_Add( + bullet + #GIT_REPOSITORY git://github.com/bulletphysics/bullet3.git + #GIT_TAG 2.86.1 + URL https://github.com/roboticslibrary/bullet3/archive/patch.tar.gz + #URL ${CMAKE_CURRENT_SOURCE_DIR}/bullet3-2.86.1.tar.gz + #URL_MD5 439f78f567ee340b0cd1ffb8c31def1e + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} -DBUILD_BULLET2_DEMOS=OFF -DBUILD_CPU_DEMOS=OFF -DBUILD_EXTRAS=ON -DBUILD_OPENGL3_DEMOS=OFF -DBUILD_PYBULLET=OFF -DBUILD_UNIT_TESTS=OFF -DINSTALL_EXTRA_LIBS=ON -DINSTALL_LIBS=ON -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/coin/CMakeLists.txt b/3rdparty/coin/CMakeLists.txt new file mode 100644 index 00000000..8b811953 --- /dev/null +++ b/3rdparty/coin/CMakeLists.txt @@ -0,0 +1,27 @@ +include(ExternalProject) + +ExternalProject_Add( + boost-header-libs-full + #HG_REPOSITORY https://bitbucket.org/Coin3D/boost-header-libs-full + #HG_TAG default + URL https://bitbucket.org/Coin3D/boost-header-libs-full/get/default.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/default.tar.bz2 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) + +list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_INSTALL_PREFIX}) + +ExternalProject_Add( + coin + DEPENDS boost-header-libs-full simage + #HG_REPOSITORY https://bitbucket.org/Coin3D/coin + #HG_TAG CMake + URL https://bitbucket.org/Coin3D/coin/get/CMake.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/CMake.tar.bz2 + PATCH_COMMAND + ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/boost-header-libs-full-prefix/src/boost-header-libs-full /include/boost + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} -DCOIN_BUILD_DOCUMENTATION=OFF + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/eigen/CMakeLists.txt b/3rdparty/eigen/CMakeLists.txt new file mode 100644 index 00000000..91500d32 --- /dev/null +++ b/3rdparty/eigen/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(eigen) + +include(ExternalProject) + +ExternalProject_Add( + eigen + #HG_REPOSITORY https://bitbucket.org/eigen/eigen/ + #HG_TAG 3.3.4 + URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz + #URL ${CMAKE_CURRENT_SOURCE_DIR}/eigen-eigen-5a0156e40feb.tar.gz + #URL_MD5 1a47e78efe365a97de0c022d127607c3 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/libiconv/CMakeLists.txt b/3rdparty/libiconv/CMakeLists.txt new file mode 100644 index 00000000..569e9f82 --- /dev/null +++ b/3rdparty/libiconv/CMakeLists.txt @@ -0,0 +1,22 @@ +include(ExternalProject) + +if(WIN32) + set(PATCH_BINARY "--binary") +endif() + +ExternalProject_Add( + libiconv + DEPENDS patch + #GIT_REPOSITORY git://git.savannah.gnu.org/libiconv.git + #GIT_TAG v1.15 + URL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz + #URL ${CMAKE_CURRENT_SOURCE_DIR}/libiconv-1.15.tar.gz + URL_MD5 ace8b5f2db42f7b3b3057585e80d9808 + PATCH_COMMAND + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in /CMakeLists.txt && + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in /config.h.cmake.in && + ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/libiconv-config.cmake.in /libiconv-config.cmake.in && + ${PATCH_EXECUTABLE} -p1 -t -N ${PATCH_BINARY} < ${CMAKE_CURRENT_SOURCE_DIR}/libiconv-1.15.patch + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/libiconv/CMakeLists.txt.in b/3rdparty/libiconv/CMakeLists.txt.in new file mode 100644 index 00000000..b1e8db48 --- /dev/null +++ b/3rdparty/libiconv/CMakeLists.txt.in @@ -0,0 +1,843 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(libiconv) + +include(CheckCCompilerFlag) +include(CheckCSourceCompiles) +include(CheckCSourceRuns) +include(CheckFunctionExists) +include(CheckIncludeFiles) +include(CheckSymbolExists) +include(CheckTypeSize) +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) +include(TestBigEndian) + +function(CHECK_RAW_SYMBOL_EXISTS SYMBOL FILES VARIABLE) + foreach(FILE ${FILES}) + list(APPEND SOURCE "#include <${FILE}>\n") + endforeach() + list(APPEND SOURCE "int main()\n{\n#undef ${SYMBOL}\n(void) ${SYMBOL};\nreturn 0;\n}") + check_c_source_compiles("${SOURCE}" "${VARIABLE}") +endfunction() + +set(CMAKE_IMPORT_LIBRARY_PREFIX "") +set(CMAKE_SHARED_LIBRARY_PREFIX "") +set(CMAKE_STATIC_LIBRARY_PREFIX "") + +set(VERSION_MAJOR 1) +set(VERSION_MINOR 15) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +check_type_size("ptrdiff_t" BITSIZEOF_PTRDIFF_T) +set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") +check_type_size("sig_atomic_t" BITSIZEOF_SIG_ATOMIC_T) +unset(CMAKE_EXTRA_INCLUDE_FILES) +check_type_size("size_t" BITSIZEOF_SIZE_T) +check_type_size("wchar_t" BITSIZEOF_WCHAR_T) +check_type_size("wint_t" BITSIZEOF_WINT_T) +#CRAY_STACKSEG_END +#C_ALLOCA +#DOUBLE_SLASH_IS_DISTINCT_ROOT +check_symbol_exists(EILSEQ "errno.h" HAVE_EILSEQ) +if(NOT HAVE_EILSEQ) + set(EILSEQ "ENOENT") +endif() +option(ENABLE_EXTRA "Enable a few rarely used encodings" OFF) +option(ENABLE_NLS "Translate program messages to user's native language" OFF) +option(ENABLE_RELOCATABLE "Install a package that can be moved in the file system" ON) +check_c_source_runs(" + #include + static void exception_handler(int sig) { exit (1); } + static void nocrash_init(void) + { + #ifdef SIGSEGV + signal (SIGSEGV, exception_handler); + #endif + #ifdef SIGBUS + signal (SIGBUS, exception_handler); + #endif + } + #include + #include + int main() + { + int result = 0; + { + char *name = realpath(\"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt\", NULL); + if (!(name && *name == '/')) result |= 1; + } + { + char *name = realpath(\"conftest.b/../conftest.a\", NULL); + if (name != NULL) result |= 2; + } + { + char *name = realpath(\"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt/\", NULL); + if (name != NULL) result |= 4; + } + { + char *name1 = realpath(\".\", NULL); + char *name2 = realpath(\"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles//./..\", NULL); + if (strcmp(name1, name2) != 0) result |= 8; + } + return result; + } +" FUNC_REALPATH_WORKS) +set(GNULIB_CANONICALIZE_LGPL ON) +#GNULIB_SIGPIPE +check_c_source_runs(" + #include + int main() { if (!*strerror(-2)) return 1; return 0; } +" GNULIB_STRERROR) +set(GNULIB_TEST_CANONICALIZE_FILE_NAME 1) +set(GNULIB_TEST_ENVIRON ON) +set(GNULIB_TEST_LSTAT ON) +set(GNULIB_TEST_READ ON) +set(GNULIB_TEST_READLINK ON) +set(GNULIB_TEST_REALPATH ON) +set(GNULIB_TEST_SIGPROCMASK ON) +set(GNULIB_TEST_STAT ON) +set(GNULIB_TEST_STRERROR ON) +check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA) +check_include_files(alloca.h HAVE_ALLOCA_H) +#HAVE_CANONICALIZE_FILE_NAME +check_c_source_compiles(" + #include + int main() { CFLocaleCopyCurrent(); return 0; } +" HAVE_CFLOCALECOPYCURRENT) +check_c_source_compiles(" + #include + int main() { CFPreferencesCopyAppValue(NULL, NULL); return 0; } +" HAVE_CFPREFERENCESCOPYAPPVALUE) +check_function_exists(dcgettext HAVE_DCGETTEXT) +check_symbol_exists(clearerr_unlocked "stdio.h" HAVE_DECL_CLEARERR_UNLOCKED) +check_symbol_exists(feof_unlocked "stdio.h" HAVE_DECL_FEOF_UNLOCKED) +check_symbol_exists(ferror_unlocked "stdio.h" HAVE_DECL_FERROR_UNLOCKED) +check_symbol_exists(fflush_unlocked "stdio.h" HAVE_DECL_FFLUSH_UNLOCKED) +check_symbol_exists(fgets_unlocked "stdio.h" HAVE_DECL_FGETS_UNLOCKED) +check_symbol_exists(fputc_unlocked "stdio.h" HAVE_DECL_FPUTC_UNLOCKED) +check_symbol_exists(fputs_unlocked "stdio.h" HAVE_DECL_FPUTS_UNLOCKED) +check_symbol_exists(fread_unlocked "stdio.h" HAVE_DECL_FREAD_UNLOCKED) +check_symbol_exists(fwrite_unlocked "stdio.h" HAVE_DECL_FWRITE_UNLOCKED) +check_symbol_exists(getchar_unlocked "stdio.h" HAVE_DECL_GETCHAR_UNLOCKED) +check_symbol_exists(getc_unlocked "stdio.h" HAVE_DECL_GETC_UNLOCKED) +check_symbol_exists(program_invocation_name "errno.h" HAVE_DECL_PROGRAM_INVOCATION_NAME) +check_symbol_exists(program_invocation_short_name "errno.h" HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME) +check_symbol_exists(putchar_unlocked "stdio.h" HAVE_DECL_PUTCHAR_UNLOCKED) +check_symbol_exists(putc_unlocked "stdio.h" HAVE_DECL_PUTC_UNLOCKED) +check_symbol_exists(setenv "stdlib.h" HAVE_DECL_SETENV) +check_symbol_exists(strerror_r "string.h" HAVE_DECL_STRERROR_R) +check_include_files(dlfcn.h HAVE_DLFCN_H) +check_c_source_compiles(" + #include + extern struct { int foo; } environ; + int main() { environ.foo = 1; return 0; } +" HAVE_ENVIRON_DECL) +check_function_exists(getcwd HAVE_GETCWD) +check_function_exists(getc_unlocked HAVE_GETC_UNLOCKED) +check_function_exists(iconv HAVE_ICONV) +check_include_files(inttypes.h HAVE_INTTYPES_H) +check_c_source_compiles(" + #include + int main() { char* cs = nl_langinfo(CODESET); return !cs; } +" HAVE_LANGINFO_CODESET) +check_type_size("long long int" LONG_LONG_INT) +check_function_exists(lstat HAVE_LSTAT) +check_include_files(mach-o/dyld.h HAVE_MACH_O_DYLD_H) +check_function_exists(mbrtowc HAVE_MBRTOWC) +check_function_exists(mbsinit HAVE_MBSINIT) +check_c_source_compiles(" + #include + #include + #include + #include + int main() { mbstate_t x; return sizeof x; } +" HAVE_MBSTATE_T) +check_function_exists(memmove HAVE_MEMMOVE) +check_include_files(memory.h HAVE_MEMORY_H) +foreach( + FUNCTION + "chown" "dup2" "dup3" "endusershell" "environ" "euidaccess" "faccessat" "fchdir" + "fchownat" "fsync" "ftruncate" "getcwd" "getdomainname" "getdtablesize" "getgroups" + "gethostname" "getlogin" "getlogin_r" "getpagesize" "getusershell" "group_member" "lchown" + "link" "linkat" "lseek" "pipe" "pipe2" "pread" "pwrite" "readlink" "readlinkat" "rmdir" + "setusershell" "sleep" "symlink" "symlinkat" "ttyname_r" "unlink" "unlinkat" "usleep" +) + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_c_source_compiles(" + #include + #if !(defined(__GLIBC__) && !defined(__UCLIBC__)) + #include + #include + #include + #if (defined(_WIN32) || defined(__WIN32__)) && !defined(__CYGWIN__) + #include + #endif + #endif + int main () { + #undef ${FUNCTION} + (void) ${FUNCTION}; return 0; + } + " HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +foreach(FUNCTION "dprintf" "fpurge" "fseeko" "ftello" "getdelim" "getline" "popen" "renameat" "snprintf" "tmpfile" "vdprintf" "vsnprintf") + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_raw_symbol_exists(${FUNCTION} "stdio.h" HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +foreach(FUNCTION "fchmodat" "fstatat" "futimens" "lchmod" "lstat" "mkdirat" "mkfifo" "mkfifoat" "mknod" "mknodat" "stat" "utimensat") + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_raw_symbol_exists(${FUNCTION} "sys/stat.h" HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +foreach(FUNCTION "fcntl" "openat") + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_raw_symbol_exists(${FUNCTION} "fcntl.h" HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +foreach(FUNCTION "ffsl" "ffsll" "memmem" "mempcpy" "memrchr" "rawmemchr" "stpcpy" "stpncpy" "strcasestr" "strchrnul" "strdup" "strerror_r" "strncat" "strndup" "strnlen" "strpbrk" "strsep" "strsignal" "strtok_r" "strverscmp") + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_raw_symbol_exists(${FUNCTION} "string.h" HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +foreach(FUNCTION "pthread_sigmask" "sigaction" "sigaddset" "sigdelset" "sigemptyset" "sigfillset" "sigismember" "sigpending" "sigprocmask") + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + check_raw_symbol_exists(${FUNCTION} "signal.h" HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() +check_function_exists(readlink HAVE_READLINK) +check_function_exists(readlinkat HAVE_READLINKAT) +check_function_exists(realpath HAVE_REALPATH) +check_include_files(search.h HAVE_SEARCH_H) +check_function_exists(setenv HAVE_SETENV) +check_function_exists(setlocale HAVE_SETLOCALE) +#HAVE_SIGNED_SIG_ATOMIC_T +#HAVE_SIGNED_WCHAR_T +#HAVE_SIGNED_WINT_T +check_symbol_exists(sigset_t "signal.h;sys/types.h" HAVE_SIGSET_T) +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(stdlib.h HAVE_STDLIB_H) +check_function_exists(strerror_r HAVE_STRERROR_R) +check_include_files(strings.h HAVE_STRINGS_H) +check_include_files(string.h HAVE_STRING_H) +check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H) +check_include_files(sys/inttypes.h HAVE_SYS_INTTYPES_H) +check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H) +check_include_files(sys/param.h HAVE_SYS_PARAM_H) +check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) +check_include_files(sys/stat.h HAVE_SYS_STAT_H) +check_include_files(sys/time.h HAVE_SYS_TIME_H) +check_include_files(sys/types.h HAVE_SYS_TYPES_H) +check_function_exists(tsearch HAVE_TSEARCH) +check_include_files(unistd.h HAVE_UNISTD_H) +check_type_size("unsigned long long int" UNSIGNED_LONG_LONG_INT) +check_c_compiler_flag("-fvisibility=hidden -Werror" HAVE_VISIBILITY) +check_include_files(wchar.h HAVE_WCHAR_H) +check_type_size(wchar_t WCHAR_T) +check_function_exists(wcrtomb HAVE_WCRTOMB) +check_include_files(winsock2.h HAVE_WINSOCK2_H) +check_c_source_runs(" + #include + #include + #include + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = { O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY }; + int main() + { + int status = !constants; + { + static char const sym[] = \"conftest.sym\"; + if (symlink(\".\", sym) != 0 || close(open(sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + unlink(sym); + } + { + static char const file[] = \"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt\"; + int fd = open(file, O_RDONLY | O_NOATIME); + char c; struct stat st0, st1; + if (fd < 0 || fstat(fd, &st0) != 0 || sleep(1) != 0 || read(fd, &c, 1) != 1 || close(fd) != 0 || stat(file, &st1) != 0 || st0.st_atime != st1.st_atime) + status |= 64; + } + return status; + } +" HAVE_WORKING_O_NOATIME_O_NOFOLLOW) +if(HAVE_WORKING_O_NOATIME_O_NOFOLLOW) + set(HAVE_WORKING_O_NOATIME 1) + set(HAVE_WORKING_O_NOFOLLOW 1) +elseif(HAVE_WORKING_O_NOATIME_O_NOFOLLOW_EXITCODE EQUAL "32") + set(HAVE_WORKING_O_NOATIME 1) + set(HAVE_WORKING_O_NOFOLLOW 0) +elseif(HAVE_WORKING_O_NOATIME_O_NOFOLLOW_EXITCODE EQUAL "64") + set(HAVE_WORKING_O_NOATIME 0) + set(HAVE_WORKING_O_NOFOLLOW 1) +else() + set(HAVE_WORKING_O_NOATIME 0) + set(HAVE_WORKING_O_NOFOLLOW 0) +endif() +check_type_size("_Bool" _BOOL) +check_c_source_compiles(" + #include + int main() { _NSGetExecutablePath(NULL, NULL); return 0; } +" HAVE__NSGETEXECUTABLEPATH) +check_c_source_compiles(" + #include + #include + extern + #ifdef __cplusplus + \"C\" + #endif + #if defined(__STDC__) || defined(__cplusplus) + size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft); + #else + size_t iconv(); + #endif + int main() { return 0; } +" ICONV_CONST_TEST) +if(NOT ICONV_CONST_TEST) + set(ICONV_CONST "const") +endif() +set(INSTALLPREFIX ${CMAKE_INSTALL_PREFIX}) +if(UNIX) + execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" "${CMAKE_CURRENT_BINARY_DIR}/conftest.sym") + check_c_source_runs(" + #include + int main() { struct stat sbuf; return lstat(\"${CMAKE_CURRENT_BINARY_DIR}/conftest.sym/\", &sbuf) == 0; } + " LSTAT_FOLLOWS_SLASHED_SYMLINK) +endif() +#LT_OBJDIR +#NO_MINUS_C_MINUS_O +set(PACKAGE "libiconv") +set(PACKAGE_BUGREPORT "bug-gnu-libiconv@gnu.org") +set(PACKAGE_NAME "libiconv") +set(PACKAGE_STRING "libiconv ${VERSION}") +set(PACKAGE_TARNAME "libiconv") +set(PACKAGE_URL "https://www.gnu.org/software/libiconv/") +set(PACKAGE_VERSION ${VERSION}) +#PTRDIFF_T_SUFFIX +#READLINK_TRAILING_SLASH_BUG +check_c_source_runs(" + #include + #include + int main() { + int result = 0; + char *str; errno = 0; str = strerror(0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr(str, \"nknown\") || strstr(str, \"ndefined\")) result |= 4; + return result; + } +" HAVE_WORKING_STRERROR_0) +if(HAVE_WORKING_STRERROR_0) + set(REPLACE_STRERROR_0 OFF) +else() + set(REPLACE_STRERROR_0 ON) +endif() +#SIG_ATOMIC_T_SUFFIX +#SIZE_T_SUFFIX +#STACK_DIRECTION +check_c_source_compiles(" + #include + #include + #if defined(S_ISBLK) && defined(S_IFDIR) + extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; + #endif + #if defined(S_ISBLK) && defined(S_IFCHR) + extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; + #endif + #if defined(S_ISLNK) && defined(S_IFREG) + extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; + #endif + #if defined(S_ISSOCK) && defined(S_IFREG) + extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; + #endif + int main() { return 0; } +" STAT_MACROS_WORKING) +if(STAT_MACROS_WORKING) + set(STAT_MACROS_BROKEN OFF) +else() + set(STAT_MACROS_BROKEN ON) +endif() +check_include_files("assert.h;ctype.h;errno.h;float.h;limits.h;locale.h;math.h;setjmp.h;signal.h;stdarg.h;stddef.h;stdio.h;stdlib.h;string.h;time.h" STDC_HEADERS) +check_c_source_runs(" + extern char *strerror_r(); + int main() { char buf[100]; char x = *strerror_r(0, buf, sizeof buf); return !isalpha(x); } +" STRERROR_R_CHAR_P) +#USER_LABEL_PREFIX +#USE_UNLOCKED_IO +#WCHAR_T_SUFFIX +#WINT_T_SUFFIX +test_big_endian(WORDS_BIGENDIAN) +if(WORDS_BIGENDIAN) + set(WORDS_LITTLEENDIAN OFF) +else() + set(WORDS_LITTLEENDIAN ON) +endif() +check_include_files(minix/config.h HAVE_MINIX_CONFIG_H) +#_XOPEN_SOURCE +set(_ALL_SOURCE ON) +set(_DARWIN_C_SOURCE ON) +set(_GNU_SOURCE ON) +set(_POSIX_PTHREAD_SEMANTICS ON) +set(_TANDEM_SOURCE ON) +check_c_source_compiles(" + #define __EXTENSIONS__ 1 + int main() { return 0; } +" __EXTENSIONS__) +check_type_size("gid_t" GID_T) +if(NOT HAVE_GID_T) + set(gid_t "int") +endif() +set(inline "") +foreach(INLINE_KEYWORD "__inline" "__inline__" "inline") + check_c_source_compiles(" + typedef int foo_t; + static ${INLINE_KEYWORD} foo_t static_foo() { return 0; } + ${INLINE_KEYWORD} foo_t foo() { return 0; } + int main() { return 0; } + " HAVE_INLINE_KEYWORD) + if(HAVE_INLINE_KEYWORD) + set(inline ${INLINE_KEYWORD}) + endif() +endforeach() +if("x${inline}" STREQUAL "xinline") + unset(inline) +endif() +if(NOT HAVE_MBSTATE_T) + set(mbstate_t "int") +endif() +check_type_size("nlink_t" NLINK_T) +if(NOT HAVE_NLINK_T) + set(NLINK_T "int") +endif() +set(restrict "") +foreach(RESTRICT_KEYWORD "__restrict" "__restrict__" "_Restrict" "restrict") + check_c_source_compiles(" + typedef int* int_ptr; + int foo (int_ptr ${RESTRICT_KEYWORD} ip) { return ip[0]; } + int main() { int s[1]; int* ${RESTRICT_KEYWORD} t = s; t[0] = 0; return foo(t); } + " HAVE_RESTRICT_KEYWORD) + if(HAVE_RESTRICT_KEYWORD) + set(restrict ${RESTRICT_KEYWORD}) + endif() +endforeach() +if("x${restrict}" STREQUAL "xrestrict") + unset(restrict) +endif() +check_type_size("size_t" SIZE_T) +if(NOT HAVE_SIZE_T) + set(size_t "unsigned int") +endif() +check_type_size("ssize_t" SSIZE_T) +if(NOT HAVE_SSIZE_T) + set(ssize_t "int") +endif() +check_type_size("uid_t" UID_T) +if(NOT HAVE_UID_T) + set(uid_t "int") +endif() + +if(HAVE_LSTAT) + if(UNIX) + execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" "${CMAKE_CURRENT_BINARY_DIR}/conftest.sym") + endif() + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_LSTAT) +endif() +check_c_source_runs(" + #include + int main() { + int result = 0; + struct stat st; + if (!stat(\"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt/\", &st)) result |= 1; + #if HAVE_LSTAT + if (!stat(\"${CMAKE_CURRENT_BINARY_DIR}/conftest.sym/\", &st)) result |= 2; + #endif + return result; + } +" HAVE_WORKING_FUNC_STAT_DIR_FILE) +if(HAVE_WORKING_FUNC_STAT_DIR_FILE) + set(REPLACE_FUNC_STAT_DIR OFF) + set(REPLACE_FUNC_STAT_FILE OFF) +else() + set(REPLACE_FUNC_STAT_DIR ON) + set(REPLACE_FUNC_STAT_FILE ON) +endif() +unset(CMAKE_REQUIRED_DEFINITIONS) + +foreach( + FUNCTION + "_Exit" "atoll" "canonicalize_file_name" "getloadavg" "getsubopt" "grantpt" "initstat_r" + "mkdtemp" "mkostemp" "mkostemps" "mkstemp" "mkstemps" "ptsname" "random_r" "realpath" + "rpmatch" "setenv" "setstate_r" "srandom_r" "strtod" "strtoll" "strtoull" "unlockpt" "unsetenv" +) + string(TOUPPER ${FUNCTION} FUNCTION_UPPER) + set(FILES "stdlib.h") + if(HAVE_SYS_LOADAVG_H) + list(APPEND FILES "sys/loadavg.h") + endif() + if(HAVE_RANDOM_H) + list(APPEND FILES "random.h") + endif() + check_raw_symbol_exists(${FUNCTION} ${FILES} HAVE_RAW_DECL_${FUNCTION_UPPER}) +endforeach() + +if(STDC_HEADERS) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DSTDC_HEADERS) +endif() +if(HAVE_STDLIB_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDLIB_H) +endif() +check_c_source_compiles(" + #if defined(STDC_HEADERS) || defined(HAVE_STDLIB_H) + #include + #endif + int main() { return !malloc(0); } +" MALLOC_0_IS_NONNULL) +unset(CMAKE_REQUIRED_DEFINITIONS) + +if(HAVE_MINIX_CONFIG_H) + set(_MINIX ON) + set(_POSIX_1_SOURCE ON) + set(_POSIX_SOURCE ON) +endif() + +configure_file(config.h.cmake.in config.h @ONLY) + +if(HAVE_MBSTATE_T) + set(USE_MBSTATE_T 1) +else() + set(USE_MBSTATE_T 0) +endif() + +if(HAVE_VISIBILTY) + list(APPEND CMAKE_C_FLAGS "-fvisibility=hidden") + list(APPEND CMAKE_CXX_FLAGS "-fvisibility=hidden") + set(HAVE_VISIBILITY 1) +else() + set(HAVE_VISIBILITY 0) +endif() + +if(HAVE_WCHAR_T) + set(BROKEN_WCHAR_H 0) + set(HAVE_WCHAR_T 1) +else() + set(BROKEN_WCHAR_H 1) + set(HAVE_WCHAR_T 0) +endif() + +if(HAVE_WINSOCK2_H) + set(UNISTD_H_HAVE_WINSOCK2_H 1) + set(SYS_IOCTL_H_HAVE_WINSOCK2_H 1) +else() + set(UNISTD_H_HAVE_WINSOCK2_H 0) + set(SYS_IOCTL_H_HAVE_WINSOCK2_H 0) +endif() + +configure_file(include/iconv.h.build.in include/iconv.h @ONLY) +configure_file(libcharset/include/localcharset.h.build.in include/localcharset.h @ONLY) + +if(BUILD_SHARED_LIBS AND MSVC) + set(DLL_VARIABLE "__declspec (dllimport)") +endif() + +configure_file(include/iconv.h.in include/iconv.h.inst @ONLY) +configure_file(libcharset/include/libcharset.h.in include/libcharset.h @ONLY) + +add_library( + libcharset + libcharset/lib/localcharset.c + libcharset/lib/relocatable.c +) + +target_compile_definitions( + libcharset + PRIVATE + -DBUILDING_LIBCHARSET + -DHAVE_CONFIG_H + -DIN_LIBRARY + -DINSTALLDIR="${CMAKE_INSTALL_LIBDIR}" + -DLIBDIR="${CMAKE_INSTALL_LIBDIR}" + -DNO_XMALLOC + -Drelocate=libcharset_relocate + -Dset_relocation_prefix=libcharset_set_relocation_prefix +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(libcharset PRIVATE -D_DLL -DBUILDING_DLL) +endif() + +if(ENABLE_EXTRA) + target_compile_definitions(libcharset PRIVATE -DENABLE_EXTRA=1) +else() + target_compile_definitions(libcharset PRIVATE -DENABLE_EXTRA=0) +endif() + +if(ENABLE_NLS) + target_compile_definitions(libcharset PRIVATE -DENABLE_NLS=1) +else() + target_compile_definitions(libcharset PRIVATE -DENABLE_NLS=0) +endif() + +if(ENABLE_RELOCATABLE) + target_compile_definitions(libcharset PRIVATE -DENABLE_RELOCATABLE=1) +else() + target_compile_definitions(libcharset PRIVATE -DENABLE_RELOCATABLE=0) +endif() + +target_include_directories( + libcharset + PUBLIC + $ + $ + $/${CMAKE_INSTALL_INCLUDEDIR}> +) + +set_target_properties(libcharset PROPERTIES DEBUG_POSTFIX d VERSION ${VERSION}) + +add_library( + libiconv + lib/iconv.c + lib/relocatable.c + libcharset/lib/localcharset.c +) + +target_compile_definitions( + libiconv + PRIVATE + -DBUILDING_LIBICONV + -DHAVE_CONFIG_H + -DIN_LIBRARY + -DINSTALLDIR="${CMAKE_INSTALL_LIBDIR}" + -DLIBDIR="${CMAKE_INSTALL_LIBDIR}" + -DNO_XMALLOC + -Drelocate=libiconv_relocate + -Dset_relocation_prefix=libiconv_set_relocation_prefix +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(libiconv PRIVATE -D_DLL -DBUILDING_DLL) +endif() + +if(ENABLE_EXTRA) + target_compile_definitions(libiconv PRIVATE -DENABLE_EXTRA=1) +else() + target_compile_definitions(libiconv PRIVATE -DENABLE_EXTRA=0) +endif() + +if(ENABLE_NLS) + target_compile_definitions(libiconv PRIVATE -DENABLE_NLS=1) +else() + target_compile_definitions(libiconv PRIVATE -DENABLE_NLS=0) +endif() + +if(ENABLE_RELOCATABLE) + target_compile_definitions(libiconv PRIVATE -DENABLE_RELOCATABLE=1) +else() + target_compile_definitions(libiconv PRIVATE -DENABLE_RELOCATABLE=0) +endif() + +target_include_directories( + libiconv + PUBLIC + $ + $ + $/${CMAKE_INSTALL_INCLUDEDIR}> +) + +target_link_libraries(libiconv libcharset) + +set_target_properties(libiconv PROPERTIES DEBUG_POSTFIX d VERSION ${VERSION}) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/iconv.h.inst DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} RENAME iconv.h COMPONENT development) + +install( + TARGETS libcharset libiconv + EXPORT libiconv + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime +) + +if(BUILD_SHARED_LIBS) + install( + TARGETS libcharset libiconv + EXPORT libiconv + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY + ) +endif() + +if(MSVC AND BUILD_SHARED_LIBS AND ${CMAKE_MAJOR_VERSION} GREATER 2 AND ${CMAKE_MINOR_VERSION} GREATER 0) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug) +endif() + +#configure_file(srclib/stdbool.in.h include/stdbool.h @ONLY) +#configure_file(srclib/unistd.in.h include/unistd.h @ONLY) +#configure_file(srclib/unitypes.in.h include/unitypes.h @ONLY) +#configure_file(srclib/uniwidth.in.h include/uniwidth.h @ONLY) +# +#add_executable( +# iconv +# src/iconv.c +# srclib/allocator.c +# srclib/areadlink.c +# srclib/canonicalize-lgpl.c +# srclib/careadlinkat.c +# srclib/c-ctype.c +# srclib/error.c +# srclib/lstat.c +# srclib/malloca.c +# srclib/memmove.c +# srclib/progname.c +# srclib/progreloc.c +# srclib/read.c +# srclib/readlink.c +# srclib/relocwrapper.c +# srclib/safe-read.c +# srclib/setenv.c +# srclib/sigprocmask.c +# srclib/stat.c +# srclib/stdio-write.c +# srclib/strerror.c +# srclib/strerror-override.c +# srclib/xmalloc.c +# srclib/xreadlink.c +# srclib/xstrdup.c +#) +# +#target_compile_definitions( +# iconv +# PRIVATE +# -DEXEEXT="${CMAKE_EXECUTABLE_SUFFIX}" +# -DINSTALLDIR="${CMAKE_INSTALL_BINDIR}" +# -DINSTALLPREFIX="${CMAKE_INSTALL_PREFIX}" +# -DLIBPATHVAR="" +# -DLIBDIRS="" +# -DLOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}" +# -DNO_XMALLOC +#) +# +#if(ENABLE_EXTRA) +# target_compile_definitions(iconv PRIVATE -DENABLE_EXTRA=1) +#else() +# target_compile_definitions(iconv PRIVATE -DENABLE_EXTRA=0) +#endif() +# +#if(ENABLE_NLS) +# target_compile_definitions(iconv PRIVATE -DENABLE_NLS=1) +#else() +# target_compile_definitions(iconv PRIVATE -DENABLE_NLS=0) +#endif() +# +#if(ENABLE_RELOCATABLE) +# target_compile_definitions(iconv PRIVATE -DENABLE_RELOCATABLE=1) +#else() +# target_compile_definitions(iconv PRIVATE -DENABLE_RELOCATABLE=0) +#endif() +# +#target_include_directories( +# iconv +# PUBLIC +# $ +# $ +# $ +#) +# +#target_link_libraries(iconv libiconv) +# +#install( +# TARGETS iconv +# COMPONENT programs +# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +#) + +install(FILES man/iconv.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation) +install(FILES man/iconv.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +install(FILES man/iconv_close.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +install(FILES man/iconv_open.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +install(FILES man/iconv_open_into.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +install(FILES man/iconvctl.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) + +install(FILES man/iconv.1.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) +install(FILES man/iconv.3.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) +install(FILES man/iconv_close.3.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) +install(FILES man/iconv_open.3.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) +install(FILES man/iconv_open_into.3.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) +install(FILES man/iconvctl.3.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libiconv COMPONENT documentation) + +configure_package_config_file( + libiconv-config.cmake.in libiconv-config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libiconv-${VERSION} +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libiconv-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libiconv-${VERSION} +) + +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/libiconv-config-version.cmake + VERSION ${VERSION} + COMPATIBILITY ExactVersion +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libiconv-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libiconv-${VERSION} + COMPONENT development +) + +install( + EXPORT libiconv + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libiconv-${VERSION} + NAMESPACE libiconv:: + FILE libiconv-export.cmake + COMPONENT development +) + +set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime) +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libiconv-dev") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel") +set(CPACK_DEBIAN_DOCUMENTATION_PACKAGE_NAME "libiconv-doc") +set(CPACK_DEBIAN_DOCUMENTATION_PACKAGE_SECTION "doc") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL}) +set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +#set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}") +#set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils") +#set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${PACKAGE_TARNAME}") +#set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-programs") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs") +set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING}) +set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL}) +set(CPACK_PACKAGE_CONTACT ${PACKAGE_BUGREPORT}) +set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING}) +set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}") +set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION}) +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) +set(CPACK_RPM_COMPONENT_INSTALL ON) +set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_TARNAME}-devel") +set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_TARNAME}") +set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") +set(CPACK_RPM_PACKAGE_LICENSE "GPL") +set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL}) +set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils") +set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}") +#set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils") + +if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") +endif() + +include(CPack) diff --git a/3rdparty/libiconv/config.h.cmake.in b/3rdparty/libiconv/config.h.cmake.in new file mode 100644 index 00000000..1137ef93 --- /dev/null +++ b/3rdparty/libiconv/config.h.cmake.in @@ -0,0 +1,926 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to the number of bits in type 'ptrdiff_t'. */ +#cmakedefine BITSIZEOF_PTRDIFF_T @BITSIZEOF_PTRDIFF_T@ + +/* Define to the number of bits in type 'sig_atomic_t'. */ +#cmakedefine BITSIZEOF_SIG_ATOMIC_T @BITSIZEOF_SIG_ATOMIC_T@ + +/* Define to the number of bits in type 'size_t'. */ +#cmakedefine BITSIZEOF_SIZE_T @BITSIZEOF_SIZE_T@ + +/* Define to the number of bits in type 'wchar_t'. */ +#cmakedefine BITSIZEOF_WCHAR_T @BITSIZEOF_WCHAR_T@ + +/* Define to the number of bits in type 'wint_t'. */ +#cmakedefine BITSIZEOF_WINT_T @BITSIZEOF_WINT_T@ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#cmakedefine CRAY_STACKSEG_END @CRAY_STACKSEG_END@ + +/* Define to 1 if using `alloca.c'. */ +#cmakedefine C_ALLOCA 1 + +/* Define to 1 if // is a file system root distinct from /. */ +#cmakedefine DOUBLE_SLASH_IS_DISTINCT_ROOT 1 + +/* Define as good substitute value for EILSEQ. */ +#cmakedefine EILSEQ @ELISEQ@ + +/* Define to 1 to enable a few rarely used encodings. */ +#cmakedefine ENABLE_EXTRA 1 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#cmakedefine ENABLE_NLS 1 + +/* Define to 1 if the package shall run at any location in the file system. */ +#cmakedefine ENABLE_RELOCATABLE 1 + +/* Define to 1 if realpath() can malloc memory, always gives an absolute path, + and handles trailing slash correctly. */ +#cmakedefine FUNC_REALPATH_WORKS 1 + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module canonicalize-lgpl shall be considered present. */ +#cmakedefine GNULIB_CANONICALIZE_LGPL 1 + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module sigpipe shall be considered present. */ +#cmakedefine GNULIB_SIGPIPE 1 + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module strerror shall be considered present. */ +#cmakedefine GNULIB_STRERROR 1 + +/* Define to 1 when the gnulib module canonicalize_file_name should be tested. + */ +#cmakedefine GNULIB_TEST_CANONICALIZE_FILE_NAME @GNULIB_TEST_CANONICALIZE_FILE_NAME@ + +/* Define to 1 when the gnulib module environ should be tested. */ +#cmakedefine GNULIB_TEST_ENVIRON 1 + +/* Define to 1 when the gnulib module lstat should be tested. */ +#cmakedefine GNULIB_TEST_LSTAT 1 + +/* Define to 1 when the gnulib module read should be tested. */ +#cmakedefine GNULIB_TEST_READ 1 + +/* Define to 1 when the gnulib module readlink should be tested. */ +#cmakedefine GNULIB_TEST_READLINK 1 + +/* Define to 1 when the gnulib module realpath should be tested. */ +#cmakedefine GNULIB_TEST_REALPATH 1 + +/* Define to 1 when the gnulib module sigprocmask should be tested. */ +#cmakedefine GNULIB_TEST_SIGPROCMASK 1 + +/* Define to 1 when the gnulib module stat should be tested. */ +#cmakedefine GNULIB_TEST_STAT 1 + +/* Define to 1 when the gnulib module strerror should be tested. */ +#cmakedefine GNULIB_TEST_STRERROR 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#cmakedefine HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#cmakedefine HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +#cmakedefine HAVE_CANONICALIZE_FILE_NAME 1 + +/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#cmakedefine HAVE_CFLOCALECOPYCURRENT 1 + +/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#cmakedefine HAVE_CFPREFERENCESCOPYAPPVALUE 1 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#cmakedefine HAVE_DCGETTEXT 1 + +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_CLEARERR_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_FEOF_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FERROR_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FFLUSH_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FGETS_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FPUTC_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FPUTS_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FREAD_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_FWRITE_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_GETCHAR_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_GETC_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `program_invocation_name', and + to 0 if you don't. */ +#cmakedefine HAVE_DECL_PROGRAM_INVOCATION_NAME 1 + +/* Define to 1 if you have the declaration of `program_invocation_short_name', + and to 0 if you don't. */ +#cmakedefine HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#cmakedefine HAVE_DECL_PUTCHAR_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_PUTC_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't. + */ +#cmakedefine HAVE_DECL_SETENV 1 + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H 1 + +/* Define if you have the declaration of environ. */ +#cmakedefine HAVE_ENVIRON_DECL 1 + +/* Define to 1 if you have the `getcwd' function. */ +#cmakedefine HAVE_GETCWD 1 + +/* Define to 1 if you have the `getc_unlocked' function. */ +#cmakedefine HAVE_GETC_UNLOCKED 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#cmakedefine HAVE_GETTEXT 1 + +/* Define if you have the iconv() function and it works. */ +#cmakedefine HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define if you have and nl_langinfo(CODESET). */ +#cmakedefine HAVE_LANGINFO_CODESET 1 + +/* Define to 1 if the system has the type `long long int'. */ +#cmakedefine HAVE_LONG_LONG_INT 1 + +/* Define to 1 if you have the `lstat' function. */ +#cmakedefine HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MACH_O_DYLD_H 1 + +/* Define to 1 if you have the `mbrtowc' function. */ +#cmakedefine HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `mbsinit' function. */ +#cmakedefine HAVE_MBSINIT 1 + +/* Define to 1 if declares mbstate_t. */ +#cmakedefine HAVE_MBSTATE_T 1 + +/* Define to 1 if you have the `memmove' function. */ +#cmakedefine HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define to 1 if atoll is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_ATOLL 1 + +/* Define to 1 if canonicalize_file_name is declared even after undefining + macros. */ +#cmakedefine HAVE_RAW_DECL_CANONICALIZE_FILE_NAME 1 + +/* Define to 1 if chown is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_CHOWN 1 + +/* Define to 1 if dprintf is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_DPRINTF 1 + +/* Define to 1 if dup2 is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_DUP2 1 + +/* Define to 1 if dup3 is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_DUP3 1 + +/* Define to 1 if endusershell is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_ENDUSERSHELL 1 + +/* Define to 1 if environ is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_ENVIRON 1 + +/* Define to 1 if euidaccess is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_EUIDACCESS 1 + +/* Define to 1 if faccessat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FACCESSAT 1 + +/* Define to 1 if fchdir is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FCHDIR 1 + +/* Define to 1 if fchmodat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FCHMODAT 1 + +/* Define to 1 if fchownat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FCHOWNAT 1 + +/* Define to 1 if fcntl is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FCNTL 1 + +/* Define to 1 if ffsl is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FFSL 1 + +/* Define to 1 if ffsll is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FFSLL 1 + +/* Define to 1 if fpurge is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FPURGE 1 + +/* Define to 1 if fseeko is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FSEEKO 1 + +/* Define to 1 if fstatat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FSTATAT 1 + +/* Define to 1 if fsync is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FSYNC 1 + +/* Define to 1 if ftello is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FTELLO 1 + +/* Define to 1 if ftruncate is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FTRUNCATE 1 + +/* Define to 1 if futimens is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_FUTIMENS 1 + +/* Define to 1 if getcwd is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETCWD 1 + +/* Define to 1 if getdelim is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETDELIM 1 + +/* Define to 1 if getdomainname is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETDOMAINNAME 1 + +/* Define to 1 if getdtablesize is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETDTABLESIZE 1 + +/* Define to 1 if getgroups is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETGROUPS 1 + +/* Define to 1 if gethostname is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETHOSTNAME 1 + +/* Define to 1 if getline is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETLINE 1 + +/* Define to 1 if getloadavg is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETLOADAVG 1 + +/* Define to 1 if getlogin is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETLOGIN 1 + +/* Define to 1 if getlogin_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETLOGIN_R 1 + +/* Define to 1 if getpagesize is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETPAGESIZE 1 + +/* Define to 1 if getsubopt is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETSUBOPT 1 + +/* Define to 1 if getusershell is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GETUSERSHELL 1 + +/* Define to 1 if grantpt is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GRANTPT 1 + +/* Define to 1 if group_member is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_GROUP_MEMBER 1 + +/* Define to 1 if initstat_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_INITSTAT_R 1 + +/* Define to 1 if lchmod is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LCHMOD 1 + +/* Define to 1 if lchown is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LCHOWN 1 + +/* Define to 1 if link is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LINK 1 + +/* Define to 1 if linkat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LINKAT 1 + +/* Define to 1 if lseek is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LSEEK 1 + +/* Define to 1 if lstat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_LSTAT 1 + +/* Define to 1 if memmem is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MEMMEM 1 + +/* Define to 1 if mempcpy is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MEMPCPY 1 + +/* Define to 1 if memrchr is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MEMRCHR 1 + +/* Define to 1 if mkdirat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKDIRAT 1 + +/* Define to 1 if mkdtemp is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKDTEMP 1 + +/* Define to 1 if mkfifo is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKFIFO 1 + +/* Define to 1 if mkfifoat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKFIFOAT 1 + +/* Define to 1 if mknod is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKNOD 1 + +/* Define to 1 if mknodat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKNODAT 1 + +/* Define to 1 if mkostemp is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKOSTEMP 1 + +/* Define to 1 if mkostemps is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKOSTEMPS 1 + +/* Define to 1 if mkstemp is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKSTEMP 1 + +/* Define to 1 if mkstemps is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_MKSTEMPS 1 + +/* Define to 1 if openat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_OPENAT 1 + +/* Define to 1 if pipe is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PIPE 1 + +/* Define to 1 if pipe2 is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PIPE2 1 + +/* Define to 1 if popen is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_POPEN 1 + +/* Define to 1 if pread is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PREAD 1 + +/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PTHREAD_SIGMASK 1 + +/* Define to 1 if ptsname is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PTSNAME 1 + +/* Define to 1 if pwrite is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_PWRITE 1 + +/* Define to 1 if random_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_RANDOM_R 1 + +/* Define to 1 if rawmemchr is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_RAWMEMCHR 1 + +/* Define to 1 if readlink is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_READLINK 1 + +/* Define to 1 if readlinkat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_READLINKAT 1 + +/* Define to 1 if realpath is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_REALPATH 1 + +/* Define to 1 if renameat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_RENAMEAT 1 + +/* Define to 1 if rmdir is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_RMDIR 1 + +/* Define to 1 if rpmatch is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_RPMATCH 1 + +/* Define to 1 if setenv is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SETENV 1 + +/* Define to 1 if setstate_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SETSTATE_R 1 + +/* Define to 1 if setusershell is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SETUSERSHELL 1 + +/* Define to 1 if sigaction is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGACTION 1 + +/* Define to 1 if sigaddset is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGADDSET 1 + +/* Define to 1 if sigdelset is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGDELSET 1 + +/* Define to 1 if sigemptyset is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGEMPTYSET 1 + +/* Define to 1 if sigfillset is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGFILLSET 1 + +/* Define to 1 if sigismember is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGISMEMBER 1 + +/* Define to 1 if sigpending is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGPENDING 1 + +/* Define to 1 if sigprocmask is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SIGPROCMASK 1 + +/* Define to 1 if sleep is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SLEEP 1 + +/* Define to 1 if snprintf is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SNPRINTF 1 + +/* Define to 1 if srandom_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SRANDOM_R 1 + +/* Define to 1 if stat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STAT 1 + +/* Define to 1 if stpcpy is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STPCPY 1 + +/* Define to 1 if stpncpy is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STPNCPY 1 + +/* Define to 1 if strcasestr is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRCASESTR 1 + +/* Define to 1 if strchrnul is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRCHRNUL 1 + +/* Define to 1 if strdup is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRDUP 1 + +/* Define to 1 if strerror_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRERROR_R 1 + +/* Define to 1 if strncat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRNCAT 1 + +/* Define to 1 if strndup is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRNDUP 1 + +/* Define to 1 if strnlen is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRNLEN 1 + +/* Define to 1 if strpbrk is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRPBRK 1 + +/* Define to 1 if strsep is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRSEP 1 + +/* Define to 1 if strsignal is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRSIGNAL 1 + +/* Define to 1 if strtod is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRTOD 1 + +/* Define to 1 if strtok_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRTOK_R 1 + +/* Define to 1 if strtoll is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRTOLL 1 + +/* Define to 1 if strtoull is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRTOULL 1 + +/* Define to 1 if strverscmp is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_STRVERSCMP 1 + +/* Define to 1 if symlink is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SYMLINK 1 + +/* Define to 1 if symlinkat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_SYMLINKAT 1 + +/* Define to 1 if tmpfile is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_TMPFILE 1 + +/* Define to 1 if ttyname_r is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_TTYNAME_R 1 + +/* Define to 1 if unlink is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_UNLINK 1 + +/* Define to 1 if unlinkat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_UNLINKAT 1 + +/* Define to 1 if unlockpt is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_UNLOCKPT 1 + +/* Define to 1 if unsetenv is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_UNSETENV 1 + +/* Define to 1 if usleep is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_USLEEP 1 + +/* Define to 1 if utimensat is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_UTIMENSAT 1 + +/* Define to 1 if vdprintf is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_VDPRINTF 1 + +/* Define to 1 if vsnprintf is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL_VSNPRINTF 1 + +/* Define to 1 if _Exit is declared even after undefining macros. */ +#cmakedefine HAVE_RAW_DECL__EXIT 1 + +/* Define to 1 if you have the `readlink' function. */ +#cmakedefine HAVE_READLINK 1 + +/* Define to 1 if you have the `readlinkat' function. */ +#cmakedefine HAVE_READLINKAT 1 + +/* Define to 1 if you have the `realpath' function. */ +#cmakedefine HAVE_REALPATH 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SEARCH_H 1 + +/* Define to 1 if you have the `setenv' function. */ +#cmakedefine HAVE_SETENV 1 + +/* Define to 1 if you have the `setlocale' function. */ +#cmakedefine HAVE_SETLOCALE 1 + +/* Define to 1 if 'sig_atomic_t' is a signed integer type. */ +#cmakedefine HAVE_SIGNED_SIG_ATOMIC_T 1 + +/* Define to 1 if 'wchar_t' is a signed integer type. */ +#cmakedefine HAVE_SIGNED_WCHAR_T 1 + +/* Define to 1 if 'wint_t' is a signed integer type. */ +#cmakedefine HAVE_SIGNED_WINT_T 1 + +/* Define to 1 if the system has the type `sigset_t'. */ +#cmakedefine HAVE_SIGSET_T 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#cmakedefine HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_BITYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tsearch' function. */ +#cmakedefine HAVE_TSEARCH 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `unsigned long long int'. */ +#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT 1 + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#cmakedefine HAVE_VISIBILITY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_WCHAR_H 1 + +/* Define if you have the 'wchar_t' type. */ +#cmakedefine HAVE_WCHAR_T 1 + +/* Define to 1 if you have the `wcrtomb' function. */ +#cmakedefine HAVE_WCRTOMB 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_WINSOCK2_H 1 + +/* Define to 1 if O_NOATIME works. */ +#define HAVE_WORKING_O_NOATIME @HAVE_WORKING_O_NOATIME@ + +/* Define to 1 if O_NOFOLLOW works. */ +#define HAVE_WORKING_O_NOFOLLOW @HAVE_WORKING_O_NOFOLLOW@ + +/* Define to 1 if the system has the type `_Bool'. */ +#cmakedefine HAVE__BOOL 1 + +/* Define to 1 if you have the `_NSGetExecutablePath' function. */ +#cmakedefine HAVE__NSGETEXECUTABLEPATH 1 + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST @ICONV_CONST@ + +/* Define to the value of ${prefix}, as a string. */ +#cmakedefine INSTALLPREFIX "@INSTALLPREFIX@" + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#cmakedefine LSTAT_FOLLOWS_SLASHED_SYMLINK 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#cmakedefine LT_OBJDIR "@LT_OBJDIR@" + +/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ +#cmakedefine MALLOC_0_IS_NONNULL 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#cmakedefine NO_MINUS_C_MINUS_O 1 + +/* Name of package */ +#define PACKAGE "@PACKAGE@" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'ptrdiff_t'. */ +#cmakedefine PTRDIFF_T_SUFFIX @PTRDIFF_T_SUFFIX@ + +/* Define to 1 if readlink fails to recognize a trailing slash. */ +#cmakedefine READLINK_TRAILING_SLASH_BUG 1 + +/* Define to 1 if stat needs help when passed a directory name with a trailing + slash */ +#cmakedefine REPLACE_FUNC_STAT_DIR 1 + +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#cmakedefine REPLACE_FUNC_STAT_FILE 1 + +/* Define to 1 if strerror(0) does not return a message implying success. */ +#cmakedefine REPLACE_STRERROR_0 1 + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'sig_atomic_t'. */ +#cmakedefine SIG_ATOMIC_T_SUFFIX @SIG_ATOMIC_T_SUFFIX@ + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'size_t'. */ +#cmakedefine SIZE_T_SUFFIX @SIZE_T_SUFFIX@ + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#cmakedefine STACK_DIRECTION @STACK_DIRECTION@ + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +#cmakedefine STAT_MACROS_BROKEN 1 + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 + +/* Define to 1 if strerror_r returns char *. */ +#cmakedefine STRERROR_R_CHAR_P 1 + +/* Define to the prefix of C symbols at the assembler and linker level, either + an underscore or empty. */ +#define USER_LABEL_PREFIX @USER_LABEL_PREFIX@ + +/* Define to 1 if you want getc etc. to use unlocked I/O if available. + Unlocked I/O can improve performance in unithreaded apps, but it is not + safe for multithreaded apps. */ +#cmakedefine USE_UNLOCKED_IO 1 + +/* Version number of package */ +#define VERSION "@VERSION@" + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#cmakedefine WCHAR_T_SUFFIX @WCHAR_T_SUFFIX@ + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#cmakedefine WINT_T_SUFFIX @WINT_T_SUFFIX@ + +/* Define if the machine's byte ordering is little endian. */ +#cmakedefine WORDS_LITTLEENDIAN 1 + +/* Define to 1 if on MINIX. */ +#cmakedefine _MINIX 1 + +/* The _Noreturn keyword of draft C1X. */ +#ifndef _Noreturn +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif + + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#cmakedefine _POSIX_1_SOURCE 2 + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#cmakedefine _POSIX_SOURCE 1 + +/* Define to 500 only on HP-UX. */ +#cmakedefine _XOPEN_SOURCE 500 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +#cmakedefine _ALL_SOURCE 1 +#endif +/* Enable general extensions on MacOS X. */ +#ifndef _DARWIN_C_SOURCE +#cmakedefine _DARWIN_C_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +#cmakedefine _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +#cmakedefine _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +#cmakedefine _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +#cmakedefine __EXTENSIONS__ 1 +#endif + + +/* Define to `int' if doesn't define. */ +#cmakedefine gid_t @gid_t@ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#cmakedefine inline @inline@ +#endif + +/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. + __APPLE__ && __MACH__ test for MacOS X. + __APPLE_CC__ tests for the Apple compiler and its version. + __STDC_VERSION__ tests for the C99 mode. */ +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ +# define __GNUC_STDC_INLINE__ 1 +#endif + +/* Define to a type if does not define. */ +#cmakedefine mbstate_t @mbstate_t@ + +/* Define to the type of st_nlink in struct stat, or a supertype. */ +#cmakedefine nlink_t @nlink_t@ + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#cmakedefine restrict @restrict@ +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define to `unsigned int' if does not define. */ +#cmakedefine size_t @size_t@ + +/* Define as a signed type of the same size as size_t. */ +#cmakedefine ssize_t @ssize_t@ + +/* Define to `int' if doesn't define. */ +#cmakedefine uid_t @uid_t@ + +/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_UNUSED +#endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED + +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif + +/* The __const__ attribute was added in gcc 2.95. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST /* empty */ +#endif + + + +/* On Windows, variables that may be in a DLL must be marked specially. */ +#if defined _MSC_VER && defined _DLL +# define DLL_VARIABLE __declspec (dllimport) +#else +# define DLL_VARIABLE +#endif + diff --git a/3rdparty/libiconv/libiconv-1.15.patch b/3rdparty/libiconv/libiconv-1.15.patch new file mode 100644 index 00000000..cd8deb23 --- /dev/null +++ b/3rdparty/libiconv/libiconv-1.15.patch @@ -0,0 +1,29 @@ +diff -Naur libiconv-1.15.orig/include/iconv.h.build.in libiconv-1.15/include/iconv.h.build.in +--- libiconv-1.15.orig/include/iconv.h.build.in 2017-01-01 15:02:55.000000000 -0800 ++++ libiconv-1.15/include/iconv.h.build.in 2017-09-23 21:04:49.271114700 -0700 +@@ -24,10 +24,12 @@ + + #if @HAVE_VISIBILITY@ && BUILDING_LIBICONV + #define LIBICONV_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBICONV ++#define LIBICONV_DLL_EXPORTED __declspec(dllexport) + #else + #define LIBICONV_DLL_EXPORTED + #endif +-extern LIBICONV_DLL_EXPORTED @DLL_VARIABLE@ int _libiconv_version; /* Likewise */ ++extern LIBICONV_DLL_EXPORTED int _libiconv_version; /* Likewise */ + + /* We would like to #include any system header file which could define + iconv_t, 1. in order to eliminate the risk that the user gets compilation +diff -Naur libiconv-1.15.orig/libcharset/include/localcharset.h.build.in libiconv-1.15/libcharset/include/localcharset.h.build.in +--- libiconv-1.15.orig/libcharset/include/localcharset.h.build.in 2017-01-01 15:03:39.000000000 -0800 ++++ libiconv-1.15/libcharset/include/localcharset.h.build.in 2017-09-23 21:04:49.271114700 -0700 +@@ -20,6 +20,8 @@ + + #if @HAVE_VISIBILITY@ && BUILDING_LIBCHARSET + #define LIBCHARSET_DLL_EXPORTED __attribute__((__visibility__("default"))) ++#elif defined _MSC_VER && BUILDING_LIBCHARSET ++#define LIBCHARSET_DLL_EXPORTED __declspec(dllexport) + #else + #define LIBCHARSET_DLL_EXPORTED + #endif diff --git a/3rdparty/libiconv/libiconv-config.cmake.in b/3rdparty/libiconv/libiconv-config.cmake.in new file mode 100644 index 00000000..39eff3ae --- /dev/null +++ b/3rdparty/libiconv/libiconv-config.cmake.in @@ -0,0 +1,12 @@ +set(libiconv_VERSION "@VERSION@") +set(libiconv_VERSION_MAJOR "@VERSION_MAJOR@") +set(libiconv_VERSION_MINOR "@VERSION_MINOR@") + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/libiconv-export.cmake") + +set(libiconv_DEFINITIONS "") +set(libiconv_INCLUDE_DIRS "") +set(libiconv_LIBRARY_DIRS "") +set(libiconv_LIBRARIES "libiconv::libiconv") diff --git a/3rdparty/libxml2/CMakeLists.txt b/3rdparty/libxml2/CMakeLists.txt new file mode 100644 index 00000000..71c50e8a --- /dev/null +++ b/3rdparty/libxml2/CMakeLists.txt @@ -0,0 +1,15 @@ +include(ExternalProject) + +list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_INSTALL_PREFIX}) + +ExternalProject_Add( + libxml2 + DEPENDS libiconv zlib + #GIT_REPOSITORY git://git.gnome.org/libxml2 + #GIT_TAG v2.9.5 + URL https://github.com/roboticslibrary/libxml2/archive/patch.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/libxml2-2.9.5.tar.gz + #URL_MD5 5ce0da9bdaa267b40c4ca36d35363b8b + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/libxslt/CMakeLists.txt b/3rdparty/libxslt/CMakeLists.txt new file mode 100644 index 00000000..e7bfa7d3 --- /dev/null +++ b/3rdparty/libxslt/CMakeLists.txt @@ -0,0 +1,15 @@ +include(ExternalProject) + +list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_INSTALL_PREFIX}) + +ExternalProject_Add( + libxslt + DEPENDS libxml2 + #GIT_REPOSITORY git://git.gnome.org/libxslt + #GIT_TAG v1.1.30 + URL https://github.com/roboticslibrary/libxslt/archive/patch.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/libxslt-1.1.30.tar.gz + #URL_MD5 d41d8cd98f00b204e9800998ecf8427e + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/nlopt/CMakeLists.txt b/3rdparty/nlopt/CMakeLists.txt new file mode 100644 index 00000000..6792dd79 --- /dev/null +++ b/3rdparty/nlopt/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(nlopt) + +include(ExternalProject) + +ExternalProject_Add( + nlopt + #GIT_REPOSITORY git://github.com/stevengj/nlopt.git + #GIT_TAG 2.4.2 + URL https://github.com/roboticslibrary/nlopt/archive/patch.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/nlopt-2.4.2.zip + #URL_MD5 b2b4f009759c5e33e4c27d6c980419d7 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} -DBUILD_SHARED_LIBS=ON -DNLOPT_GUILE=OFF -DNLOPT_MATLAB=OFF -DNLOPT_OCTAVE=OFF -DNLOPT_PYTHON=OFF + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/ode/CMakeLists.txt b/3rdparty/ode/CMakeLists.txt new file mode 100644 index 00000000..9f6929fe --- /dev/null +++ b/3rdparty/ode/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(ode) + +include(ExternalProject) + +ExternalProject_Add( + ode + URL https://bitbucket.org/roboticslibrary/ode/get/patch-cmake-0.15.x.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/ode-0.15.2.tar.bz2 + #URL_MD5 c235fbbbc2c2381b8b3259a8328f7826 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} -DODE_WITH_DEMOS=OFF -DODE_WITH_TESTS=OFF + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/patch.exe.manifest b/3rdparty/patch.exe.manifest new file mode 100644 index 00000000..63dce3b5 --- /dev/null +++ b/3rdparty/patch.exe.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/3rdparty/pqp/CMakeLists.txt b/3rdparty/pqp/CMakeLists.txt new file mode 100644 index 00000000..f3cd2e43 --- /dev/null +++ b/3rdparty/pqp/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(pqp) + +include(ExternalProject) + +ExternalProject_Add( + pqp + URL https://github.com/roboticslibrary/PQP/archive/patch.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/pqp-1.3.tar.gz + #URL_MD5 f710e24a62db763d61d08667439d46fd + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/simage/CMakeLists.txt b/3rdparty/simage/CMakeLists.txt new file mode 100644 index 00000000..c115a530 --- /dev/null +++ b/3rdparty/simage/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(simage) + +include(ExternalProject) + +ExternalProject_Add( + simage + #HG_REPOSITORY https://bitbucket.org/Coin3D/simage + #HG_TAG default + URL https://bitbucket.org/Coin3D/simage/get/default.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/default.tar.bz2 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/solid/CMakeLists.txt b/3rdparty/solid/CMakeLists.txt new file mode 100644 index 00000000..8877733e --- /dev/null +++ b/3rdparty/solid/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(solid) + +include(ExternalProject) + +ExternalProject_Add( + solid + URL https://github.com/dtecta/solid3/archive/master.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/solid-3.5.8.zip + #URL_MD5 d5fb3dcfcc0cf322abaac9109959d4d4 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/soqt/CMakeLists.txt b/3rdparty/soqt/CMakeLists.txt new file mode 100644 index 00000000..6c266cbe --- /dev/null +++ b/3rdparty/soqt/CMakeLists.txt @@ -0,0 +1,27 @@ +include(ExternalProject) + +ExternalProject_Add( + sogui + #HG_REPOSITORY https://bitbucket.org/Coin3D/sogui + #HG_TAG default + URL https://bitbucket.org/Coin3D/sogui/get/default.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/default.tar.bz2 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) + +list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_INSTALL_PREFIX}) + +ExternalProject_Add( + soqt + DEPENDS sogui coin + #HG_REPOSITORY https://bitbucket.org/Coin3D/soqt + #HG_TAG default + URL https://bitbucket.org/Coin3D/soqt/get/default.tar.bz2 + #URL ${CMAKE_CURRENT_SOURCE_DIR}/default.tar.bz2 + PATCH_COMMAND + ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/sogui-prefix/src/sogui /src/Inventor/Qt/common + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt new file mode 100644 index 00000000..22a4938d --- /dev/null +++ b/3rdparty/zlib/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(zlib) + +include(ExternalProject) + +ExternalProject_Add( + zlib + #GIT_REPOSITORY git://github.com/madler/zlib.git + #GIT_TAG v1.2.8 + URL https://github.com/roboticslibrary/zlib/archive/patch.zip + #URL ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.8.tar.gz + #URL_MD5 44d667c142d7cda120332623eab69f40 + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION} + INSTALL_DIR ${CMAKE_INSTALL_PREFIX} +) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0af9fd3..56f1e345 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,269 +2,119 @@ cmake_minimum_required(VERSION 2.8.11) project(rl) -enable_testing() - -include(CMakeDependentOption) -include(GNUInstallDirs) - set(VERSION_MAJOR 0) -set(VERSION_MINOR 6) -set(VERSION_PATCH 2) +set(VERSION_MINOR 7) +set(VERSION_PATCH 0) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules) - -set(Boost_ADDITIONAL_VERSIONS "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47") +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -option(BUILD_DEMOS "Build demos" TRUE) -option(BUILD_EXTRAS "Build extras" TRUE) -option(BUILD_RL_MATH "Build RL::MATH" TRUE) -option(BUILD_RL_UTIL "Build RL::UTIL" TRUE) -option(BUILD_RL_XML "Build RL::XML" TRUE) -option(BUILD_TESTS "Build tests" TRUE) - -cmake_dependent_option(BUILD_RL_HAL "Build RL::HAL" ON "BUILD_RL_MATH;BUILD_RL_UTIL" OFF) -cmake_dependent_option(BUILD_RL_KIN "Build RL::KIN" ON "BUILD_RL_MATH;BUILD_RL_XML" OFF) -cmake_dependent_option(BUILD_RL_MDL "Build RL::MDL" ON "BUILD_RL_MATH;BUILD_RL_XML" OFF) -cmake_dependent_option(BUILD_RL_SG "Build RL::SG" ON "BUILD_RL_MATH;BUILD_RL_UTIL;BUILD_RL_XML" OFF) - -cmake_dependent_option(BUILD_RL_PLAN "Build RL::PLAN" ON "BUILD_RL_KIN;BUILD_RL_MATH;BUILD_RL_MDL;BUILD_RL_SG;BUILD_RL_UTIL;BUILD_RL_XML" OFF) +include(CheckCXXCompilerFlag) +include(CMakeDependentOption) +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - add_definitions(-DEIGEN_DONT_ALIGN) -endif(CMAKE_SIZEOF_VOID_P EQUAL 4) +if(NOT CMAKE_VERSION VERSION_LESS 3.1) + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +else() + check_cxx_compiler_flag("-std=c++0x" HAS_CXX_COMPILER_FLAG_STDCXX0X) + if(HAS_CXX_COMPILER_FLAG_STDCXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + endif() + check_cxx_compiler_flag("-std=c++11" HAS_CXX_COMPILER_FLAG_STDCXX11) + if(HAS_CXX_COMPILER_FLAG_STDCXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() +endif() if(WIN32) add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES - -D_WIN32_WINNT=0x400 + -D_WIN32_WINNT=0x501 -DNOMINMAX + -DWIN32_LEAN_AND_MEAN ) -endif(WIN32) - -include_directories(${rl_SOURCE_DIR}/src) - -if(BUILD_RL_MATH) - add_subdirectory(src/rl/math) - if(BUILD_DEMOS) - add_subdirectory(demos/rlDenavitHartenbergDemo) - add_subdirectory(demos/rlInterpolatorDemo) - add_subdirectory(demos/rlKalmanDemo) - add_subdirectory(demos/rlPcaDemo) - add_subdirectory(demos/rlQuaternionDemo) - #add_subdirectory(demos/rlRodriguesDemo) - add_subdirectory(demos/rlSpatialDemo) - add_subdirectory(demos/rlTrapezoidalVelocityDemo) - endif(BUILD_DEMOS) - set(RL_MATH_FOUND TRUE) - set(TARGETS ${TARGETS} rlmath) -endif(BUILD_RL_MATH) - -if(BUILD_RL_UTIL) - add_subdirectory(src/rl/util) - if(BUILD_DEMOS) - add_subdirectory(demos/rlThreadsDemo) - add_subdirectory(demos/rlTimerDemo) - endif(BUILD_DEMOS) - set(RL_UTIL_FOUND TRUE) - set(TARGETS ${TARGETS} rlutil) -endif(BUILD_RL_UTIL) +endif() -if(BUILD_RL_XML) - add_subdirectory(src/rl/xml) - if(BUILD_DEMOS) - add_subdirectory(demos/rlLoadXmlDemo) - endif(BUILD_DEMOS) - set(RL_XML_FOUND TRUE) - set(TARGETS ${TARGETS} rlxml) -endif(BUILD_RL_XML) +set(Boost_ADDITIONAL_VERSIONS "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57") -if(BUILD_RL_KIN) - add_subdirectory(src/rl/kin) - if(BUILD_DEMOS) - add_subdirectory(demos/rlJacobianDemo) - add_subdirectory(demos/rlPumaDemo) - endif(BUILD_DEMOS) - if(BUILD_TESTS) - add_subdirectory(tests/rlInverseKinematicsTest) - endif(BUILD_TESTS) - set(RL_KIN_FOUND TRUE) - set(TARGETS ${TARGETS} rlkin) -endif(BUILD_RL_KIN) +include(Qt4AutomocMocOptionsBoost) -if(BUILD_RL_MDL) - add_subdirectory(src/rl/mdl) - if(BUILD_DEMOS) - add_subdirectory(demos/rlDynamics1Demo) - add_subdirectory(demos/rlDynamics2Demo) - add_subdirectory(demos/rlInversePositionDemo) - endif(BUILD_DEMOS) - if(BUILD_TESTS) - add_subdirectory(tests/rlDynamicsTest) - endif(BUILD_TESTS) - set(RL_MDL_FOUND TRUE) - set(TARGETS ${TARGETS} rlmdl) -endif(BUILD_RL_MDL) +option(BUILD_DEMOS "Build demos" ON) +option(BUILD_DOCUMENTATION "Build documentation" OFF) +option(BUILD_EXTRAS "Build extras" ON) +option(BUILD_RL_MATH "Build mathematics component" ON) +option(BUILD_RL_UTIL "Build utility component" ON) +option(BUILD_RL_XML "Build XML abstraction layer component" ON) +option(BUILD_TESTS "Build tests" ON) -if(BUILD_RL_HAL) - add_subdirectory(src/rl/hal) - if(BUILD_DEMOS) - add_subdirectory(demos/rlAxisControllerDemo) - add_subdirectory(demos/rlCameraDemo) - add_subdirectory(demos/rlGripperDemo) - add_subdirectory(demos/rlLaserDemo) - add_subdirectory(demos/rlRangeSensorDemo) - add_subdirectory(demos/rlSixAxisForceTorqueSensorDemo) - endif(BUILD_DEMOS) - if(BUILD_TESTS) - add_subdirectory(tests/rlHalEndianTest) - endif(BUILD_TESTS) - set(RL_HAL_FOUND TRUE) - set(TARGETS ${TARGETS} rlhal) -endif(BUILD_RL_HAL) +cmake_dependent_option(BUILD_RL_HAL "Build hardware abstraction layer component" ON "BUILD_RL_MATH;BUILD_RL_UTIL" OFF) +cmake_dependent_option(BUILD_RL_KIN "Build Denavit-Hartenberg kinematics component" ON "BUILD_RL_MATH;BUILD_RL_XML" OFF) +cmake_dependent_option(BUILD_RL_MDL "Build rigid body kinematics and dynamics component" ON "BUILD_RL_MATH;BUILD_RL_XML" OFF) +cmake_dependent_option(BUILD_RL_SG "Build scene graph abstraction component" ON "BUILD_RL_MATH;BUILD_RL_UTIL;BUILD_RL_XML" OFF) -if(BUILD_RL_SG) - add_subdirectory(src/rl/sg) - if(BUILD_DEMOS) - add_subdirectory(demos/rlCollisionDemo) - add_subdirectory(demos/rlViewDemo) - endif(BUILD_DEMOS) - set(RL_SG_FOUND TRUE) - set(TARGETS ${TARGETS} rlsg) -endif(BUILD_RL_SG) +cmake_dependent_option(BUILD_RL_PLAN "Build path planning component" ON "BUILD_RL_KIN;BUILD_RL_MATH;BUILD_RL_MDL;BUILD_RL_SG;BUILD_RL_UTIL;BUILD_RL_XML" OFF) -if(BUILD_RL_KIN AND BUILD_RL_SG) - if(BUILD_DEMOS) - add_subdirectory(demos/rlCoachKin) - endif(BUILD_DEMOS) -endif(BUILD_RL_KIN AND BUILD_RL_SG) +if(WIN32 AND CMAKE_VERSION VERSION_LESS 3.4) + set(BUILD_SHARED_LIBS OFF) +elseif(WIN32 AND NOT CMAKE_VERSION VERSION_LESS 3.4) + option(BUILD_SHARED_LIBS "Build shared libraries" OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ${BUILD_SHARED_LIBS}) +else() + option(BUILD_SHARED_LIBS "Build shared libraries" ON) +endif() -if(BUILD_RL_MDL AND BUILD_RL_SG) - if(BUILD_DEMOS) - add_subdirectory(demos/rlCoachMdl) - endif(BUILD_DEMOS) -endif(BUILD_RL_MDL AND BUILD_RL_SG) +option(USE_QT5 "Prefer Qt5 over Qt4 if available" ON) -if(BUILD_RL_PLAN) - add_subdirectory(src/rl/plan) - if(BUILD_DEMOS) - add_subdirectory(demos/rlPlanDemo) - add_subdirectory(demos/rlPrmDemo) - endif(BUILD_DEMOS) - if(BUILD_TESTS) - add_subdirectory(tests/rlPrmTest) - endif(BUILD_TESTS) - set(RL_PLAN_FOUND TRUE) - set(TARGETS ${TARGETS} rlplan) -endif(BUILD_RL_PLAN) +include_directories(BEFORE src/rl/std) +add_subdirectory(src/rl/std) +add_subdirectory(src) add_subdirectory(examples) -if(BUILD_EXTRAS) - add_subdirectory(extras/wrlview) -endif(BUILD_EXTRAS) - -if(UNIX) - install(FILES robotics-library.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps COMPONENT demos) -endif(UNIX) - -find_package(Doxygen) -find_package(LATEX) - -if(DOXYGEN_FOUND) - option(BUILD_DOCUMENTATION "Build documentation" FALSE) - configure_file(${rl_SOURCE_DIR}/Doxyfile.in ${rl_BINARY_DIR}/Doxyfile) - if(BUILD_DOCUMENTATION) - add_custom_target(doc ALL ${DOXYGEN_EXECUTABLE} ${rl_BINARY_DIR}/Doxyfile) - else(BUILD_DOCUMENTATION) - add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${rl_BINARY_DIR}/Doxyfile) - endif(BUILD_DOCUMENTATION) - file(MAKE_DIRECTORY ${rl_BINARY_DIR}/doc) - install(DIRECTORY ${rl_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation) -endif(DOXYGEN_FOUND) - -set(CPACK_COMPONENT_DEMOS_DEPENDS examples libraries) -set(CPACK_COMPONENT_DEMOS_DISPLAY_NAME "Demos") -set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") -set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples") -set(CPACK_COMPONENT_EXTRAS_DISPLAY_NAME "Extras") -set(CPACK_COMPONENT_HEADERS_DEPENDS libraries) -set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers") -set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") -set(CPACK_COMPONENTS_ALL demos documentation examples extras headers libraries) -set(CPACK_DEB_COMPONENT_INSTALL ON) -set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.roboticslibrary.org/") -set(CPACK_DEBIAN_PACKAGE_NAME "librl") -set(CPACK_DEBIAN_PACKAGE_SECTION "devel") -set( - CPACK_NSIS_MENU_LINKS - "http://www.roboticslibrary.org/" "RL" - "https://github.com/roboticslibrary" "RL on GitHub" - "https://launchpad.net/roblib" "RL on Launchpad" - "http://sourceforge.net/projects/roblib" "RL on SourceForge" - "http://www.youtube.com/roboticslibrary" "RL on YouTube" -) -set(CPACK_NSIS_PACKAGE_NAME "Robotics Library ${VERSION}") -set(CPACK_NSIS_URL_INFO_ABOUT ${CPACK_DEBIAN_PACKAGE_HOMEPAGE}) -set(CPACK_PACKAGE_CONTACT "Robotics Library Team ") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Robotics Library is a self-contained C++ library for robot kinematics, visualization, motion planning, and control.") -set(CPACK_PACKAGE_DISPLAY_NAME "Robotics Library ${VERSION}") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "rl-${VERSION}") -set(CPACK_PACKAGE_NAME "rl") -set(CPACK_PACKAGE_VERSION ${VERSION}) -set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) -set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) -set(CPACK_RPM_COMPONENT_INSTALL ON) -set(CPACK_RPM_demos_PACKAGE_REQUIRES "rl-examples") -set(CPACK_RPM_headers_PACKAGE_SUGGESTS "rl-documentation rl-libraries") -set(CPACK_RPM_libraries_PACKAGE_SUGGESTS "rl-demos rl-examples") -set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) -set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") -set(CPACK_RPM_PACKAGE_LICENSE "BSD") -set(CPACK_RPM_PACKAGE_NAME "rl") -set(CPACK_RPM_PACKAGE_SUMMARY "Robotics Library") -set(CPACK_RPM_PACKAGE_URL ${CPACK_DEBIAN_PACKAGE_HOMEPAGE}) - -if(WIN32) - if(CMAKE_CL_64) - set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") # http://public.kitware.com/Bug/view.php?id=14211 - endif() +if(BUILD_DEMOS) + add_subdirectory(demos) endif() -string(REPLACE ";" " -" CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}") -string(REPLACE ";" " -" CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}") +if(BUILD_TESTS) + enable_testing() + add_subdirectory(tests) +endif() -include(CPack) +add_subdirectory(doc) -include(CMakePackageConfigHelpers) +foreach(TARGET ${TARGETS}) + list(APPEND RL_LIBRARIES "rl::${TARGET}") +endforeach(TARGET) -set(RL_LIBRARIES ${TARGETS}) -set(INTERFACE_INCLUDE_DIRECTORIES ${rl_SOURCE_DIR}/src) +set(RL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src/rl/std) configure_package_config_file( - ${CMAKE_CURRENT_SOURCE_DIR}/rl-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/rl-config.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/rl + rl-config.cmake.in rl-config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rl-${VERSION} ) -export(TARGETS ${TARGETS} FILE ${CMAKE_CURRENT_BINARY_DIR}/rl-export.cmake) +export( + TARGETS ${TARGETS} + NAMESPACE rl:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/rl-export.cmake +) -set(INTERFACE_INCLUDE_DIRECTORIES \${PACKAGE_PREFIX_DIR}/include) +set(RL_INCLUDE_DIRS \${PACKAGE_PREFIX_DIR}/include/rl-${VERSION}/rl/std) configure_package_config_file( - ${CMAKE_CURRENT_SOURCE_DIR}/rl-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/rl-config-install.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/rl + rl-config.cmake.in rl-config-install.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rl-${VERSION} ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/rl-config-install.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/rl + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rl-${VERSION} RENAME rl-config.cmake + COMPONENT development ) write_basic_package_version_file( @@ -275,13 +125,26 @@ write_basic_package_version_file( install( FILES ${CMAKE_CURRENT_BINARY_DIR}/rl-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/rl + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rl-${VERSION} + COMPONENT development ) if(DEFINED TARGETS) install( EXPORT rl - DESTINATION ${CMAKE_INSTALL_LIBDIR}/rl + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rl-${VERSION} + NAMESPACE rl:: FILE rl-export.cmake + COMPONENT development ) endif() + +if(BUILD_EXTRAS) + add_subdirectory(extras) +endif() + +set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT system) +include(InstallRequiredSystemLibraries) + +include(CPackConfig) +include(CPack) diff --git a/Doxyfile.in b/Doxyfile.in deleted file mode 100644 index 1262cb13..00000000 --- a/Doxyfile.in +++ /dev/null @@ -1,1749 +0,0 @@ -# Doxyfile 1.7.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "Robotics Library" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = "${VERSION}" - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = "${CMAKE_CURRENT_BINARY_DIR}/doc" - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = "${CMAKE_CURRENT_SOURCE_DIR}/src/rl" - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = "${CMAKE_CURRENT_SOURCE_DIR}/src/rl" - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is adviced to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the -# mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = "${LATEX_COMPILER}" - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = "${MAKEINDEX_COMPILER}" - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = amsmath,amssymb - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = "${PERL_EXECUTABLE}" - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = ${DOXYGEN_DOT_FOUND} - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called Helvetica to the output -# directory and reference it in all dot files that doxygen generates. -# When you want a differently looking font you can specify the font name -# using DOT_FONTNAME. You need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = "${DOXYGEN_DOT_PATH}" - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/LICENSE.GPL b/LICENSE.GPL deleted file mode 100644 index 94a9ed02..00000000 --- a/LICENSE.GPL +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Modules/FindAtidaq.cmake b/Modules/FindAtidaq.cmake deleted file mode 100644 index e253df71..00000000 --- a/Modules/FindAtidaq.cmake +++ /dev/null @@ -1,33 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path( - ATIDAQ_INCLUDE_DIRS - NAMES - atidaq/ftconfig.h - HINTS - $ENV{HOME}/include - /usr/local/include - /usr/include -) - -find_library( - ATIDAQ_LIBRARIES - NAMES - atidaq - HINTS - $ENV{HOME}/lib - /usr/local/lib - /usr/lib -) - -find_package_handle_standard_args( - ATIDAQ - DEFAULT_MSG - ATIDAQ_INCLUDE_DIRS - ATIDAQ_LIBRARIES -) - -mark_as_advanced( - ATIDAQ_INCLUDE_DIRS - ATIDAQ_LIBRARIES -) diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake deleted file mode 100644 index 9f5f87fb..00000000 --- a/Modules/FindBullet.cmake +++ /dev/null @@ -1,171 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - BULLET_INCLUDE_PATHS - $ENV{BULLETDIR}/include/bullet - $ENV{HOME}/include/bullet - /usr/local/include/bullet - /usr/include/bullet - $ENV{ProgramW6432}/bullet*/include/bullet - $ENV{ProgramFiles}/bullet*/include/bullet - $ENV{ProgramW6432}/rl*/include/bullet - $ENV{ProgramFiles}/rl*/include/bullet -) - -file( - GLOB - BULLET_LIBRARY_PATHS - $ENV{BULLETDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/bullet*/lib - $ENV{ProgramFiles}/bullet*/lib - $ENV{ProgramW6432}/rl*/lib - $ENV{ProgramFiles}/rl*/lib -) - -find_path( - BULLET_INCLUDE_DIRS - NAMES - Bullet-C-Api.h - HINTS - ${BULLET_INCLUDE_PATHS} -) - -find_library( - BULLET_COLLISION_LIBRARY_DEBUG - NAMES - bulletcollisiond BulletCollisiond BulletCollision_debug - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_COLLISION_LIBRARY_RELEASE - NAMES - bulletcollision BulletCollision - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_CONVEXDECOMPOSITION_LIBRARY_DEBUG - NAMES - convexdecompositiond ConvexDecompositiond ConvexDecomposition_debug - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_CONVEXDECOMPOSITION_LIBRARY_RELEASE - NAMES - convexdecomposition ConvexDecomposition - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_DYNAMICS_LIBRARY_DEBUG - NAMES - bulletdynamicsd BulletDynamicsd BulletDynamics_debug - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_DYNAMICS_LIBRARY_RELEASE - NAMES - bulletdynamics BulletDynamics - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_MATH_LIBRARY_DEBUG - NAMES - bulletmathd LinearMathd LinearMath_debug - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_MATH_LIBRARY_RELEASE - NAMES - bulletmath LinearMath - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_SOFTBODY_LIBRARY_DEBUG - NAMES - bulletsoftbodyd BulletSoftBodyd BulletSoftBody_debug - HINTS - ${BULLET_LIBRARY_PATHS} -) - -find_library( - BULLET_SOFTBODY_LIBRARY_RELEASE - NAMES - bulletsoftbody BulletSoftBody - HINTS - ${BULLET_LIBRARY_PATHS} -) - -foreach(LIBRARY BULLET_COLLISION_LIBRARY BULLET_CONVEXDECOMPOSITION_LIBRARY BULLET_DYNAMICS_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY) - set(BULLET_LIBRARY ${LIBRARY}) - - if(${LIBRARY}_DEBUG AND NOT ${LIBRARY}_RELEASE) - set(${BULLET_LIBRARY} ${${LIBRARY}_DEBUG}) - endif(${LIBRARY}_DEBUG AND NOT ${LIBRARY}_RELEASE) - - if(${LIBRARY}_RELEASE AND NOT ${LIBRARY}_DEBUG) - set(${BULLET_LIBRARY} ${${LIBRARY}_RELEASE}) - endif(${LIBRARY}_RELEASE AND NOT ${LIBRARY}_DEBUG) - - if(${LIBRARY}_DEBUG AND ${LIBRARY}_RELEASE) - set(${BULLET_LIBRARY} debug ${${LIBRARY}_DEBUG} optimized ${${LIBRARY}_RELEASE}) - endif(${LIBRARY}_DEBUG AND ${LIBRARY}_RELEASE) -endforeach(LIBRARY) - -set( - BULLET_LIBRARIES - ${BULLET_COLLISION_LIBRARY} - ${BULLET_CONVEXDECOMPOSITION_LIBRARY} - ${BULLET_DYNAMICS_LIBRARY} - ${BULLET_MATH_LIBRARY} - ${BULLET_SOFTBODY_LIBRARY} -) - -find_package_handle_standard_args( - Bullet - DEFAULT_MSG - BULLET_INCLUDE_DIRS - BULLET_COLLISION_LIBRARY -# BULLET_CONVEXDECOMPOSITION_LIBRARY - BULLET_DYNAMICS_LIBRARY - BULLET_MATH_LIBRARY - BULLET_SOFTBODY_LIBRARY -) - -mark_as_advanced( - BULLET_INCLUDE_DIRS - BULLET_COLLISION_LIBRARY - BULLET_COLLISION_LIBRARY_DEBUG - BULLET_COLLISION_LIBRARY_RELEASE - BULLET_CONVEXDECOMPOSITION_LIBRARY - BULLET_CONVEXDECOMPOSITION_LIBRARY_DEBUG - BULLET_CONVEXDECOMPOSITION_LIBRARY_RELEASE - BULLET_DYNAMICS_LIBRARY - BULLET_DYNAMICS_LIBRARY_DEBUG - BULLET_DYNAMICS_LIBRARY_RELEASE - BULLET_LIBRARIES - BULLET_MATH_LIBRARY - BULLET_MATH_LIBRARY_DEBUG - BULLET_MATH_LIBRARY_RELEASE - BULLET_SOFTBODY_LIBRARY - BULLET_SOFTBODY_LIBRARY_DEBUG - BULLET_SOFTBODY_LIBRARY_RELEASE -) diff --git a/Modules/FindCgal.cmake b/Modules/FindCgal.cmake deleted file mode 100644 index b68f48c7..00000000 --- a/Modules/FindCgal.cmake +++ /dev/null @@ -1,103 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - CGAL_COMPILER_INCLUDE_PATHS - $ENV{CGALROOT}/include/CGAL/config/* - $ENV{HOME}/include/CGAL/config/* - /usr/local/include/CGAL/config/* - /usr/include/CGAL/config/* - $ENV{ProgramW6432}/CGAL*/include/CGAL/config/* - $ENV{ProgramFiles}/CGAL*/include/CGAL/config/* -) -file( - GLOB - CGAL_INCLUDE_PATHS - $ENV{CGALROOT}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{ProgramW6432}/CGAL*/include - $ENV{ProgramFiles}/CGAL*/include -) -file( - GLOB - CGAL_LIBRARY_PATHS - $ENV{CGALROOT}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/CGAL*/lib - $ENV{ProgramFiles}/CGAL*/lib -) - -find_path( - CGAL_COMPILER_INCLUDE_DIR - NAMES - CGAL/compiler_config.h - HINTS - ${CGAL_COMPILER_INCLUDE_PATHS} - ${CGAL_INCLUDE_PATHS} -) - -find_path( - CGAL_INCLUDE_DIR - NAMES - CGAL/CORE/CORE.h - HINTS - ${CGAL_INCLUDE_PATHS} -) - -find_library( - CGAL_LIBRARY_DEBUG - NAMES - CGALd - cgal-vc100-mt-gd-4.1 cgal-vc100-mt-gd-4.0 cgal-vc100-mt-gd - cgal-vc90-mt-gd-4.1 cgal-vc90-mt-gd-4.0 cgal-vc90-mt-gd - cgal-vc80-mt-gd-4.1 cgal-vc80-mt-gd-4.0 cgal-vc80-mt-gd - cgal-vc71-mt-gd-4.1 cgal-vc71-mt-gd-4.0 cgal-vc71-mt-gd - HINTS - ${CGAL_LIBRARY_PATHS} -) - -find_library( - CGAL_LIBRARY_RELEASE - NAMES - CGAL - cgal-vc100-mt-4.1 cgal-vc100-mt-4.0 cgal-vc100-mt - cgal-vc90-mt-4.1 cgal-vc90-mt-4.0 cgal-vc90-mt - cgal-vc80-mt-4.1 cgal-vc80-mt-4.0 cgal-vc80-mt - cgal-vc71-mt-4.1 cgal-vc71-mt-4.0 cgal-vc71-mt - HINTS - ${CGAL_LIBRARY_PATHS} -) - -if(CGAL_LIBRARY_DEBUG AND NOT CGAL_LIBRARY_RELEASE) - set(CGAL_LIBRARIES ${CGAL_LIBRARY_DEBUG}) -endif(CGAL_LIBRARY_DEBUG AND NOT CGAL_LIBRARY_RELEASE) - -if(CGAL_LIBRARY_RELEASE AND NOT CGAL_LIBRARY_DEBUG) - set(CGAL_LIBRARIES ${CGAL_LIBRARY_RELEASE}) -endif(CGAL_LIBRARY_RELEASE AND NOT CGAL_LIBRARY_DEBUG) - -if(CGAL_LIBRARY_DEBUG AND CGAL_LIBRARY_RELEASE) - set(CGAL_LIBRARIES debug ${CGAL_LIBRARY_DEBUG} optimized ${CGAL_LIBRARY_RELEASE}) -endif(CGAL_LIBRARY_DEBUG AND CGAL_LIBRARY_RELEASE) - -set(CGAL_INCLUDE_DIRS ${CGAL_INCLUDE_DIR} ${CGAL_COMPILER_INCLUDE_DIR}) - -find_package_handle_standard_args( - CGAL - DEFAULT_MSG - CGAL_INCLUDE_DIRS - CGAL_LIBRARIES -) - -mark_as_advanced( - CGAL_COMPILER_INCLUDE_DIR - CGAL_INCLUDE_DIR - CGAL_INCLUDE_DIRS - CGAL_LIBRARIES - CGAL_LIBRARY_DEBUG - CGAL_LIBRARY_RELEASE -) diff --git a/Modules/FindCoin.cmake b/Modules/FindCoin.cmake deleted file mode 100644 index 5bdaa960..00000000 --- a/Modules/FindCoin.cmake +++ /dev/null @@ -1,81 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - COIN_INCLUDE_PATHS - $ENV{COINDIR}/include - $ENV{COIN3DDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include/Coin* - /usr/include - $ENV{SystemDrive}/Coin*/include - $ENV{ProgramW6432}/Coin*/include - $ENV{ProgramFiles}/Coin*/include -) - -file( - GLOB - COIN_LIBRARY_PATHS - $ENV{COINDIR}/lib - $ENV{COIN3DDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{SystemDrive}/Coin*/lib - $ENV{ProgramW6432}/Coin*/lib - $ENV{ProgramFiles}/Coin*/lib -) - -find_path( - COIN_INCLUDE_DIRS - NAMES - Inventor/So.h - HINTS - ${COIN_INCLUDE_PATHS} -) - -find_library( - COIN_LIBRARY_DEBUG - NAMES - Coind coin2d coin3d - HINTS - ${COIN_LIBRARY_PATHS} -) - -find_library( - COIN_LIBRARY_RELEASE - NAMES - Coin coin2 coin3 - HINTS - ${COIN_LIBRARY_PATHS} -) - -set(COIN_DEFINITIONS -DCOIN_NOT_DLL) - -if(COIN_LIBRARY_DEBUG AND NOT COIN_LIBRARY_RELEASE) - set(COIN_LIBRARIES ${COIN_LIBRARY_DEBUG}) -endif(COIN_LIBRARY_DEBUG AND NOT COIN_LIBRARY_RELEASE) - -if(COIN_LIBRARY_RELEASE AND NOT COIN_LIBRARY_DEBUG) - set(COIN_LIBRARIES ${COIN_LIBRARY_RELEASE}) -endif(COIN_LIBRARY_RELEASE AND NOT COIN_LIBRARY_DEBUG) - -if(COIN_LIBRARY_DEBUG AND COIN_LIBRARY_RELEASE) - set(COIN_LIBRARIES debug ${COIN_LIBRARY_DEBUG} optimized ${COIN_LIBRARY_RELEASE}) -endif(COIN_LIBRARY_DEBUG AND COIN_LIBRARY_RELEASE) - -find_package_handle_standard_args( - Coin - DEFAULT_MSG - COIN_INCLUDE_DIRS - COIN_LIBRARIES -) - -mark_as_advanced( - COIN_DEFINITIONS - COIN_INCLUDE_DIRS - COIN_LIBRARIES - COIN_LIBRARY_DEBUG - COIN_LIBRARY_RELEASE -) diff --git a/Modules/FindComedi.cmake b/Modules/FindComedi.cmake deleted file mode 100644 index 721eb40d..00000000 --- a/Modules/FindComedi.cmake +++ /dev/null @@ -1,33 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path( - COMEDI_INCLUDE_DIRS - NAMES - comedilib.h - HINTS - $ENV{HOME}/include - /usr/local/include - /usr/include -) - -find_library( - COMEDI_LIBRARIES - NAMES - comedi - HINTS - $ENV{HOME}/lib - /usr/local/lib - /usr/lib -) - -find_package_handle_standard_args( - Comedi - DEFAULT_MSG - COMEDI_INCLUDE_DIRS - COMEDI_LIBRARIES -) - -mark_as_advanced( - COMEDI_INCLUDE_DIRS - COMEDI_LIBRARIES -) diff --git a/Modules/FindEigen.cmake b/Modules/FindEigen.cmake deleted file mode 100644 index 4df4aa46..00000000 --- a/Modules/FindEigen.cmake +++ /dev/null @@ -1,38 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - EIGEN_INCLUDE_PATHS - $ENV{EIGENDIR} - $ENV{HOME}/include - /usr/local/include/eigen3 - /usr/local/include/eigen* - /usr/local/include - /usr/include/eigen3 - /usr/include/eigen* - /usr/include - /opt/local/include/eigen* - $ENV{ProgramW6432}/eigen*/include/eigen3 - $ENV{ProgramFiles}/eigen*/include/eigen3 - $ENV{ProgramW6432}/eigen* - $ENV{ProgramFiles}/eigen* -) - -find_path( - EIGEN_INCLUDE_DIRS - NAMES - Eigen/Core - HINTS - ${EIGEN_INCLUDE_PATHS} -) - -find_package_handle_standard_args( - Eigen - DEFAULT_MSG - EIGEN_INCLUDE_DIRS -) - -mark_as_advanced( - EIGEN_FOUND - EIGEN_INCLUDE_DIRS -) diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake deleted file mode 100644 index a09acc2b..00000000 --- a/Modules/FindIconv.cmake +++ /dev/null @@ -1,59 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - ICONV_INCLUDE_PATHS - $ENV{ICONVDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{ProgramW6432}/iconv*/include - $ENV{ProgramFiles}/iconv*/include - $ENV{ProgramW6432}/libiconv*/include - $ENV{ProgramFiles}/libiconv*/include - $ENV{ProgramW6432}/GnuWin32/include - $ENV{ProgramFiles}/GnuWin32/include -) - -file( - GLOB - ICONV_LIBRARY_PATHS - $ENV{ICONVDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/iconv*/lib - $ENV{ProgramFiles}/iconv*/lib - $ENV{ProgramW6432}/libiconv*/lib - $ENV{ProgramFiles}/libiconv*/lib - $ENV{ProgramW6432}/GnuWin32/lib - $ENV{ProgramFiles}/GnuWin32/lib -) - -find_path( - ICONV_INCLUDE_DIRS - NAMES - iconv.h - HINTS - ${ICONV_INCLUDE_PATHS} -) - -find_library( - ICONV_LIBRARIES - NAMES - iconv libiconv libiconv_a - HINTS - ${ICONV_LIBRARY_PATHS} -) - -find_package_handle_standard_args( - ICONV - DEFAULT_MSG - ICONV_INCLUDE_DIRS - ICONV_LIBRARIES -) - -mark_as_advanced( - ICONV_INCLUDE_DIRS - ICONV_LIBRARIES -) diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake deleted file mode 100644 index d0c33122..00000000 --- a/Modules/FindLibXml2.cmake +++ /dev/null @@ -1,52 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - LIBXML2_INCLUDE_PATHS - $ENV{LIBXML2DIR}/include/libxml2 - $ENV{HOME}/include - $ENV{HOME}/include/libxml2 - /usr/local/include/libxml2 - /usr/include/libxml2 - $ENV{ProgramW6432}/libxml2*/include - $ENV{ProgramFiles}/libxml2*/include -) - -file( - GLOB - LIBXML2_LIBRARY_PATHS - $ENV{LIBXML2DIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/libxml2*/lib - $ENV{ProgramFiles}/libxml2*/lib -) - -find_path( - LIBXML2_INCLUDE_DIRS - NAMES - libxml/parser.h - HINTS - ${LIBXML2_INCLUDE_PATHS} -) - -find_library( - LIBXML2_LIBRARIES - NAMES - libxml2 xml2 - HINTS - ${LIBXML2_LIBRARY_PATHS} -) - -find_package_handle_standard_args( - LibXml2 - DEFAULT_MSG - LIBXML2_INCLUDE_DIRS - LIBXML2_LIBRARIES -) - -mark_as_advanced( - LIBXML2_INCLUDE_DIRS - LIBXML2_LIBRARIES -) diff --git a/Modules/FindLibdc1394.cmake b/Modules/FindLibdc1394.cmake deleted file mode 100644 index c43f0c65..00000000 --- a/Modules/FindLibdc1394.cmake +++ /dev/null @@ -1,66 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path( - LIBDC1394_V1_INCLUDE_DIR - libdc1394/dc1394_control.h - $ENV{HOME}/include - /usr/local/include - /usr/include -) - -find_path( - LIBDC1394_V2_INCLUDE_DIR - dc1394/dc1394.h - $ENV{HOME}/include - /usr/local/include - /usr/include -) - -find_library( - LIBDC1394_V1_LIBRARY - NAMES - dc1394_control - PATHS - $ENV{HOME}/lib - /usr/local/lib - /usr/lib -) - -find_library( - LIBDC1394_V2_LIBRARY - NAMES - dc1394 - PATHS - $ENV{HOME}/lib - /usr/local/lib - /usr/lib -) - -if(LIBDC1394_V1_INCLUDE_DIR AND LIBDC1394_V1_LIBRARY) - set(LIBDC1394_DEFINITIONS -DLIBDC1394_VERSION_MAJOR=10) - set(LIBDC1394_INCLUDE_DIRS ${LIBDC1394_V1_INCLUDE_DIR}) - set(LIBDC1394_LIBRARIES ${LIBDC1394_V1_LIBRARY}) -endif(LIBDC1394_V1_INCLUDE_DIR AND LIBDC1394_V1_LIBRARY) - -if(LIBDC1394_V2_INCLUDE_DIR AND LIBDC1394_V2_LIBRARY) - set(LIBDC1394_DEFINITIONS -DLIBDC1394_VERSION_MAJOR=20) - set(LIBDC1394_INCLUDE_DIRS ${LIBDC1394_V2_INCLUDE_DIR}) - set(LIBDC1394_LIBRARIES ${LIBDC1394_V2_LIBRARY}) -endif(LIBDC1394_V2_INCLUDE_DIR AND LIBDC1394_V2_LIBRARY) - -find_package_handle_standard_args( - libdc1394 - DEFAULT_MSG - LIBDC1394_INCLUDE_DIRS - LIBDC1394_LIBRARIES -) - -mark_as_advanced( - LIBDC1394_DEFINITIONS - LIBDC1394_INCLUDE_DIRS - LIBDC1394_LIBRARIES - LIBDC1394_V1_INCLUDE_DIR - LIBDC1394_V1_LIBRARY - LIBDC1394_V2_INCLUDE_DIR - LIBDC1394_V2_LIBRARY -) diff --git a/Modules/FindOde.cmake b/Modules/FindOde.cmake deleted file mode 100644 index b35b0a63..00000000 --- a/Modules/FindOde.cmake +++ /dev/null @@ -1,100 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - ODE_INCLUDE_PATHS - $ENV{ODEDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{SystemDrive}/ode*/include - $ENV{ProgramW6432}/ode*/include - $ENV{ProgramFiles}/ode*/include -) - -file( - GLOB - ODE_LIBRARY_PATHS - $ENV{ODEDIR}/lib - $ENV{HOME}/lib/ReleaseSingleDLL - $ENV{HOME}/lib/DebugSingleDLL - $ENV{HOME}/lib/ReleaseDoubleDLL - $ENV{HOME}/lib/DebugDoubleDLL - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{SystemDrive}/ode*/lib/ReleaseSingleDLL - $ENV{ProgramW6432}/ode*/lib/ReleaseSingleDLL - $ENV{ProgramFiles}/ode*/lib/ReleaseSingleDLL - $ENV{SystemDrive}/ode*/lib/DebugSingleDLL - $ENV{ProgramW6432}/ode*/lib/DebugSingleDLL - $ENV{ProgramFiles}/ode*/lib/DebugSingleDLL - $ENV{SystemDrive}/ode*/lib/ReleaseDoubleDLL - $ENV{ProgramW6432}/ode*/lib/ReleaseDoubleDLL - $ENV{ProgramFiles}/ode*/lib/ReleaseDoubleDLL - $ENV{SystemDrive}/ode*/lib/DebugDoubleDLL - $ENV{ProgramW6432}/ode*/lib/DebugDoubleDLL - $ENV{ProgramFiles}/ode*/lib/DebugDoubleDLL - $ENV{SystemDrive}/ode*/lib - $ENV{ProgramW6432}/ode*/lib - $ENV{ProgramFiles}/ode*/lib -) - -find_path( - ODE_INCLUDE_DIRS - NAMES - ode/ode.h - HINTS - ${ODE_INCLUDE_PATHS} -) - -find_library( - ODE_LIBRARY_DEBUG - NAMES - oded ode_singled ode_doubled - HINTS - ${ODE_LIBRARY_PATHS} -) - -find_library( - ODE_LIBRARY_RELEASE - NAMES - ode ode_single ode_double - HINTS - ${ODE_LIBRARY_PATHS} -) - -option(ODE_USE_DOUBLE_PRECISION "ODE use double precision" FALSE) - -if(ODE_USE_DOUBLE_PRECISION) - set(ODE_DEFINITIONS -DdDOUBLE) -else(ODE_USE_DOUBLE_PRECISION) - set(ODE_DEFINITIONS -DdSINGLE) -endif(ODE_USE_DOUBLE_PRECISION) - -if(ODE_LIBRARY_DEBUG AND NOT ODE_LIBRARY_RELEASE) - set(ODE_LIBRARIES ${ODE_LIBRARY_DEBUG}) -endif(ODE_LIBRARY_DEBUG AND NOT ODE_LIBRARY_RELEASE) - -if(ODE_LIBRARY_RELEASE AND NOT ODE_LIBRARY_DEBUG) - set(ODE_LIBRARIES ${ODE_LIBRARY_RELEASE}) -endif(ODE_LIBRARY_RELEASE AND NOT ODE_LIBRARY_DEBUG) - -if(ODE_LIBRARY_DEBUG AND ODE_LIBRARY_RELEASE) - set(ODE_LIBRARIES debug ${ODE_LIBRARY_DEBUG} optimized ${ODE_LIBRARY_RELEASE}) -endif(ODE_LIBRARY_DEBUG AND ODE_LIBRARY_RELEASE) - -find_package_handle_standard_args( - ODE - DEFAULT_MSG - ODE_INCLUDE_DIRS - ODE_LIBRARIES -) - -mark_as_advanced( - ODE_DEFINITIONS - ODE_INCLUDE_DIRS - ODE_LIBRARIES - ODE_LIBRARY_DEBUG - ODE_LIBRARY_RELEASE -) diff --git a/Modules/FindPqp.cmake b/Modules/FindPqp.cmake deleted file mode 100644 index b3a52666..00000000 --- a/Modules/FindPqp.cmake +++ /dev/null @@ -1,53 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - PQP_INCLUDE_PATHS - $ENV{PQPDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{SystemDrive}/pqp*/include - $ENV{ProgramW6432}/pqp*/include - $ENV{ProgramFiles}/pqp*/include -) - -file( - GLOB - PQP_LIBRARY_PATHS - $ENV{PQPDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{SystemDrive}/pqp*/lib - $ENV{ProgramW6432}/pqp*/lib - $ENV{ProgramFiles}/pqp*/lib -) - -find_path( - PQP_INCLUDE_DIRS - NAMES - PQP.h - HINTS - ${PQP_INCLUDE_PATHS} -) - -find_library( - PQP_LIBRARIES - NAMES - PQP - HINTS - ${PQP_LIBRARY_PATHS} -) - -find_package_handle_standard_args( - PQP - DEFAULT_MSG - PQP_INCLUDE_DIRS - PQP_LIBRARIES -) - -mark_as_advanced( - PQP_INCLUDE_DIRS - PQP_LIBRARIES -) diff --git a/Modules/FindSoQt.cmake b/Modules/FindSoQt.cmake deleted file mode 100644 index 9921b388..00000000 --- a/Modules/FindSoQt.cmake +++ /dev/null @@ -1,81 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - SOQT_INCLUDE_PATHS - $ENV{COINDIR}/include - $ENV{COIN3DDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include/Coin* - /usr/include - $ENV{SystemDrive}/Coin*/include - $ENV{ProgramW6432}/Coin*/include - $ENV{ProgramFiles}/Coin*/include -) - -file( - GLOB - SOQT_LIBRARY_PATHS - $ENV{COINDIR}/lib - $ENV{COIN3DDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{SystemDrive}/Coin*/lib - $ENV{ProgramW6432}/Coin*/lib - $ENV{ProgramFiles}/Coin*/lib -) - -find_path( - SOQT_INCLUDE_DIRS - NAMES - Inventor/Qt/SoQt.h - HINTS - ${SOQT_INCLUDE_PATHS} -) - -find_library( - SOQT_LIBRARY_DEBUG - NAMES - SoQtd soqt1d - HINTS - ${SOQT_LIBRARY_PATHS} -) - -find_library( - SOQT_LIBRARY_RELEASE - NAMES - SoQt soqt1 - HINTS - ${SOQT_LIBRARY_PATHS} -) - -set(SOQT_DEFINITIONS -DSOQT_NOT_DLL) - -if(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE) - set(SOQT_LIBRARIES ${SOQT_LIBRARY_DEBUG}) -endif(SOQT_LIBRARY_DEBUG AND NOT SOQT_LIBRARY_RELEASE) - -if(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG) - set(SOQT_LIBRARIES ${SOQT_LIBRARY_RELEASE}) -endif(SOQT_LIBRARY_RELEASE AND NOT SOQT_LIBRARY_DEBUG) - -if(SOQT_LIBRARY_DEBUG AND SOQT_LIBRARY_RELEASE) - set(SOQT_LIBRARIES debug ${SOQT_LIBRARY_DEBUG} optimized ${SOQT_LIBRARY_RELEASE}) -endif(SOQT_LIBRARY_DEBUG AND SOQT_LIBRARY_RELEASE) - -find_package_handle_standard_args( - SoQt - DEFAULT_MSG - SOQT_INCLUDE_DIRS - SOQT_LIBRARIES -) - -mark_as_advanced( - SOQT_DEFINITIONS - SOQT_INCLUDE_DIRS - SOQT_LIBRARIES - SOQT_LIBRARY_DEBUG - SOQT_LIBRARY_RELEASE -) diff --git a/Modules/FindSolid.cmake b/Modules/FindSolid.cmake deleted file mode 100644 index 754d1cd8..00000000 --- a/Modules/FindSolid.cmake +++ /dev/null @@ -1,73 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - SOLID_INCLUDE_PATHS - $ENV{SOLIDDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{ProgramW6432}/solid*/include - $ENV{ProgramFiles}/solid*/include -) - -file( - GLOB - SOLID_LIBRARY_PATHS - $ENV{SOLIDDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/solid*/lib - $ENV{ProgramFiles}/solid*/lib -) - -find_path( - SOLID_INCLUDE_DIRS - NAMES - SOLID/SOLID.h - HINTS - ${SOLID_INCLUDE_PATHS} -) - -find_library( - SOLID_LIBRARY_DEBUG - NAMES - solidd solidsd - HINTS - ${SOLID_LIBRARY_PATHS} -) - -find_library( - SOLID_LIBRARY_RELEASE - NAMES - solid solids - HINTS - ${SOLID_LIBRARY_PATHS} -) - -if(SOLID_LIBRARY_DEBUG AND NOT SOLID_LIBRARY_RELEASE) - set(SOLID_LIBRARIES ${SOLID_LIBRARY_DEBUG}) -endif(SOLID_LIBRARY_DEBUG AND NOT SOLID_LIBRARY_RELEASE) - -if(SOLID_LIBRARY_RELEASE AND NOT SOLID_LIBRARY_DEBUG) - set(SOLID_LIBRARIES ${SOLID_LIBRARY_RELEASE}) -endif(SOLID_LIBRARY_RELEASE AND NOT SOLID_LIBRARY_DEBUG) - -if(SOLID_LIBRARY_DEBUG AND SOLID_LIBRARY_RELEASE) - set(SOLID_LIBRARIES debug ${SOLID_LIBRARY_DEBUG} optimized ${SOLID_LIBRARY_RELEASE}) -endif(SOLID_LIBRARY_DEBUG AND SOLID_LIBRARY_RELEASE) - -find_package_handle_standard_args( - SOLID - DEFAULT_MSG - SOLID_INCLUDE_DIRS - SOLID_LIBRARIES -) - -mark_as_advanced( - SOLID_INCLUDE_DIRS - SOLID_LIBRARIES - SOLID_LIBRARY_DEBUG - SOLID_LIBRARY_RELEASE -) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake deleted file mode 100644 index 0aff687b..00000000 --- a/Modules/FindZLIB.cmake +++ /dev/null @@ -1,55 +0,0 @@ -include(FindPackageHandleStandardArgs) - -file( - GLOB - ZLIB_INCLUDE_PATHS - $ENV{ZLIBDIR}/include - $ENV{HOME}/include - /usr/local/include - /usr/include - $ENV{ProgramW6432}/zlib*/include - $ENV{ProgramFiles}/zlib*/include - $ENV{ProgramW6432}/GnuWin32/include - $ENV{ProgramFiles}/GnuWin32/include -) - -file( - GLOB - ZLIB_LIBRARY_PATHS - $ENV{ZLIBDIR}/lib - $ENV{HOME}/lib - /usr/local/lib - /usr/lib - $ENV{ProgramW6432}/zlib*/lib - $ENV{ProgramFiles}/zlib*/lib - $ENV{ProgramW6432}/GnuWin32/lib - $ENV{ProgramFiles}/GnuWin32/lib -) - -find_path( - ZLIB_INCLUDE_DIRS - NAMES - zlib.h - HINTS - ${ZLIB_INCLUDE_PATHS} -) - -find_library( - ZLIB_LIBRARIES - NAMES - z zlib zlib_a zlibstat zlibwapi zdll - HINTS - ${ZLIB_LIBRARY_PATHS} -) - -find_package_handle_standard_args( - ZLIB - DEFAULT_MSG - ZLIB_INCLUDE_DIRS - ZLIB_LIBRARIES -) - -mark_as_advanced( - ZLIB_INCLUDE_DIRS - ZLIB_LIBRARIES -) diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake new file mode 100644 index 00000000..8e12fa3a --- /dev/null +++ b/cmake/CPackConfig.cmake @@ -0,0 +1,259 @@ +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Robotics Library is a self-contained C++ library for robot kinematics, visualization, motion planning, and control.") + +if(MSVC) + if(CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+)\\.([0-9])([0-9]*)\\.([0-9]+)\\.") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18) + math(EXPR LINKER_VERSION_MAJOR "${CMAKE_MATCH_1} - 5") + else() + math(EXPR LINKER_VERSION_MAJOR "${CMAKE_MATCH_1} - 6") + endif() + set(PLATFORM_TOOLSET_MAJOR ${LINKER_VERSION_MAJOR}) + set(PLATFORM_TOOLSET_MINOR ${CMAKE_MATCH_2}) + set(LINKER_VERSION "${LINKER_VERSION_MAJOR}.${CMAKE_MATCH_2}${CMAKE_MATCH_3}.${CMAKE_MATCH_4}") + endif() + if(CMAKE_CL_64) + set(CPACK_PACKAGE_FILE_NAME "rl-${VERSION}-msvc-${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}-x64") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${VERSION}\\\\MSVC\\\\${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}\\\\x64") + set(CPACK_PACKAGE_NAME "Robotics Library ${VERSION} - MSVC ${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR} (x64)") + else() + set(CPACK_PACKAGE_FILE_NAME "rl-${VERSION}-msvc-${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}-x86") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${VERSION}\\\\MSVC\\\\${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}\\\\x86") + set(CPACK_PACKAGE_NAME "Robotics Library ${VERSION} - MSVC ${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR} (x86)") + endif() +else() + set(CPACK_PACKAGE_FILE_NAME "rl-${VERSION}-${CMAKE_SYSTEM_NAME}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "rl-${VERSION}") + set(CPACK_PACKAGE_NAME "Robotics Library ${VERSION}") +endif() + +set(CPACK_COMPONENT_DEMOS_DEPENDS examples) +set(CPACK_COMPONENT_DEMOS_DESCRIPTION "Demo programs for the Robotics Library.") +set(CPACK_COMPONENT_DEMOS_DISPLAY_NAME "Demo Programs") +set(CPACK_COMPONENT_DEVELOPMENT_DESCRIPTION "Development files for the Robotics Library.") +set(CPACK_COMPONENT_DEVELOPMENT_DISPLAY_NAME "Development Files") +set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Documentation for the Robotics Library.") +set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation") +set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Example files for the Robotics Library.") +set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Example Files") +set(CPACK_COMPONENT_EXTRAS_DESCRIPTION "Extra programs for the Robotics Library.") +set(CPACK_COMPONENT_EXTRAS_DISPLAY_NAME "Extra Programs") +set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Runtime files for the Robotics Library.") +set(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Runtime Files") +set(CPACK_COMPONENT_SYSTEM_DESCRIPTION "Required system files for the Robotics Library.") +set(CPACK_COMPONENT_SYSTEM_DISPLAY_NAME "Required System Files") +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_DEMOS_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_DEMOS_PACKAGE_DEPENDS "librl-examples (= ${VERSION})") +set(CPACK_DEBIAN_DEMOS_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_DEVELOPMENT_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "librl-dev") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel") +set(CPACK_DEBIAN_DOCUMENTATION_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_DOCUMENTATION_PACKAGE_ARCHITECTURE "all") +set(CPACK_DEBIAN_DOCUMENTATION_PACKAGE_NAME "librl-doc") +set(CPACK_DEBIAN_DOCUMENTATION_PACKAGE_SECTION "doc") +set(CPACK_DEBIAN_EXAMPLES_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_EXAMPLES_PACKAGE_ARCHITECTURE "all") +set(CPACK_DEBIAN_EXTRAS_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_EXTRAS_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.roboticslibrary.org/") +set(CPACK_DEBIAN_PACKAGE_NAME "librl") +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_DEBIAN_PACKAGE_SOURCE "librl") +set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "librl") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "librl-examples (= ${VERSION})") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_SHLIBDEPS ON) +set(CPACK_NSIS_DISPLAY_NAME ${CPACK_PACKAGE_NAME}) +set(CPACK_NSIS_EXECUTABLES_DIRECTORY ${CMAKE_INSTALL_BINDIR}) +set(CPACK_NSIS_HELP_LINK "https://www.roboticslibrary.org/contact") +set(CPACK_NSIS_INSTALLED_ICON_NAME Uninstall.exe) +set( + CPACK_NSIS_MENU_LINKS + "https://www.roboticslibrary.org/" "RL" + "https://github.com/roboticslibrary" "RL on GitHub" + "https://launchpad.net/roblib" "RL on Launchpad" + "https://sourceforge.net/projects/roblib" "RL on SourceForge" + "https://www.youtube.com/roboticslibrary" "RL on YouTube" +) +set(CPACK_NSIS_MODIFY_PATH ON) +set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/robotics-library.ico) +set(CPACK_NSIS_MUI_UNIICON ${CMAKE_CURRENT_SOURCE_DIR}/robotics-library.ico) +set(CPACK_NSIS_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) +set(CPACK_NSIS_URL_INFO_ABOUT "https://www.roboticslibrary.org/") +set(CPACK_PACKAGE_CONTACT "Robotics Library Team ") +set(CPACK_PACKAGE_VENDOR "Robotics Library") +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) +set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPackProjectConfig.cmake) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +set(CPACK_RPM_COMPONENT_INSTALL ON) +set(CPACK_RPM_DEMOS_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_demos_PACKAGE_REQUIRES "rl-examples = ${VERSION}") +set(CPACK_RPM_DEVELOPMENT_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_development_PACKAGE_NAME "rl-devel") +set(CPACK_RPM_DOCUMENTATION_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_documentation_PACKAGE_GROUP "Documentation") +set(CPACK_RPM_EXAMPLES_FILE_NAME "RPM-DEFAULT") +set( + CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION + /usr/lib/cmake + /usr/lib64/cmake + /usr/share/applications + /usr/share/gtksourceview-3.0 + /usr/share/gtksourceview-3.0/language-specs + /usr/share/icons + /usr/share/icons/hicolor + /usr/share/icons/hicolor/scalable + /usr/share/icons/hicolor/scalable/apps +) +set(CPACK_RPM_EXTRAS_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) +set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") +set(CPACK_RPM_PACKAGE_LICENSE "BSD") +set(CPACK_RPM_PACKAGE_NAME "rl") +set(CPACK_RPM_PACKAGE_SUMMARY "Robotics Library") +set(CPACK_RPM_PACKAGE_URL "https://www.roboticslibrary.org/contact") +set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_runtime_PACKAGE_NAME "rl") +set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "rl-examples = ${VERSION}") +set(CPACK_WIX_COMPONENT_INSTALL OFF) +set(CPACK_WIX_EXTENSIONS "WiXUtilExtension") +set( + CPACK_WIX_EXTRA_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/WixExtra.wxs + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/WixUI_FeatureTreeNoLicense.wxs +) +set(CPACK_WIX_LICENSE_RTF ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt) +set(CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/WixPatch.xml) +set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_SOURCE_DIR}/robotics-library.ico) +set(CPACK_WIX_PROGRAM_MENU_FOLDER ${CPACK_PACKAGE_NAME}) +set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://www.roboticslibrary.org/contact") +set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://www.roboticslibrary.org/") +set(CPACK_WIX_ROOT_FEATURE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) +set(CPACK_WIX_ROOT_FEATURE_TITLE "Robotics Library") +set(CPACK_WIX_UI_BANNER ${CMAKE_CURRENT_SOURCE_DIR}/cmake/WixUIBanner.bmp) +set(CPACK_WIX_UI_DIALOG ${CMAKE_CURRENT_SOURCE_DIR}/cmake/WixUIDialog.bmp) +set(CPACK_WIX_UI_REF "WixUI_FeatureTreeNoLicense") + +get_cmake_property(COMPONENTS COMPONENTS) +list(FIND COMPONENTS demos DEMOS_COMPONENT_INDEX) +list(FIND COMPONENTS runtime RUNTIME_COMPONENT_INDEX) +list(FIND COMPONENTS system SYSTEM_COMPONENT_INDEX) + +if(DEMOS_COMPONENT_INDEX GREATER -1) + list(APPEND CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "librl-demos (= ${VERSION})") + list(APPEND CPACK_RPM_runtime_PACKAGE_SUGGESTS "rl-demos = ${VERSION}") +endif() + +if(RUNTIME_COMPONENT_INDEX GREATER -1) + list(APPEND CPACK_COMPONENT_DEMOS_DEPENDS runtime) + list(APPEND CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime) + list(APPEND CPACK_DEBIAN_DEMOS_PACKAGE_DEPENDS "librl (= ${VERSION})") + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "librl (= ${VERSION})") + list(APPEND CPACK_RPM_demos_PACKAGE_REQUIRES "rl = ${VERSION}") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "rl = ${VERSION}") +endif() + +if(SYSTEM_COMPONENT_INDEX GREATER -1) + list(APPEND CPACK_COMPONENT_DEMOS_DEPENDS system) + list(APPEND CPACK_COMPONENT_DEVELOPMENT_DEPENDS system) + list(APPEND CPACK_COMPONENT_EXTRAS_DEPENDS system) + list(APPEND CPACK_COMPONENT_RUNTIME_DEPENDS system) +endif() + +if(Boost_INCLUDE_DIR) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libboost-dev (>= 1.46)") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "boost-devel >= 1.46") +endif() +if(Boost_REGEX_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libboost-regex-dev (>= 1.46)") +endif() +if(Boost_SYSTEM_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libboost-system-dev (>= 1.46)") +endif() +if(Boost_THREAD_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libboost-thread-dev (>= 1.46)") +endif() +if(BULLET_INCLUDE_DIRS AND BULLET_BULLETCOLLISION_LIBRARY_RELEASE AND BULLET_BULLETDYNAMICS_LIBRARY_RELEASE AND BULLET_BULLETSOFTBODY_LIBRARY_RELEASE AND BULLET_LINEARMATH_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libbullet-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "bullet-devel") +endif() +if(CCD_INCLUDE_DIRS AND CCD_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libccd-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "libccd-devel") +endif() +if(Coin_INCLUDE_DIRS AND Coin_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libcoin60-dev | libcoin80-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "Coin3-devel") +endif() +if(Comedi_INCLUDE_DIRS AND Comedi_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libcomedi-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "comedilib-devel") +endif() +if(EIGEN3_INCLUDE_DIRS) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libeigen3-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "eigen3-devel") +endif() +if(FCL_INCLUDE_DIRS AND FCL_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libfcl-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "fcl-devel") +endif() +if(libdc1394_V1_INCLUDE_DIRS AND libdc1394_V1_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libdc1394-13-dev") +endif() +if(libdc1394_V2_INCLUDE_DIRS AND libdc1394_V2_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libdc1394-22-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "libdc1394-devel") +endif() +if(LIBXML2_INCLUDE_DIRS AND LIBXML2_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libxml2-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "libxml2-devel") +endif() +if(LIBXSLT__INCLUDE_DIRS AND LIBXSLT__LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "LIBXSLT_1-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "LIBXSLT_-devel") +endif() +if(NLopt_INCLUDE_DIRS AND NLopt_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libnlopt-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "NLopt-devel") +endif() +if(ODE_INCLUDE_DIRS AND ODE_LIBRARY_RELEASE) + if(ODE_USE_DOUBLE_PRECISION) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode-dev") + else() + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode-sp-dev") + endif() + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "ode-devel") +endif() +if(zlib_INCLUDE_DIRS AND zlib_LIBRARY_RELEASE) + list(APPEND CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "zlib1g-dev") + list(APPEND CPACK_RPM_development_PACKAGE_REQUIRES "zlib-devel") +endif() + +foreach(COMPONENT ${COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT_UPPER) + if(DEFINED CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_DEPENDS) + string(REPLACE ";" ", " CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_DEPENDS "${CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_DEPENDS}") + endif() + if(DEFINED CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_RECOMMENDS) + string(REPLACE ";" ", " CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_RECOMMENDS "${CPACK_DEBIAN_${COMPONENT_UPPER}_PACKAGE_RECOMMENDS}") + endif() + if(DEFINED CPACK_RPM_${COMPONENT}_PACKAGE_REQUIRES) + string(REPLACE ";" ", " CPACK_RPM_${COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${COMPONENT}_PACKAGE_REQUIRES}") + endif() + if(DEFINED CPACK_RPM_${COMPONENT}_PACKAGE_SUGGESTS) + string(REPLACE ";" ", " CPACK_RPM_${COMPONENT}_PACKAGE_SUGGESTS "${CPACK_RPM_${COMPONENT}_PACKAGE_SUGGESTS}") + endif() +endforeach() + +string(REPLACE ";" "\r\n" CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA}") +string(REPLACE ";" "\r\n" CPACK_NSIS_DELETE_ICONS_EXTRA "${CPACK_NSIS_DELETE_ICONS_EXTRA}") +string(REPLACE "/>;\r\n + int main() { return 1 == dCheckConfiguration(\"ODE_double_precision\") ? 0 : 1; } +" ODE_DOUBLE_PRECISION) + +if(ODE_DOUBLE_PRECISION) + set(ODE_DEFINITIONS -DdDOUBLE) +else() + set(ODE_DEFINITIONS -DdSINGLE) +endif() + +mark_as_advanced(ODE_DEFINITIONS) + +find_package_handle_standard_args( + ODE + FOUND_VAR ODE_FOUND + REQUIRED_VARS ODE_INCLUDE_DIRS ODE_LIBRARIES +) + +if(ODE_FOUND AND NOT TARGET ODE::ODE) + add_library(ODE::ODE UNKNOWN IMPORTED) + + if(ODE_LIBRARY_RELEASE) + set_property(TARGET ODE::ODE APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(ODE::ODE PROPERTIES IMPORTED_LOCATION_RELEASE "${ODE_LIBRARY_RELEASE}") + endif() + + if(ODE_LIBRARY_DEBUG) + set_property(TARGET ODE::ODE APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(ODE::ODE PROPERTIES IMPORTED_LOCATION_DEBUG "${ODE_LIBRARY_DEBUG}") + endif() + + set_target_properties( + ODE::ODE PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${ODE_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindPQP.cmake b/cmake/FindPQP.cmake new file mode 100644 index 00000000..2d884162 --- /dev/null +++ b/cmake/FindPQP.cmake @@ -0,0 +1,151 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/PQP*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND PQP_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + PQP_INCLUDE_HINTS + $ENV{PQP_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/PQP*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND PQP_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND PQP_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + PQP_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include/PQP + /opt/local/include + /usr/include +) + +find_path( + PQP_INCLUDE_DIRS + NAMES + PQP.h + HINTS + ${PQP_INCLUDE_HINTS} + PATHS + ${PQP_INCLUDE_PATHS} +) + +mark_as_advanced(PQP_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/PQP*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND PQP_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + PQP_LIBRARY_HINTS + $ENV{PQP_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/PQP*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND PQP_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND PQP_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + PQP_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + PQP_LIBRARY_DEBUG + NAMES + PQPd + HINTS + ${PQP_LIBRARY_HINTS} + PATHS + ${PQP_LIBRARY_PATHS} +) + +find_library( + PQP_LIBRARY_RELEASE + NAMES + PQP + HINTS + ${PQP_LIBRARY_HINTS} + PATHS + ${PQP_LIBRARY_PATHS} +) + +select_library_configurations(PQP) + +find_package_handle_standard_args( + PQP + FOUND_VAR PQP_FOUND + REQUIRED_VARS PQP_INCLUDE_DIRS PQP_LIBRARIES +) + +if(PQP_FOUND AND NOT TARGET PQP::PQP) + add_library(PQP::PQP UNKNOWN IMPORTED) + + if(PQP_LIBRARY_RELEASE) + set_property(TARGET PQP::PQP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(PQP::PQP PROPERTIES IMPORTED_LOCATION_RELEASE "${PQP_LIBRARY_RELEASE}") + endif() + + if(PQP_LIBRARY_DEBUG) + set_property(TARGET PQP::PQP APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(PQP::PQP PROPERTIES IMPORTED_LOCATION_DEBUG "${PQP_LIBRARY_DEBUG}") + endif() + + set_target_properties( + PQP::PQP PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${PQP_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindRTAI.cmake b/cmake/FindRTAI.cmake new file mode 100644 index 00000000..6342e069 --- /dev/null +++ b/cmake/FindRTAI.cmake @@ -0,0 +1,157 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/RTAI*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND RTAI_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + RTAI_INCLUDE_HINTS + $ENV{RTAI_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/RTAI*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND RTAI_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND RTAI_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + RTAI_INCLUDE_PATHS + $ENV{RTAI_DIR}/include + $ENV{RTAIDIR}/include + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/realtime/include + /usr/include/rtai + /usr/include +) + +find_path( + RTAI_INCLUDE_DIRS + NAMES + rtai_lxrt.h + HINTS + ${RTAI_INCLUDE_HINTS} + PATHS + ${RTAI_INCLUDE_PATHS} +) + +mark_as_advanced(RTAI_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/RTAI*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND RTAI_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + RTAI_LIBRARY_HINTS + $ENV{RTAI_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/RTAI*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND RTAI_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND RTAI_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + RTAI_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/realtime/lib + /usr/lib +) + +find_library( + RTAI_LIBRARY_DEBUG + NAMES + lxrtd + HINTS + ${RTAI_LIBRARY_HINTS} + PATHS + ${RTAI_LIBRARY_PATHS} +) + +find_library( + RTAI_LIBRARY_RELEASE + NAMES + lxrt + HINTS + ${RTAI_LIBRARY_HINTS} + PATHS + ${RTAI_LIBRARY_PATHS} +) + +select_library_configurations(RTAI) + +set(RTAI_LIBRARIES ${RTAI_LIBRARIES} rt) + +find_package_handle_standard_args( + RTAI + FOUND_VAR RTAI_FOUND + REQUIRED_VARS RTAI_INCLUDE_DIRS RTAI_LIBRARIES +) + +if(RTAI_FOUND AND NOT TARGET RTAI::lxrt) + add_library(RTAI::lxrt UNKNOWN IMPORTED) + + if(RTAI_LIBRARY_RELEASE) + set_property(TARGET RTAI::lxrt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(RTAI::lxrt PROPERTIES IMPORTED_LOCATION_RELEASE "${RTAI_LIBRARY_RELEASE}") + endif() + + if(RTAI_LIBRARY_DEBUG) + set_property(TARGET RTAI::lxrt APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(RTAI::lxrt PROPERTIES IMPORTED_LOCATION_DEBUG "${RTAI_LIBRARY_DEBUG}") + endif() + + set_target_properties( + RTAI::lxrt PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${RTAI_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindSOLID3.cmake b/cmake/FindSOLID3.cmake new file mode 100644 index 00000000..08a3c9c4 --- /dev/null +++ b/cmake/FindSOLID3.cmake @@ -0,0 +1,150 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/SOLID*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SOLID3_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + SOLID3_INCLUDE_HINTS + $ENV{SOLID3_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/SOLID*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SOLID3_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SOLID3_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + SOLID3_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include +) + +find_path( +SOLID3_INCLUDE_DIRS + NAMES + SOLID/SOLID.h + HINTS + ${SOLID3_INCLUDE_HINTS} + PATHS + ${SOLID3_INCLUDE_PATHS} +) + +mark_as_advanced(SOLID3_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/SOLID*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SOLID3_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + SOLID3_LIBRARY_HINTS + $ENV{SOLID3_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/SOLID*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SOLID3_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SOLID3_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + SOLID3_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + SOLID3_LIBRARY_DEBUG + NAMES + solid3d_d solid3_d solidd solidsd + HINTS + ${SOLID3_LIBRARY_HINTS} + PATHS + ${SOLID3_LIBRARY_PATHS} +) + +find_library( + SOLID3_LIBRARY_RELEASE + NAMES + solid3d solid3 solid solids + HINTS + ${SOLID3_LIBRARY_HINTS} + PATHS + ${SOLID3_LIBRARY_PATHS} +) + +select_library_configurations(SOLID3) + +find_package_handle_standard_args( + SOLID3 + FOUND_VAR SOLID3_FOUND + REQUIRED_VARS SOLID3_INCLUDE_DIRS SOLID3_LIBRARIES +) + +if(SOLID3_FOUND AND NOT TARGET solid3::solid3) + add_library(solid3::solid3 UNKNOWN IMPORTED) + + if(SOLID3_LIBRARY_RELEASE) + set_property(TARGET solid3::solid3 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(solid3::solid3 PROPERTIES IMPORTED_LOCATION_RELEASE "${SOLID3_LIBRARY_RELEASE}") + endif() + + if(SOLID3_LIBRARY_DEBUG) + set_property(TARGET solid3::solid3 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(solid3::solid3 PROPERTIES IMPORTED_LOCATION_DEBUG "${SOLID3_LIBRARY_DEBUG}") + endif() + + set_target_properties( + solid3::solid3 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SOLID3_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindSoQt.cmake b/cmake/FindSoQt.cmake new file mode 100644 index 00000000..bdb4fab5 --- /dev/null +++ b/cmake/FindSoQt.cmake @@ -0,0 +1,155 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/SoQt*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SoQt_INCLUDE_HINTS ${HINTS}) +endforeach() + +list(APPEND SoQt_INCLUDE_HINTS $ENV{SoQt_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/SoQt*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SoQt_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND SoQt_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + SoQt_INCLUDE_PATHS + $ENV{COIN3DDIR}/include + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include/Coin* + /usr/include +) + +find_path( + SoQt_INCLUDE_DIRS + NAMES + Inventor/Qt/SoQt.h + HINTS + ${SoQt_INCLUDE_HINTS} + PATHS + ${SoQt_INCLUDE_PATHS} +) + +mark_as_advanced(SoQt_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/SoQt*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SoQt_LIBRARY_HINTS ${HINTS}) +endforeach() + +list(APPEND SoQt_LIBRARY_HINTS $ENV{SoQt_DIR}/${CMAKE_INSTALL_LIBDIR}) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/SoQt*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SoQt_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND SoQt_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + SoQt_LIBRARY_PATHS + $ENV{COIN3DDIR}/lib + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + SoQt_LIBRARY_DEBUG + NAMES + SoQtd SoQt1d + HINTS + ${SoQt_LIBRARY_HINTS} + PATHS + ${SoQt_LIBRARY_PATHS} +) + +find_library( + SoQt_LIBRARY_RELEASE + NAMES + SoQt SoQt1 + HINTS + HINTS + ${SoQt_LIBRARY_HINTS} + PATHS + ${SoQt_LIBRARY_PATHS} +) + +select_library_configurations(SoQt) + +set(SoQt_DEFINITIONS -DSOQT_DLL) + +mark_as_advanced(SoQt_DEFINITIONS) + +file(STRINGS "${SoQt_INCLUDE_DIRS}/Inventor/Qt/SoQtBasic.h" GUI_TOOLKIT_VERSION_DEFINE REGEX "#define GUI_TOOLKIT_VERSION.*[0-9]+.*") +string(REGEX REPLACE ".*([0-9])([0-9])([0-9]).*" "\\1" GUI_TOOLKIT_VERSION_MAJOR "${GUI_TOOLKIT_VERSION_DEFINE}") +set(SoQt${GUI_TOOLKIT_VERSION_MAJOR}_FOUND ON) + +find_package_handle_standard_args( + SoQt + FOUND_VAR SoQt_FOUND + REQUIRED_VARS SoQt_INCLUDE_DIRS SoQt_LIBRARIES +) + +if(SoQt_FOUND AND NOT TARGET SoQt::SoQt) + add_library(SoQt::SoQt UNKNOWN IMPORTED) + + if(SoQt_LIBRARY_RELEASE) + set_property(TARGET SoQt::SoQt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(SoQt::SoQt PROPERTIES IMPORTED_LOCATION_RELEASE "${SoQt_LIBRARY_RELEASE}") + endif() + + if(SoQt_LIBRARY_DEBUG) + set_property(TARGET SoQt::SoQt APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(SoQt::SoQt PROPERTIES IMPORTED_LOCATION_DEBUG "${SoQt_LIBRARY_DEBUG}") + endif() + + set_target_properties( + SoQt::SoQt PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${SoQt_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${SoQt_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindXenomai.cmake b/cmake/FindXenomai.cmake new file mode 100644 index 00000000..708e84e0 --- /dev/null +++ b/cmake/FindXenomai.cmake @@ -0,0 +1,204 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/Xenomai*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND Xenomai_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + Xenomai_INCLUDE_HINTS + $ENV{Xenomai_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/Xenomai*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND Xenomai_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND Xenomai_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + Xenomai_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/xenomai/include + /usr/include/xenomai + /usr/include +) + +find_path( + Xenomai_INCLUDE_DIRS + NAMES + native/task.h + HINTS + ${Xenomai_INCLUDE_HINTS} + PATHS + ${Xenomai_INCLUDE_PATHS} +) + +mark_as_advanced(Xenomai_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/Xenomai*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND Xenomai_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + Xenomai_LIBRARY_HINTS + $ENV{Xenomai_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/Xenomai*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND Xenomai_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND Xenomai_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + Xenomai_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/xenomai/lib + /usr/lib +) + +find_library( + Xenomai_NATIVE_LIBRARY_DEBUG + NAMES + natived + HINTS + ${Xenomai_LIBRARY_HINTS} + PATHS + ${Xenomai_LIBRARY_PATHS} +) + +find_library( + Xenomai_NATIVE_LIBRARY_RELEASE + NAMES + native + HINTS + ${Xenomai_LIBRARY_HINTS} + PATHS + ${Xenomai_LIBRARY_PATHS} +) + +select_library_configurations(Xenomai_NATIVE) + +find_library( + Xenomai_XENOMAI_LIBRARY_DEBUG + NAMES + xenomaid + HINTS + ${Xenomai_LIBRARY_HINTS} + PATHS + ${Xenomai_LIBRARY_PATHS} +) + +find_library( + Xenomai_XENOMAI_LIBRARY_RELEASE + NAMES + xenomai + HINTS + ${Xenomai_LIBRARY_HINTS} + PATHS + ${Xenomai_LIBRARY_PATHS} +) + +select_library_configurations(Xenomai_XENOMAI) + +set(Xenomai_LIBRARIES ${Xenomai_NATIVE_LIBRARIES} ${Xenomai_XENOMAI_LIBRARIES} pthread rt) + +set(Xenomai_DEFINITIONS -D__XENO__ -D_GNU_SOURCE -D_REENTRANT) + +mark_as_advanced(Xenomai_DEFINITIONS) + +find_package_handle_standard_args( + Xenomai + FOUND_VAR Xenomai_FOUND + REQUIRED_VARS Xenomai_INCLUDE_DIRS Xenomai_NATIVE_LIBRARY Xenomai_XENOMAI_LIBRARY +) + +if(Xenomai_FOUND AND NOT TARGET Xenomai::native) + add_library(Xenomai::native UNKNOWN IMPORTED) + + if(Xenomai_NATIVE_LIBRARY_RELEASE) + set_property(TARGET Xenomai::native APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(Xenomai::native PROPERTIES IMPORTED_LOCATION_RELEASE "${Xenomai_NATIVE_LIBRARY_RELEASE}") + endif() + + if(Xenomai_LIBRARY_DEBUG) + set_property(TARGET Xenomai::native APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(Xenomai::native PROPERTIES IMPORTED_LOCATION_RELEASE "${Xenomai_NATIVE_LIBRARY_DEBUG}") + endif() + + set_target_properties( + Xenomai::native PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${Xenomai_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Xenomai_INCLUDE_DIRS}" + ) +endif() + +if(Xenomai_FOUND AND NOT TARGET Xenomai::xenomai) + add_library(Xenomai::xenomai UNKNOWN IMPORTED) + + if(Xenomai_LIBRARY_RELEASE) + set_property(TARGET Xenomai::xenomai APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(Xenomai::xenomai PROPERTIES IMPORTED_LOCATION_RELEASE "${Xenomai_XENOMAI_LIBRARY_RELEASE}") + set_target_properties(Xenomai::xenomai PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "Xenomai::native") + endif() + + if(Xenomai_LIBRARY_DEBUG) + set_property(TARGET Xenomai::xenomai APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(Xenomai::xenomai PROPERTIES IMPORTED_LOCATION_DEBUG "${Xenomai_XENOMAI_LIBRARY_DEBUG}") + set_target_properties(Xenomai::xenomai PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "Xenomai::native") + endif() + + set_target_properties( + Xenomai::xenomai PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${Xenomai_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Xenomai_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findccd.cmake b/cmake/Findccd.cmake new file mode 100644 index 00000000..b5eef4d4 --- /dev/null +++ b/cmake/Findccd.cmake @@ -0,0 +1,150 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/ccd*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND CCD_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + CCD_INCLUDE_HINTS + $ENV{ccd_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/ccd*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND CCD_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND CCD_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + CCD_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include +) + +find_path( + CCD_INCLUDE_DIRS + NAMES + ccd/ccd.h + HINTS + ${CCD_INCLUDE_HINTS} + PATHS + ${CCD_INCLUDE_PATHS} +) + +mark_as_advanced(CCD_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/ccd*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND CCD_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + CCD_LIBRARY_HINTS + $ENV{ccd_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/ccd*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND CCD_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND CCD_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + CCD_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + CCD_LIBRARY_DEBUG + NAMES + ccdd + HINTS + ${CCD_LIBRARY_HINTS} + PATHS + ${CCD_LIBRARY_PATHS} +) + +find_library( + CCD_LIBRARY_RELEASE + NAMES + ccd + HINTS + ${CCD_LIBRARY_HINTS} + PATHS + ${CCD_LIBRARY_PATHS} +) + +select_library_configurations(CCD) + +find_package_handle_standard_args( + ccd + FOUND_VAR ccd_FOUND + REQUIRED_VARS CCD_INCLUDE_DIRS CCD_LIBRARIES +) + +if(ccd_FOUND AND NOT TARGET ccd::ccd) + add_library(ccd::ccd UNKNOWN IMPORTED) + + if(CCD_LIBRARY_RELEASE) + set_property(TARGET ccd::ccd APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(ccd::ccd PROPERTIES IMPORTED_LOCATION_RELEASE "${CCD_LIBRARY_RELEASE}") + endif() + + if(CCD_LIBRARY_DEBUG) + set_property(TARGET ccd::ccd APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(ccd::ccd PROPERTIES IMPORTED_LOCATION_DEBUG "${CCD_LIBRARY_DEBUG}") + endif() + + set_target_properties( + ccd::ccd PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${CCD_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/FindcifX.cmake b/cmake/FindcifX.cmake new file mode 100644 index 00000000..25548430 --- /dev/null +++ b/cmake/FindcifX.cmake @@ -0,0 +1,151 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/cifx + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/cifX*/${CMAKE_INSTALL_INCLUDEDIR}/cifx + ${PATH}/cifX*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND cifX_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + cifX_INCLUDE_HINTS + $ENV{cifX_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/cifx + $ENV{cifX_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/cifx + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/cifX*/${CMAKE_INSTALL_INCLUDEDIR}/cifx + ${PATH}/cifX*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND cifX_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR}/cifx + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND cifX_INCLUDE_HINTS ${HINTS}) +endforeach() + +find_path( + cifX_INCLUDE_DIRS + NAMES + cifXUser.h + HINTS + ${cifX_INCLUDE_HINTS} + PATHS + $ENV{HOME}/include/cifx + /usr/local/include/cifx + /opt/local/include/cifx + /usr/include/cifx + "$ENV{ProgramW6432}/cifX Device Driver/SDK/includes" + "$ENV{ProgramFiles}/cifX Device Driver/SDK/includes" +) + +mark_as_advanced(cifX_INCLUDE_DIRS) + +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(cifX_ARCHITECTURE "x64") +else() + set(cifX_ARCHITECTURE "x86") +endif() + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libs + ${PATH}/libs/${cifX_ARCHITECTURE} + ${PATH}/cifX*/${CMAKE_INSTALL_LIBDIR} + ${PATH}/cifX*/libs + ${PATH}/cifX*/libs/${cifX_ARCHITECTURE} + ) + list(APPEND cifX_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + cifX_LIBRARY_HINTS + $ENV{cifX_DIR}/${CMAKE_INSTALL_LIBDIR} + $ENV{cifX_DIR}/libs + $ENV{cifX_DIR}/libs/${cifX_ARCHITECTURE} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libs + ${PATH}/libs/${cifX_ARCHITECTURE} + ${PATH}/cifX*/${CMAKE_INSTALL_LIBDIR} + ${PATH}/cifX*/libs + ${PATH}/cifX*/libs/${cifX_ARCHITECTURE} + ) + list(APPEND cifX_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ${PATH}/../libs + ${PATH}/../libs/${cifX_ARCHITECTURE} + ) + list(APPEND cifX_LIBRARY_HINTS ${HINTS}) +endforeach() + +find_library( + cifX_LIBRARY_RELEASE + NAMES + cifx cifx32dll + HINTS + ${cifX_LIBRARY_HINTS} + PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib + "$ENV{ProgramW6432}/cifX Device Driver/SDK/libs/${cifX_ARCHITECTURE}" + "$ENV{ProgramFiles}/cifX Device Driver/SDK/libs/${cifX_ARCHITECTURE}" +) + +select_library_configurations(cifX) + +find_package_handle_standard_args( + cifX + FOUND_VAR cifX_FOUND + REQUIRED_VARS cifX_INCLUDE_DIRS cifX_LIBRARIES +) + +if(cifX_FOUND AND NOT TARGET cifX::cifX) + add_library(cifX::cifX UNKNOWN IMPORTED) + + if(cifX_LIBRARY_RELEASE) + set_property(TARGET cifX::cifX APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(cifX::cifX PROPERTIES IMPORTED_LOCATION_RELEASE "${cifX_LIBRARY_RELEASE}") + endif() + + set_target_properties( + cifX::cifX PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${cifX_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findlibdc1394.cmake b/cmake/Findlibdc1394.cmake new file mode 100644 index 00000000..1fd81bd4 --- /dev/null +++ b/cmake/Findlibdc1394.cmake @@ -0,0 +1,173 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libdc1394*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libdc1394_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + libdc1394_INCLUDE_HINTS + $ENV{libdc1394_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libdc1394*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libdc1394_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libdc1394_INCLUDE_HINTS ${HINTS}) +endforeach() + +find_path( + libdc1394_V1_INCLUDE_DIRS + libdc1394/dc1394_control.h + HINTS + ${libdc1394_INCLUDE_HINTS} + PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include +) + +mark_as_advanced(libdc1394_V1_INCLUDE_DIRS) + +find_path( + libdc1394_V2_INCLUDE_DIRS + dc1394/dc1394.h + HINTS + ${libdc1394_INCLUDE_HINTS} + PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include +) + +mark_as_advanced(libdc1394_V2_INCLUDE_DIRS) + +if(libdc1394_V1_INCLUDE_DIRS) + set(libdc1394_INCLUDE_DIRS ${libdc1394_V1_INCLUDE_DIRS}) +elseif(libdc1394_V2_INCLUDE_DIRS) + set(libdc1394_INCLUDE_DIRS ${libdc1394_V2_INCLUDE_DIRS}) +endif() + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libdc1394*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libdc1394_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + libdc1394_LIBRARY_HINTS + $ENV{libdc1394_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libdc1394*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libdc1394_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libdc1394_LIBRARY_HINTS ${HINTS}) +endforeach() + +find_library( + libdc1394_V1_LIBRARY_RELEASE + NAMES + dc1394_control + HINTS + ${libdc1394_LIBRARY_HINTS} + PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) +find_library( + libdc1394_V2_LIBRARY_RELEASE + NAMES + dc1394 + HINTS + ${libdc1394_LIBRARY_HINTS} + PATHS + $ENV{libdc1394_DIR}/lib + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +mark_as_advanced(libdc1394_V1_LIBRARY_RELEASE) +mark_as_advanced(libdc1394_V2_LIBRARY_RELEASE) + +if(libdc1394_V1_LIBRARY_RELEASE) + set(libdc1394_LIBRARY_RELEASE ${libdc1394_V1_LIBRARY_RELEASE}) +elseif(libdc1394_V2_LIBRARY_RELEASE) + set(libdc1394_LIBRARY_RELEASE ${libdc1394_V2_LIBRARY_RELEASE}) +endif() + +select_library_configurations(libdc1394) + +if(libdc1394_V1_LIBRARY_RELEASE AND libdc1394_V1_INCLUDE_DIRS) + set(libdc1394_DEFINITIONS -DLIBDC1394_VERSION_MAJOR=10) +elseif(libdc1394_V2_LIBRARY_RELEASE AND libdc1394_V2_INCLUDE_DIRS) + set(libdc1394_DEFINITIONS -DLIBDC1394_VERSION_MAJOR=20) +endif() + +mark_as_advanced(libdc1394_DEFINITIONS) + +find_package_handle_standard_args( + libdc1394 + FOUND_VAR libdc1394_FOUND + REQUIRED_VARS libdc1394_INCLUDE_DIRS libdc1394_LIBRARIES +) + +if(libdc1394_FOUND AND NOT TARGET libdc1394::libdc1394) + add_library(libdc1394::libdc1394 UNKNOWN IMPORTED) + + if(libdc1394_LIBRARY_RELEASE) + set_property(TARGET libdc1394::libdc1394 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(libdc1394::libdc1394 PROPERTIES IMPORTED_LOCATION_RELEASE "${libdc1394_LIBRARY_RELEASE}") + endif() + + set_target_properties( + libdc1394::libdc1394 PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${libdc1394_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${libdc1394_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findlibiconv.cmake b/cmake/Findlibiconv.cmake new file mode 100644 index 00000000..4cbc3e35 --- /dev/null +++ b/cmake/Findlibiconv.cmake @@ -0,0 +1,155 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libiconv*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libiconv_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + libiconv_INCLUDE_HINTS + $ENV{libiconv_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libiconv*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libiconv_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND libiconv_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + libiconv_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include + $ENV{ProgramW6432}/GnuWin32/include + $ENV{ProgramFiles}/GnuWin32/include +) + +find_path( + libiconv_INCLUDE_DIRS + NAMES + iconv.h + HINTS + ${libiconv_INCLUDE_HINTS} + PATHS + ${libiconv_INCLUDE_PATHS} +) + +mark_as_advanced(libiconv_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libiconv*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libiconv_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + libiconv_LIBRARY_HINTS + $ENV{libiconv_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libiconv*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libiconv_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND libiconv_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + libiconv_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib + $ENV{ProgramW6432}/GnuWin32/lib + $ENV{ProgramFiles}/GnuWin32/lib +) + +find_library( + libiconv_LIBRARY_DEBUG + NAMES + iconvd libiconvd libiconvd_a + HINTS + ${libiconv_LIBRARY_HINTS} + PATHS + ${libiconv_LIBRARY_PATHS} +) + +find_library( + libiconv_LIBRARY_RELEASE + NAMES + iconv libiconv liblibiconv_a + HINTS + ${libiconv_LIBRARY_HINTS} + PATHS + ${libiconv_LIBRARY_PATHS} +) + +select_library_configurations(libiconv) + +find_package_handle_standard_args( + libiconv + FOUND_VAR libiconv_FOUND + REQUIRED_VARS libiconv_INCLUDE_DIRS libiconv_LIBRARIES +) + +if(libiconv_FOUND AND NOT TARGET libiconv::libiconv) + add_library(libiconv::libiconv UNKNOWN IMPORTED) + + if(libiconv_LIBRARY_RELEASE) + set_property(TARGET libiconv::libiconv APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(libiconv::libiconv PROPERTIES IMPORTED_LOCATION_RELEASE "${libiconv_LIBRARY_RELEASE}") + endif() + + if(libiconv_LIBRARY_DEBUG) + set_property(TARGET libiconv::libiconv APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(libiconv::libiconv PROPERTIES IMPORTED_LOCATION_DEBUG "${libiconv_LIBRARY_DEBUG}") + endif() + + set_target_properties( + libiconv::libiconv PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${libiconv_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${libiconv_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findlibxml2.cmake b/cmake/Findlibxml2.cmake new file mode 100644 index 00000000..4fffbd57 --- /dev/null +++ b/cmake/Findlibxml2.cmake @@ -0,0 +1,159 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libxml2*/${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + ${PATH}/libxml2*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXML2_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + LIBXML2_INCLUDE_HINTS + $ENV{libxml2_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + $ENV{libxml2_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libxml2*/${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + ${PATH}/libxml2*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXML2_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR}/libxml2 + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXML2_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + LIBXML2_INCLUDE_PATHS + $ENV{HOME}/include/libxml2 + $ENV{HOME}/include + /usr/local/include/libxml2 + /usr/local/include + /opt/local/include/libxml2 + /opt/local/include + /usr/include/libxml2 + /usr/include +) + +find_path( + LIBXML2_INCLUDE_DIRS + NAMES + libxml/parser.h + HINTS + ${LIBXML2_INCLUDE_HINTS} + PATHS + ${LIBXML2_INCLUDE_PATHS} +) + +mark_as_advanced(LIBXML2_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libxml2*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXML2_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + LIBXML2_LIBRARY_HINTS + $ENV{LIBXML2_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libxml2*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXML2_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXML2_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + LIBXML2_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + LIBXML2_LIBRARY_DEBUG + NAMES + libxml2d xml2d + HINTS + ${LIBXML2_LIBRARY_HINTS} + PATHS + ${LIBXML2_LIBRARY_PATHS} +) +find_library( + LIBXML2_LIBRARY_RELEASE + NAMES + libxml2 xml2 + HINTS + ${LIBXML2_LIBRARY_HINTS} + PATHS + ${LIBXML2_LIBRARY_PATHS} +) + +select_library_configurations(LIBXML2) + +find_package_handle_standard_args( + libxml2 + FOUND_VAR LIBXML2_FOUND + REQUIRED_VARS LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES +) + +if(LIBXML2_FOUND AND NOT TARGET libxml2::libxml2) + add_library(libxml2::libxml2 UNKNOWN IMPORTED) + + if(LIBXML2_LIBRARY_RELEASE) + set_property(TARGET libxml2::libxml2 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(libxml2::libxml2 PROPERTIES IMPORTED_LOCATION_RELEASE "${LIBXML2_LIBRARY_RELEASE}") + endif() + + if(LIBXML2_LIBRARY_DEBUG) + set_property(TARGET libxml2::libxml2 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(libxml2::libxml2 PROPERTIES IMPORTED_LOCATION_DEBUG "${LIBXML2_LIBRARY_DEBUG}") + endif() + + set_target_properties( + libxml2::libxml2 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findlibxslt.cmake b/cmake/Findlibxslt.cmake new file mode 100644 index 00000000..ec117ae9 --- /dev/null +++ b/cmake/Findlibxslt.cmake @@ -0,0 +1,153 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/libxslt + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libxslt*/${CMAKE_INSTALL_INCLUDEDIR}/libxslt + ${PATH}/libxslt*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXSLT_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + LIBXSLT_INCLUDE_HINTS + $ENV{LIBXSLT_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/libxslt + $ENV{LIBXSLT_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR}/libxslt + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/libxslt*/${CMAKE_INSTALL_INCLUDEDIR}/libxslt + ${PATH}/libxslt*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXSLT_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR}/libxslt + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND LIBXSLT_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + LIBXSLT_INCLUDE_PATHS + $ENV{HOME}/include/libxslt + $ENV{HOME}/include + /usr/local/include/libxslt + /usr/local/include + /opt/local/include/libxslt + /opt/local/include + /usr/include/libxslt + /usr/include +) + +find_path( + LIBXSLT_INCLUDE_DIRS + NAMES + libxslt/xslt.h + HINTS + ${LIBXSLT_INCLUDE_PATHS} +) + +mark_as_advanced(LIBXSLT_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libxslt*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXSLT_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + LIBXSLT_LIBRARY_HINTS + $ENV{LIBXSLT_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/libxslt*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXSLT_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND LIBXSLT_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + LIBXSLT_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib +) + +find_library( + LIBXSLT_LIBRARY_DEBUG + NAMES + libxsltd xsltd + HINTS + ${LIBXSLT_LIBRARY_PATHS} +) +find_library( + LIBXSLT_LIBRARY_RELEASE + NAMES + libxslt xslt + HINTS + ${LIBXSLT_LIBRARY_PATHS} +) + +select_library_configurations(LIBXSLT) + +find_package_handle_standard_args( + libxslt + FOUND_VAR LIBXSLT_FOUND + REQUIRED_VARS LIBXSLT_INCLUDE_DIRS LIBXSLT_LIBRARIES +) + +if(LIBXSLT_FOUND AND NOT TARGET libxslt::libxslt) + add_library(libxslt::libxslt UNKNOWN IMPORTED) + + if(LIBXSLT_LIBRARY_RELEASE) + set_property(TARGET libxslt::libxslt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(libxslt::libxslt PROPERTIES IMPORTED_LOCATION_RELEASE "${LIBXSLT_LIBRARY_RELEASE}") + endif() + + if(LIBXSLT_LIBRARY_DEBUG) + set_property(TARGET libxslt::libxslt APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(libxslt::libxslt PROPERTIES IMPORTED_LOCATION_DEBUG "${LIBXSLT_LIBRARY_DEBUG}") + endif() + + set_target_properties( + libxslt::libxslt PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBXSLT_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Findzlib.cmake b/cmake/Findzlib.cmake new file mode 100644 index 00000000..d5e59474 --- /dev/null +++ b/cmake/Findzlib.cmake @@ -0,0 +1,154 @@ +include(FindPackageHandleStandardArgs) +include(GNUInstallDirs) +include(SelectLibraryConfigurations) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/zlib*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND zlib_INCLUDE_HINTS ${HINTS}) +endforeach() + +list( + APPEND + zlib_INCLUDE_HINTS + $ENV{zlib_DIR}/${CMAKE_INSTALL_INCLUDEDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_INCLUDEDIR} + ${PATH}/zlib*/${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND zlib_INCLUDE_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_INCLUDEDIR} + ) + list(APPEND zlib_INCLUDE_HINTS ${HINTS}) +endforeach() + +file( + GLOB + zlib_INCLUDE_PATHS + $ENV{HOME}/include + /usr/local/include + /opt/local/include + /usr/include + $ENV{ProgramW6432}/GnuWin32/include + $ENV{ProgramFiles}/GnuWin32/include +) + +find_path( + zlib_INCLUDE_DIRS + NAMES + zlib.h + HINTS + ${zlib_INCLUDE_HINTS} + PATHS + ${zlib_INCLUDE_PATHS} +) + +mark_as_advanced(zlib_INCLUDE_DIRS) + +foreach(PATH ${CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/zlib*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND zlib_LIBRARY_HINTS ${HINTS}) +endforeach() + +list( + APPEND + zlib_LIBRARY_HINTS + $ENV{zlib_DIR}/${CMAKE_INSTALL_LIBDIR} +) + +foreach(PATH $ENV{CMAKE_PREFIX_PATH}) + file( + GLOB + HINTS + ${PATH}/${CMAKE_INSTALL_LIBDIR} + ${PATH}/zlib*/${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND zlib_LIBRARY_HINTS ${HINTS}) +endforeach() + +foreach(PATH $ENV{PATH}) + file( + GLOB + HINTS + ${PATH}/../${CMAKE_INSTALL_LIBDIR} + ) + list(APPEND zlib_LIBRARY_HINTS ${HINTS}) +endforeach() + +file( + GLOB + zlib_LIBRARY_PATHS + $ENV{HOME}/lib + /usr/local/lib + /opt/local/lib + /usr/lib + $ENV{ProgramW6432}/GnuWin32/lib + $ENV{ProgramFiles}/GnuWin32/lib +) + +find_library( + zlib_LIBRARY_DEBUG + NAMES + zd zlibd zlib_ad zlibstaticd zlibwapid zdlld + HINTS + ${zlib_LIBRARY_HINTS} + PATHS + ${zlib_LIBRARY_PATHS} +) + +find_library( + zlib_LIBRARY_RELEASE + NAMES + z zlib zlib_a zlibstatic zlibwapi zdll + HINTS + ${zlib_LIBRARY_HINTS} + PATHS + ${zlib_LIBRARY_PATHS} +) + +select_library_configurations(zlib) + +find_package_handle_standard_args( + zlib + FOUND_VAR zlib_FOUND + REQUIRED_VARS zlib_INCLUDE_DIRS zlib_LIBRARIES +) + +if(zlib_FOUND AND NOT TARGET zlib::zlib) + add_library(zlib::zlib UNKNOWN IMPORTED) + + if(zlib_LIBRARY_RELEASE) + set_property(TARGET zlib::zlib APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(zlib::zlib PROPERTIES IMPORTED_LOCATION_RELEASE "${zlib_LIBRARY_RELEASE}") + endif() + + if(zlib_LIBRARY_DEBUG) + set_property(TARGET zlib::zlib APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(zlib::zlib PROPERTIES IMPORTED_LOCATION_DEBUG "${zlib_LIBRARY_DEBUG}") + endif() + + set_target_properties( + zlib::zlib PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${zlib_INCLUDE_DIRS}" + ) +endif() diff --git a/cmake/Qt4AutomocMocOptionsBoost.cmake b/cmake/Qt4AutomocMocOptionsBoost.cmake new file mode 100644 index 00000000..6674101b --- /dev/null +++ b/cmake/Qt4AutomocMocOptionsBoost.cmake @@ -0,0 +1,45 @@ +# https://bugreports.qt.io/browse/QTBUG-22829 + +list( + APPEND + CMAKE_AUTOMOC_MOC_OPTIONS + -DBOOST_TT_HAS_BIT_AND_HPP_INCLUDED + -DBOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_BIT_OR_HPP_INCLUDED + -DBOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_BIT_XOR_HPP_INCLUDED + -DBOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED + -DBOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED + -DBOOST_TT_HAS_DIVIDES_HPP_INCLUDED + -DBOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED + -DBOOST_TT_HAS_GREATER_HPP_INCLUDED + -DBOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED + -DBOOST_TT_HAS_LEFT_SHIFT_HPP_INCLUDED + -DBOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_LESS_HPP_INCLUDED + -DBOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED + -DBOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED + -DBOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED + -DBOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED + -DBOOST_TT_HAS_MINUS_HPP_INCLUDED + -DBOOST_TT_HAS_MINUS_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_MODULUS_HPP_INCLUDED + -DBOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED + -DBOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_NEGATE_HPP_INCLUDED + -DBOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED + -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED + -DBOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED + -DBOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED + -DBOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED + -DBOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED + -DBOOST_TT_HAS_PLUS_HPP_INCLUDED + -DBOOST_TT_HAS_PLUS_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_RIGHT_SHIFT_HPP_INCLUDED + -DBOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED + -DBOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED + -DBOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED +) diff --git a/cmake/WixExtra.wxs.in b/cmake/WixExtra.wxs.in new file mode 100644 index 00000000..614785ca --- /dev/null +++ b/cmake/WixExtra.wxs.in @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + @WIX_SHORTCUTS@ + + + + + + diff --git a/cmake/WixPatch.xml.in b/cmake/WixPatch.xml.in new file mode 100644 index 00000000..6e9fe56d --- /dev/null +++ b/cmake/WixPatch.xml.in @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/cmake/WixUIBanner.bmp b/cmake/WixUIBanner.bmp new file mode 100644 index 0000000000000000000000000000000000000000..57985bf25912a3ac57a02ccf09f938cacb89b10c GIT binary patch literal 85896 zcmeI*y>App7{~D?Esd2brOTAAC{kIegRoLjy5J9RLxWPdL7|D<&>$h1NCc1oxo{Dn zzzRr_5=F6y(ijjY1R{WNjyHio_?#asdi=02v$N;jb?*GN>|<_kc4qH$(!=W6XXn1& zf9$}XrA1M*sl?5cm-S1Q0*~fsq!tI?_ka!6SeG0{W1+xN5Kc4IFD5I_KdjKE}XBe}UTeQ&T*=gyo5E33=XbNbDU z##00kKmdVG1?JZW3gY%V`*6^ETX6t70biLtb|RV9@6adXnuGj!1vD=sfB*uO0t(p^ zx3_|L8qKvu!M$wXKju#@PJELF@n7eTmvxKT{%=et`XGP+0tf^IboOm$;=Z9wOFqZa zTe^N`@?aXl^{8n6rvD-^c;!p$l|ATy00Iag5D-wL_OaXAIvMY8e6rt@)mzGgTLe!V ze=VH_P#nHJp2#O@*tDFrNy~#PRLa8hUN=<6eU{0tg@wE1+6K zorWtpo~aX8DqJ;%nUI}-sy?wZRrMo|R|)Yt0tg^bB(TsgxNlRp*O#TjeJJ;}hIb#W z{BUvN#+}8YNusuKoimDwP6!}?Kv+Pja222UU>#^H+}mi!mnV;&OZ0p4(v)JlZI5r9 zj_*oO1Q0*~fxLjy+`3{Jh}xN#{8B2vuPvlO+#b(gpLzPSm!E|#2q1s}0?iAgsqmOY ziVx*hYxw$YUl|pP;MUN_Yk$w{)#i_w5fMND0R&7yxsgCkp%2`?t%b2{ge!l}S?ta? zly8Ylnsc4gNNFH|00L10g}2xHU|rVMnY+~*DtVHR-T5u2uTEDc&AHAQ^|8?j0R#|` zfD$RT(rj6<4s7?eh6>R6s9m;Y`M23Xn&l@x8w3zQ0D(vWolOVAboeDDVf5cXI?>ww zrLvG+xIG-l4@Vw7-4H+k0R$vaxZG7Zf~T))xmp9XTEoJq?Kj5cRUX;6G!Q@l0R$=q zbWUBjKt*xf*BYu8#YgJ0cKmhD8dc=DyZYnQkAl^X(z-13D9R$aF#g0R#|m0=k#SpKb@*ekqlQ z{ndQnwk<>7m;c%w7)=BaKmdVQfyjID{nxgY)f#SdovgF5hfF^N5I_I{ClFJEs9HnY zLpNvIskd)z{}%i!HU|v^5I_KdS^|~pjQgcj^0kIKJ#S=5Ebhy%^{LSr0R#}(5>O3d zV2PDLt)XIi<=ysM)6hZy0R#|ePe7|>m0jfYOR3nphH7Z7+GdYuZ?nTO8UhF)u-gO* zzlT$|eVT(x3DbnQ7B~znlVbhrHqO=Ef&K^}fB*tsAYX&%YYmk@Q4m)uTt$a|uLj#U z8yt(F5I_Kd-6@b+1krzOn@+~HDpsp3T<2_+m%$N0U{?qz6>f{J=vL2;-}CK`=VLkq z5I|ro1*`_qY7IMko9{ZCiHQ(E0DHMoPu?2> z2q1t!vjSY_Y}S*}5I_Kdt_6tWU5hgx0tg_`tiZ>wsAzUjMneDr1Q6&<;7DgPF%bd? zAb>y{0^heWC}Sdk00IbfCcyV|c1F!a2q1t!D*{O?qcSK02q1t!R|3?lbS2F^2q1t! hI|7`Kx8usF2q1t!R|3TGuB4d<0R#|eM<7X({{Z*cXfyx- literal 0 HcmV?d00001 diff --git a/cmake/WixUIDialog.bmp b/cmake/WixUIDialog.bmp new file mode 100644 index 0000000000000000000000000000000000000000..082c922aa444b9684d90ba4eb65b04da9a47c072 GIT binary patch literal 461816 zcmeI53y5uH8HPs+G-oo+DV2uU)dXh4={BQXrcQJ*n(k>u1x}^Q=Kg>0AISdm z$%j4lQ!~%zj|Bq%;U5S7<(W%Pc_Ny#K!ChM z00NQ(UX*#f-=DK!F=~`dFhxNC0w2mep8fgw{*%$1JOSbk0SHJE_}jqa7he9rz1dZH zkr^*gGQkuD0SH_<@Obv$t@Q=tnv*Y|xI+K}ngoU(&tA}jsI79%1XC3R%oFI1di>(| zAFC}g~fzuD1eWI$%EZ3D% zFqta^AW)mYzs7zUAO5)8Tehq`$=YkDf(;=6fs_cGHWc^R3wjXsRGv~WnJWY!P@BNr zWBMNbac5;o&t;Y?s+|fpga8CmBJieBagV*udJtK3Malaq1(Uf#00OlMJYdY-V?TcM z%$}0SjMq{-6>JCr2&6>d)nnow`!VZ5WYHBF`==C4<_ZA_)FyE2n7H#l(u0V{YsZNV zApn5@1n$afkS|UN0SLG!@bi;&Jy;;?e{#7*Fhh1SjwvgisPk2}fC4gz)w{O|dkd2#1Q=s`?f<#uCE&+$DSPTUsJB zK3fBMrbGx>ByiDC%FSM|=t@G@28#iwW(XJ{@Q-Ht9_~dCA|5yJF`+~VL`~q9p^+QE z;K6UHs66TgRr4^bzP z$w2@DO$nUc*xh40^5D1lRo*lt><0k|L`~rKF&#JlG3!Cxn_Z3HWtL|cbrP8z1R&6q zz-nW0=XazBG4hK<(~z(q1RxMKfxGfLZak9pAhPI6%qovMiA)Xx5NJx^tBtK)xFbD? zc)V#8*$)B`Xh`6%g*t9C$f7IJs=Q%F*bM>@h?~G~+bFwmUmpC1$K%dCvx9&dfjbIa z+;Wf}#5h&17GCOs00izQ@b8w&F5I0(SMWHWF9<-u8-d>!in#qCJ%|yi+*_(R5di!$5P*PB0xv`L zgBaD7!)LHK7X%>SjlhK!7H&H zCh&=B3%7rl9>jRA9NJN)ItZ90@cj0so_K_<^@Vs`W_c!NQ%>O!&?a#HL<@Ja0X>K@ zTtBpt@H~Sf*a0s|2aOOk>ceTOJ%2Et2vpfgaVdD4@fItue zGhJzV;&JFf41Ng-k}ysR0SLGzaNb1!cDMnHu7p*&>o9SA2tXhRf#W;W^u$BagNVn2 zq@0sNK%2muC(5_m4S4WdK$UApnd%^5mcUWnYP!zRSac1 z3j`qGnZT{x3cCK$=t1;ZwyKtKXl z1b6r71n5C@dYK8BGfoWw2)HBg`%#U?@Oo=~!KuqEAKYDxI5Gqv5Rkx=VsQ7^9Cmxl zmTl{<_JBF#)DVDxI|6SVb7%}d(u3$o&+Si5izEV|OU$^+(%Q$qj(?g-pi=+GDj zdGH$^cb9vP3;`tq`(jXb*&Gg>ePZV>vwT3M;8F_&ATT8G*)oSlGR~qa9bR~b|JQi| z0SG7&xIGeImra8nL_Dtad7~BxxFB$_OrY_M^We9xRPG``91{W%2u|RG@%XxICRq>S z-t1~uF0*``;Avw55P*OS0zWLXXH?_#Aa-*3aS}QMC-Atad|fda9{ko`<-ya& z1Rwwb7X)sqP-j$cZEnoB7n$)RxCju(ga8DB6F3}|tg9zO4`R#fQ1G-d0SG|A1%Z32 z)fv^h{r+4_ks06JMSwUa1RxNcK&0y(mR&#SL2Pp=3Z6D5009WNAaG}yG2^OZ;e%+bW)i-1RzjGAolO&7Ydyo#AYfl3jyO0fI!j&{!l2& z$Ol<;1&=5FsblgG=$1fw_f-bh7}QMCvZX%$}XEE z4}P0U<-ya&1Rwwb7X*G@rpQ#rcYDiIxy#}*$gINE{6g+KA z00IzjLEyz@eoSb5XJx6r%Peo{B0wAy0uTsJ;Jpd?x@@XE_^sx}DR|nL00bc5f69aPT-m8TDx%O zJov3b<*A32`9lB#g#=zuXv1^|S#$-D7Y3a{2nZ86JzZs&&72;@GL;MGn9?9%nZSi* zHcWb)9>hYGTMjz4LqM3okxBcyZ1S5M^MxWaJ}8`HN`ru90?#i~Vd~@bAm%SxmV-|1 z5D+G?FLhs+&A;ED%ZtqTh;WW64FZ-4Tvz5nfpH%EHg?^z9CT`jfG~kO1bkgq0zHU$ zT==6)X%H9^_&}KiHO9Br7sgy>`N!e^bzVRK0!jof)9`gg74#quFI`H(r4|T4U`XJq z3Il4q#iA>Cd>D6LKtPhf=QLzpT?IXe1C>iAn4%y6fvsu-YP_30_-*(*spS{M9Rd)L zBp~uUpo!NT7G23MV3G-@Cn1Zc$`l=1XKxJuA%8VRq)_9)eut`1dJ27 zsg40tqGW<83IY)LNPX++ZE0=M72*y72uKpRSkKN=Rb;9MQ8K|41px@$GnMru zH@4G*NZcU+0Z9UXlvMLnMQv`(8~J*tWP&LQ0uZ=jD&?teY@`Q~xI+K}k_0YQRr6GJ z8F}!VWP&LQ0ucE6RK645czbP8{_YBKhX4d53G{^3JXL8HdJrWOOi>Vkz+F?xPJ836 z^#$!;$%#7zARtL#MqAC(R;S&AD4Af2f&c{QAOF8Anf8O^o}n4%y6fj=2nc47IdJ&42| z0uYcS@QOl_F(~=qH^~H36a*mfPLy3nKyT3%;tl}_ND{cM%wmk|^&m^o}n4%y6f!~Zei`Rt&WFGuR+#vt~Ndm7gG#7(o1T=aOB@;|h5P-m= z#)QR>g#`NjIf1|JB<>J^fFyy(7HW&ZJOP0oM9BnG6a*k}eO_3M6cP|vbcMJ>00NQ( z77CrkU?G9jdk`fPOi>Vkz{Q2aVz7)r(mja89Rd)LB=DLtVKH7vAn8R{Boj6@%3Tw$~O@Y$qq~5P*Or zfkV~8;@v_5iS{5$CYYii00F+w*>J_jt@VZEekCXF5P*Orf#VB*-(;{3f!*G6S}K=J zFhxNC0xzs1EVd~mkX#QUafbi|Bng~UXeb7264+T;O6XT|$pljr1R!u+O<}QFA%V1d z5Q#ekARtNLUxj*Nus(r=7G04{FhxNC0`#ji>{l6zKA{J{5qAhcK$5_FhCbp&V*&@x zJ~4^AI|LvgN#I?16EV_~K(sxGk_o0L z2teSnmd;}LJb`|HF3w-ci8}-!AW7icc?~hro{7WC=bRMEKx0$pljr1R!u{C(hy^g#=>jK_u=FfPf@{*A)tg!A=Oow&;pv zf+-3D5a9lJ+x5q*jUQDHB5{WR1SARky;?)O+mb+34}OzOFhxNC0&agBZ7D&G-M7~k zBWWim?ht^0B!L?>Tp4o}@$?`{CYYii0D*gBHlWPhB6;u|afbi|Bnez2+1bt zx{SFT|2>Gr9Rd)LB=C-*#|JMSb?AE=2YWH=PibzRdk`fPOi>Vkz|5G(2R}ajhAnQI zd$?e1Zp{1qrap0p00bln+*;`IY%sfNe#W)y9$aSp6h3C%GQkuD0SKH{$K!)-o_qZV zxM}Xf=H7Y`i8}-!AW7i#`X0}=%z6{KY3@ShTk8uR?yg8Cn4%y6flp24@xjJfZz4C% zJGZ%q9z@~}0SHJEcw+;P4|d@T{oShE!=fva38p9rK;S)%J)Z5D^(JOF&AZi^<)gXo zK_u=FfPf@{54Z97VBhSf`RlKFnPvZWRlDm4zey&Tq96c)N4EF);0W1G^K-6xLRUsJ zdmN{Wt`K(!KtPhf_q+1=;5dAtzvUIkX%C`gf+-3D5V)XQk7q|?72K98clY2o;tl}_ zND?@ybB_-W$SSyPY`)uDcF|5QnP7^700fHHJM2pCtb*Ij=8k$0i8}-!AW5Ltm9i_2 z!x#D+*nDSYsqj0o_Hu$ z!JW$Ho%bM0CYYii0D-NE^6h*BR>7@l^Q;H4+eKH1I|LvgN#KsoHC^X`gD>>63hqRq zciV#~nP7^700drHN4t);VHMno9?v%DaM2aw4gm;A68MfIN7p|rU+Ay4d4~^vlT0v0 zK>z|@sxMrpTe1pnh0Q;{|Kv^@SBN_VARtNLi%#u4)xlW>w@l?-ExIC^V2XkO1Rg(? zYCUYsD!7F<@1zHjxI+K}k_4XSLCpceO=+A7vy|&o+?uulBDGCA*SZ*WMAp06$1-DHPB5{WR1SAPu7{tXbPilM> z+^zM6X1|h4CYYii0D;G}RBFK8v);tBuHHZT*MN3jH|s$p?ht^0CV_w=?&Q?j7y362 z_UssZP-(LVziB3zsvuyVz!y4^Y1o6;$!G-(WnGPMfsw2Q8oPdfl0ph@7o806de9E_}jJ8ci5W`wB<0_F+)u5*V* zazG=i;7;}6H}h!+00cA%yebmyI+})sFZA#BmTR_?Yetx=AYh)rTOA2Bs>5opf?K}_ z(R|tg00B(`kBCaRPA4P03U18@ziCF8svuyVz#E*ZGq!`Pu7aEOAnwhsPQ1HfKJ5U2 zfF^-&#->^i^Ev78A-ym3*Xcpjj4)L}z&wGsdGKbOrx05OH|s&1xaf-cv;zPFngqTQ zr)0g&N@*3`i4T6$j4)L}z&wEsZ^n%FL|Jd*8P~3Bth81A;5YMW2LJ>#2^@%4ubwBS zu?lX#KUeX$othD*DhQY-aFJ(SMt(YhRd6eM5Y49@01(h5a9ZSI^*_DTztCT?=!#~9 zsR{z-37qa_OCwFjYaoJb{@|icILd zDXxNBxaf-cv;zPFngp&($fp6Pn&KDw^F4@~5vD2#m?!Y#fO1Uk)M>4Pn}6_|`LqK7 z0-6NQO-`o4C!EkKxZ7)sqwVCH5vD2#m?!YH;95*{0!e(Kf2;@5eA)p30ZjrgOjM&W zOgp=29{(5mx7HVizmjW4n5rOPp1@CH5Mt7Eh<_E_;e+4IryT$g&?NAqq#YX1pLPI1K$F13ZR*u?)sd`%s~KUcf`EAf`#c-X^67%Ff@?nQ0DyodftOnr zYmnNXe#2I%-bBp^Qxycv6JVXJd;Qxy)GD~<(+&U#XcG9ge~WR(0RjK3;A%#gsvuyV zz<04~SOPx3&~HBN0DyodffK@7jI$32_*n&4Gs08_0rLd@j7cLQ;9(V9^JxbF1T+b- zZf$_S=d8GLI9&x-Gs08_0rLc2Tj3Pm3Pm9MLjT6WUgzs3nom0bAfQR$AE8vmd8-My zSOr%z!c+wT^8_}kZNj@@33R&(uKBbB00No>cpgw(_s0t_8(n>&Uo*l~1p)H}t}he^ zgAo#FzY4DTv;zPFngl)@p|F@z8G)9o;A%#gsvuyVz=O+_!FaR;8h@eReA)p30Zjtu zL~AQ1R!tzgX+CXlqGp7t3IgT{@Lab9{+_c!=u@qNYd-A&fPf}}XH__Yw~`=Ge-&KK z2vZdV%oF%v5~^a76A9G$LcjU60{{Y=1Rgt45NwbTf$CLoH6u(_5HL^RDG5o6sn#S= zwhFHKv;zPFngsB8+JDbkX7<8Wa5W=LRS+;w;J7joFfKqK>rFiC>ixrY6V0a`01(h5 v@Js<)Q9?C=;VQVA5vD2#m?v;awE}oogTUYm{eQXFeBJ>70Yw5oo0<79sHAjz literal 0 HcmV?d00001 diff --git a/cmake/WixUI_FeatureTreeNoLicense.wxs b/cmake/WixUI_FeatureTreeNoLicense.wxs new file mode 100644 index 00000000..fe7f035f --- /dev/null +++ b/cmake/WixUI_FeatureTreeNoLicense.wxs @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + NOT Installed + Installed AND PATCH + + Installed + NOT Installed + 1 + + NOT Installed OR WixUI_InstallMode = "Change" + Installed AND NOT PATCH + Installed AND PATCH + + 1 + + 1 + 1 + 1 + 1 + + + + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..bf8e2722 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rl (0.7.0) UNRELEASED; urgency=low + + * Upstream build. + + -- Robotics Library Team Mon, 25 Sep 2017 12:00:00 +0100 diff --git a/extras/debian/compat b/debian/compat similarity index 100% rename from extras/debian/compat rename to debian/compat diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..2e2d66b5 --- /dev/null +++ b/debian/control @@ -0,0 +1,105 @@ +Source: rl +Priority: extra +Maintainer: Robotics Library Team +Build-Depends: debhelper (>= 7.0.50~), + cmake (>= 2.8.11), + doxygen, + graphviz, + libboost-all-dev (>= 1.46), + libbullet-dev, + libcoin60-dev | libcoin80-dev, + libcomedi-dev, + libdc1394-22-dev (>= 2.1), + libeigen3-dev (>= 3.2.0), + libnlopt-dev (>= 2.4.1), + libode-dev (>= 2:0.11), + libqt4-dev, + libqt4-opengl-dev, + libsimage-dev, + libsolid3d-dev (>= 3.5.6), + libsoqt4-dev, + libxml2-dev (>= 2.7), + libxslt1-dev (>= 1.1.26) +Standards-Version: 3.9.1 +Section: libs +Homepage: http://www.roboticslibrary.org/ + +Package: librl +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Runtime files for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the runtime files for RL. + +Package: librl-dbg +Section: debug +Architecture: any +Priority: extra +Depends: librl (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the debugging symbols for RL. + +Package: librl-demos +Section: misc +Architecture: any +Depends: librl (= ${binary:Version}), librl-examples (= ${binary:Version}), + ${shlibs:Depends}, ${misc:Depends} +Description: Demo programs for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the demo programs for RL. + +Package: librl-dev +Section: libdevel +Architecture: any +Depends: librl (= ${binary:Version}), + libboost-all-dev (>= 1.46), + libbullet-dev, + libcoin60-dev | libcoin80-dev, + libcomedi-dev, + libdc1394-22-dev (>= 2.1), + libeigen3-dev (>= 3.2.0), + libnlopt-dev (>= 2.4.1), + libode-dev (>= 2:0.11), + libqt4-dev, + libqt4-opengl-dev, + libsimage-dev, + libsolid3d-dev (>= 3.5.6), + libsoqt4-dev, + libxml2-dev (>= 2.7), + libxslt1-dev (>= 1.1.26) +Description: Development files for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the development files for RL. + +Package: librl-doc +Section: doc +Architecture: all +Priority: extra +Description: Documentation for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the documentation for RL. + +Package: librl-examples +Section: misc +Architecture: all +Description: Example files for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the example files for RL. + +Package: librl-extras +Section: misc +Architecture: any +Priority: extra +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Extra programs for the Robotics Library + The Robotics Library (RL) is a self-contained C++ library for robot + kinematics, visualization, motion planning, and control. + This package contains the extra programs for RL. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..f8ba5c03 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: Robotics Library +Upstream-Contact: Robotics Library Team +Source: http://www.roboticslibrary.org/ + +Files: * +Copyright: Copyright 2009 Robotics Library Team +License: BSD-2-clause + Copyright (c) 2009 + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/librl-demos.install b/debian/librl-demos.install new file mode 100644 index 00000000..27104fb0 --- /dev/null +++ b/debian/librl-demos.install @@ -0,0 +1,3 @@ +usr/bin/rl* +usr/share/applications/rl*.desktop +usr/share/icons/hicolor/scalable/apps/robotics-library.svg diff --git a/debian/librl-dev.install b/debian/librl-dev.install new file mode 100644 index 00000000..a8d6f39d --- /dev/null +++ b/debian/librl-dev.install @@ -0,0 +1,3 @@ +usr/include/* +usr/lib/*/lib{*.a,*.so} +usr/lib/*/cmake/rl*/* diff --git a/debian/librl-doc.install b/debian/librl-doc.install new file mode 100644 index 00000000..d9d4f6f8 --- /dev/null +++ b/debian/librl-doc.install @@ -0,0 +1 @@ +usr/share/doc/* diff --git a/debian/librl-examples.install b/debian/librl-examples.install new file mode 100644 index 00000000..e32d7756 --- /dev/null +++ b/debian/librl-examples.install @@ -0,0 +1,2 @@ +usr/share/gtksourceview-3.0/* +usr/share/rl*/examples/* diff --git a/debian/librl-extras.install b/debian/librl-extras.install new file mode 100644 index 00000000..eb82793c --- /dev/null +++ b/debian/librl-extras.install @@ -0,0 +1,3 @@ +usr/bin/wrlview* +usr/share/applications/wrlview.desktop +usr/share/icons/hicolor/scalable/apps/wrlview.svg diff --git a/debian/librl.install b/debian/librl.install new file mode 100644 index 00000000..3ddde584 --- /dev/null +++ b/debian/librl.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* diff --git a/debian/rules b/debian/rules new file mode 100644 index 00000000..dbc87ef6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +export DH_VERBOSE=1 +export DEB_BUILD_OPTIONS=parallel=4 + +override_dh_auto_configure: + dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_DOCUMENTATION=ON + +override_dh_auto_test: + dh_auto_test -- ARGS+=--output-on-failure + +override_dh_strip: + dh_strip --dbg-package=librl-dbg + +%: + dh $@ --buildsystem=cmake --parallel diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt new file mode 100644 index 00000000..55fa3654 --- /dev/null +++ b/demos/CMakeLists.txt @@ -0,0 +1,68 @@ +if(BUILD_RL_MATH) + add_subdirectory(rlDenavitHartenbergDemo) + add_subdirectory(rlEulerAnglesDemo) + add_subdirectory(rlFilterDemo) + add_subdirectory(rlInterpolatorDemo) + add_subdirectory(rlPcaDemo) + add_subdirectory(rlQuaternionDemo) + add_subdirectory(rlPolynomialRootsDemo) + add_subdirectory(rlSpatialDemo) + add_subdirectory(rlTrapezoidalVelocityDemo) +endif() + +if(BUILD_RL_UTIL) + add_subdirectory(rlThreadsDemo) + add_subdirectory(rlTimerDemo) +endif() + +if(BUILD_RL_XML) + add_subdirectory(rlLoadXmlDemo) +endif() + +if(BUILD_RL_KIN) + add_subdirectory(rlJacobianDemo) + add_subdirectory(rlPumaDemo) +endif() + +if(BUILD_RL_MDL) + add_subdirectory(rlDynamics1Demo) + add_subdirectory(rlDynamics2Demo) + add_subdirectory(rlInversePositionDemo) +endif() + +if(BUILD_RL_HAL) + add_subdirectory(rlAxisControllerDemo) + add_subdirectory(rlCameraDemo) + add_subdirectory(rlGripperDemo) + add_subdirectory(rlLaserDemo) + add_subdirectory(rlRangeSensorDemo) + add_subdirectory(rlSixAxisForceTorqueSensorDemo) + add_subdirectory(rlSocketDemo) +endif() + +if(BUILD_RL_SG) + add_subdirectory(rlCollisionDemo) + add_subdirectory(rlViewDemo) +endif() + +if(BUILD_RL_KIN AND BUILD_RL_SG) + add_subdirectory(rlCoachKin) +endif() + +if(BUILD_RL_MDL AND BUILD_RL_SG) + add_subdirectory(rlCoachMdl) + add_subdirectory(rlSimulator) +endif() + +if(BUILD_RL_PLAN) + add_subdirectory(rlPlanDemo) + add_subdirectory(rlPrmDemo) +endif() + +set(CPACK_NSIS_CREATE_ICONS_EXTRA ${CPACK_NSIS_CREATE_ICONS_EXTRA} PARENT_SCOPE) +set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} PARENT_SCOPE) +set(WIX_SHORTCUTS ${WIX_SHORTCUTS} PARENT_SCOPE) + +if(UNIX) + install(FILES ${rl_SOURCE_DIR}/robotics-library.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps COMPONENT demos) +endif() diff --git a/demos/rlAxisControllerDemo/CMakeLists.txt b/demos/rlAxisControllerDemo/CMakeLists.txt index 49726372..8a4fae81 100644 --- a/demos/rlAxisControllerDemo/CMakeLists.txt +++ b/demos/rlAxisControllerDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlAxisControllerDemo) - add_executable( rlAxisControllerDemo rlAxisControllerDemo.cpp @@ -7,6 +5,6 @@ add_executable( target_link_libraries( rlAxisControllerDemo - rlhal - rlmath + hal + math ) diff --git a/demos/rlAxisControllerDemo/rlAxisControllerDemo.cpp b/demos/rlAxisControllerDemo/rlAxisControllerDemo.cpp index 45df7bb2..ed0559bf 100644 --- a/demos/rlAxisControllerDemo/rlAxisControllerDemo.cpp +++ b/demos/rlAxisControllerDemo/rlAxisControllerDemo.cpp @@ -29,13 +29,14 @@ #include #include #include -#include -#include +#include +#include #include #define COACH //#define GNUPLOT //#define MITSUBISHI +//#define UNIVERSAL_ROBOTS_RTDE #define CUBIC //#define QUINTIC @@ -46,90 +47,85 @@ main(int argc, char** argv) try { #ifdef COACH - rl::hal::Coach controller(6, 0.00711f, 0, "localhost"); + rl::hal::Coach controller(6, std::chrono::microseconds(7110), 0, "localhost"); #endif // COACH #ifdef GNUPLOT - rl::hal::Gnuplot controller(6, 0.00711f, -10.0f * rl::math::DEG2RAD, 10.0f * rl::math::DEG2RAD); + rl::hal::Gnuplot controller(6, std::chrono::microseconds(7110), -10.0f * rl::math::DEG2RAD, 10.0f * rl::math::DEG2RAD); #endif // GNUPLOT #ifdef MITSUBISHI rl::hal::MitsubishiH7 controller(6, "left", "lefthost"); #endif // MITSUBISHI +#ifdef UNIVERSAL_ROBOTS_RTDE + rl::hal::UniversalRobotsRtde controller("localhost"); +#endif // UNIVERSAL_ROBOTS_RTDE + + rl::math::Real updateRate = std::chrono::duration_cast>(controller.getUpdateRate()).count(); controller.open(); controller.start(); controller.step(); - rl::math::Vector x0(controller.getDof()); - x0.setZero(); -#ifdef MITSUBISHI - controller.getJointPosition(x0); -#endif // MITSUBISHI + rl::math::Vector q0 = controller.getJointPosition(); + rl::math::Vector q1 = q0 + rl::math::Vector::Constant(controller.getDof(), 5.0f * rl::math::DEG2RAD); - rl::math::Vector xe(controller.getDof()); - xe = x0 + ::rl::math::Vector::Constant(controller.getDof(), 5.0f * rl::math::DEG2RAD); + rl::math::Real te = updateRate * 300.0f; + + rl::math::Vector q(controller.getDof()); #ifdef CUBIC - std::vector< rl::math::Cubic< rl::math::Real > > interpolator(controller.getDof()); + rl::math::Polynomial interpolator = rl::math::Polynomial::CubicFirst( + q0, + q1, + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + te + ); #endif // CUBIC #ifdef QUINTIC - std::vector< rl::math::Quintic< rl::math::Real > > interpolator(controller.getDof()); + rl::math::Polynomial interpolator = rl::math::Polynomial::QuinticFirstSecond( + q0, + q1, + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + te + ); #endif // QUINTIC - rl::math::Real te = controller.getUpdateRate() * 300.0f; - - for (std::size_t i = 0; i < interpolator.size(); ++i) - { - interpolator[i].te = te; - interpolator[i].v0 = 0; - interpolator[i].ve = 0; -#ifdef QUINTIC - interpolator[i].a0 = 0; - interpolator[i].ae = 0; -#endif // QUINTIC - } - - rl::math::Vector x(controller.getDof()); - - // start -> goal - - for (std::size_t i = 0; i < interpolator.size(); ++i) - { - interpolator[i].x0 = x0[i]; - interpolator[i].xe = xe[i]; - interpolator[i].interpolate(); - } - - for (std::size_t i = 0; i <= std::ceil(te / controller.getUpdateRate()); ++i) + for (std::size_t i = 0; i <= std::ceil(te / updateRate); ++i) { - for (std::size_t j = 0; j < controller.getDof(); ++j) - { - x(j) = interpolator[j].x(i * controller.getUpdateRate()); - } - - controller.setJointPosition(x); - + q = interpolator(i * updateRate); + controller.setJointPosition(q); controller.step(); } - // goal -> start - - for (std::size_t i = 0; i < interpolator.size(); ++i) - { - interpolator[i].x0 = xe[i]; - interpolator[i].xe = x0[i]; - interpolator[i].interpolate(); - } +#ifdef CUBIC + interpolator = rl::math::Polynomial::CubicFirst( + q1, + q0, + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + te + ); +#endif // CUBIC +#ifdef QUINTIC + interpolator = rl::math::Polynomial::QuinticFirstSecond( + q1, + q0, + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + rl::math::Vector::Zero(controller.getDof()), + te + ); +#endif // QUINTIC - for (std::size_t i = 0; i <= std::ceil(te / controller.getUpdateRate()); ++i) + for (std::size_t i = 0; i <= std::ceil(te / updateRate); ++i) { - for (std::size_t j = 0; j < controller.getDof(); ++j) - { - x(j) = interpolator[j].x(i * controller.getUpdateRate()); - } - - controller.setJointPosition(x); - + q = interpolator(i * updateRate); + controller.setJointPosition(q); controller.step(); } @@ -139,8 +135,8 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlCameraDemo/CMakeLists.txt b/demos/rlCameraDemo/CMakeLists.txt index b04abbbb..99b16610 100644 --- a/demos/rlCameraDemo/CMakeLists.txt +++ b/demos/rlCameraDemo/CMakeLists.txt @@ -1,8 +1,6 @@ -project(rlCameraDemo) +find_package(libdc1394) -find_package(Libdc1394) - -if(LIBDC1394_FOUND) +if(libdc1394_FOUND) add_executable( rlCameraDemo rlCameraDemo.cpp @@ -10,6 +8,6 @@ if(LIBDC1394_FOUND) target_link_libraries( rlCameraDemo - rlhal + hal ) -endif(LIBDC1394_FOUND) +endif() diff --git a/demos/rlCameraDemo/rlCameraDemo.cpp b/demos/rlCameraDemo/rlCameraDemo.cpp index 985c6329..c183c9f2 100644 --- a/demos/rlCameraDemo/rlCameraDemo.cpp +++ b/demos/rlCameraDemo/rlCameraDemo.cpp @@ -27,8 +27,8 @@ #include #include #include +#include #include -#include int main(int argc, char** argv) @@ -67,11 +67,11 @@ main(int argc, char** argv) dc1394.stop(); dc1394.close(); } - catch (const rl::hal::Exception& e) + catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlCoachKin/CMakeLists.txt b/demos/rlCoachKin/CMakeLists.txt index 918f583d..ef933677 100644 --- a/demos/rlCoachKin/CMakeLists.txt +++ b/demos/rlCoachKin/CMakeLists.txt @@ -1,13 +1,24 @@ -project(rlCoachKin) +find_package(OpenGL REQUIRED) +find_package(SoQt) -find_package(Boost REQUIRED) -find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL) -set(QT_USE_QTMAIN TRUE) -include(${QT_USE_FILE}) +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui Network OpenGL Widgets QUIET) +endif() -find_package(SoQt) +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(QT_FOUND AND SOQT_FOUND) +if(QT_FOUND AND SoQt_FOUND) set( HDRS ConfigurationDelegate.h @@ -17,6 +28,7 @@ if(QT_FOUND AND SOQT_FOUND) OperationalModel.h Server.h Socket.h + SoGradientBackground.h ) set( @@ -29,61 +41,54 @@ if(QT_FOUND AND SOQT_FOUND) rlCoachKin.cpp Server.cpp Socket.cpp + SoGradientBackground.cpp ${rl_SOURCE_DIR}/robotics-library.rc ) - qt4_wrap_cpp( - MOC_SRCS - ConfigurationDelegate.h - ConfigurationModel.h - MainWindow.h - OperationalDelegate.h - OperationalModel.h - Server.h - Socket.h - OPTIONS - -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED - ) - add_executable( rlCoachKin WIN32 ${HDRS} ${SRCS} - ${MOC_SRCS} ) target_compile_definitions( rlCoachKin PUBLIC - ${QT_DEFINITIONS} - ${SOQT_DEFINITIONS} + ${SoQt_DEFINITIONS} ) target_include_directories( rlCoachKin PUBLIC - ${Boost_INCLUDE_DIR} - ${QT_INCLUDES} - ${SOQT_INCLUDE_DIRS} + ${OPENGL_INCLUDE_DIR} + ${SoQt_INCLUDE_DIRS} ) target_link_libraries( rlCoachKin - rlkin - rlmath - rlsg + kin + math + sg + ${OPENGL_LIBRARIES} ${QT_LIBRARIES} - ${SOQT_LIBRARIES} + ${SoQt_LIBRARIES} ) set_target_properties( rlCoachKin PROPERTIES VERSION ${VERSION} - DEBUG_POSTFIX d ) + if(WIN32) + set_target_properties( + rlCoachKin + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + install( TARGETS rlCoachKin COMPONENT demos @@ -92,23 +97,42 @@ if(QT_FOUND AND SOQT_FOUND) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + if(UNIX) - install(FILES rlCoachKin.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) - endif(UNIX) + configure_file(rlCoachKin.desktop.in rlCoachKin.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlCoachKin.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} "CreateShortCut \\\\ \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlCoachKin.lnk\\\" \\\\ \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlCoachKin.exe\\\" \\\\ \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\" \\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlkin\\\\unimation-puma560.xml\\\$\\\\\\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\" \\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlkin\\\\unimation-puma560.xml\\\$\\\\\\\"\\\\ \\\" \\\\ \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ \\\"Visualization and kinematics demo with Unimation Puma 560\\\"" PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCoachKin.lnk\\\"" PARENT_SCOPE) -endif(QT_FOUND AND SOQT_FOUND) + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCoachKin.lnk\\\"" PARENT_SCOPE) + + set( + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" + PARENT_SCOPE + ) +endif() diff --git a/demos/rlCoachKin/ConfigurationDelegate.cpp b/demos/rlCoachKin/ConfigurationDelegate.cpp index 72e75ac4..f43d327e 100644 --- a/demos/rlCoachKin/ConfigurationDelegate.cpp +++ b/demos/rlCoachKin/ConfigurationDelegate.cpp @@ -49,20 +49,22 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& MainWindow::instance()->kinematicModels[this->id]->getMaximum(maximum); rl::math::Vector minimum(MainWindow::instance()->kinematicModels[this->id]->getDof()); MainWindow::instance()->kinematicModels[this->id]->getMinimum(minimum); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); + Eigen::Matrix qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { + editor->setDecimals(2); editor->setMinimum(minimum(index.row()) * rl::math::RAD2DEG); editor->setMaximum(maximum(index.row()) * rl::math::RAD2DEG); editor->setSingleStep(1.0f); } else { + editor->setDecimals(4); editor->setMinimum(minimum(index.row())); editor->setMaximum(maximum(index.row())); - editor->setSingleStep(0.1f); + editor->setSingleStep(0.01f); } QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); @@ -73,19 +75,19 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& void ConfigurationDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } void ConfigurationDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); doubleSpinBox->interpretText(); if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) { - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } } @@ -98,5 +100,5 @@ ConfigurationDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionV void ConfigurationDelegate::valueChanged(double d) { - emit commitData(static_cast< QWidget* >(QObject::sender())); + emit commitData(static_cast(QObject::sender())); } diff --git a/demos/rlCoachKin/ConfigurationDelegate.h b/demos/rlCoachKin/ConfigurationDelegate.h index 31654638..8e1c1b07 100644 --- a/demos/rlCoachKin/ConfigurationDelegate.h +++ b/demos/rlCoachKin/ConfigurationDelegate.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONDELEGATE_H_ -#define _CONFIGURATIONDELEGATE_H_ +#ifndef CONFIGURATIONDELEGATE_H +#define CONFIGURATIONDELEGATE_H #include @@ -34,16 +34,16 @@ class ConfigurationDelegate : public QItemDelegate Q_OBJECT public: - ConfigurationDelegate(QObject* parent = NULL); + ConfigurationDelegate(QObject* parent = nullptr); virtual ~ConfigurationDelegate(); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - + void setEditorData(QWidget* editor, const QModelIndex& index) const; - + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; std::size_t id; @@ -57,4 +57,4 @@ public slots: }; -#endif // _CONFIGURATIONDELEGATE_H_ +#endif // CONFIGURATIONDELEGATE_H diff --git a/demos/rlCoachKin/ConfigurationModel.cpp b/demos/rlCoachKin/ConfigurationModel.cpp index a02343d4..7f5441de 100644 --- a/demos/rlCoachKin/ConfigurationModel.cpp +++ b/demos/rlCoachKin/ConfigurationModel.cpp @@ -48,7 +48,7 @@ ConfigurationModel::columnCount(const QModelIndex& parent) const QVariant ConfigurationModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -58,28 +58,39 @@ ConfigurationModel::data(const QModelIndex& index, int role) const return QVariant(); } + rl::math::Vector q(MainWindow::instance()->kinematicModels[this->id]->getDof()); + MainWindow::instance()->kinematicModels[this->id]->getPosition(q); + Eigen::Matrix qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); + MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); + switch (role) { case Qt::DisplayRole: + switch (qUnits(index.row())) + { + case rl::math::UNIT_METER: + return QString::number(q(index.row()), 'f', 4) + QString(" m"); + break; + case rl::math::UNIT_RADIAN: + return QString::number(q(index.row()) * rl::math::RAD2DEG, 'f', 2) + QChar(176); + break; + default: + return q(index.row()); + break; + } + break; case Qt::EditRole: + if (rl::math::UNIT_RADIAN == qUnits(index.row())) { - rl::math::Vector q(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getPosition(q); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); - - if (rl::math::UNIT_RADIAN == qUnits(index.row())) - { - return q(index.row()) * rl::math::RAD2DEG; - } - else - { - return q(index.row()); - } + return q(index.row()) * rl::math::RAD2DEG; + } + else + { + return q(index.row()); } break; case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -113,13 +124,14 @@ ConfigurationModel::headerData(int section, Qt::Orientation orientation, int rol void ConfigurationModel::operationalChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } int ConfigurationModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return 0; } @@ -130,7 +142,7 @@ ConfigurationModel::rowCount(const QModelIndex& parent) const bool ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } @@ -139,25 +151,25 @@ ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int { rl::math::Vector q(MainWindow::instance()->kinematicModels[this->id]->getDof()); MainWindow::instance()->kinematicModels[this->id]->getPosition(q); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); + Eigen::Matrix qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { - q(index.row()) = value.value< ::rl::math::Real >() * rl::math::DEG2RAD; + q(index.row()) = value.value() * rl::math::DEG2RAD; } else { - q(index.row()) = value.value< ::rl::math::Real >(); + q(index.row()) = value.value(); } MainWindow::instance()->kinematicModels[this->id]->setPosition(q); MainWindow::instance()->kinematicModels[this->id]->updateFrames(); - - for (std::size_t i = 0; i < MainWindow::instance()->geometryModels[this->id]->getNumBodies(); ++i) - { - MainWindow::instance()->geometryModels[this->id]->getBody(i)->setFrame(MainWindow::instance()->kinematicModels[this->id]->getFrame(i)); - } + + for (std::size_t i = 0; i < MainWindow::instance()->geometryModels[this->id]->getNumBodies(); ++i) + { + MainWindow::instance()->geometryModels[this->id]->getBody(i)->setFrame(MainWindow::instance()->kinematicModels[this->id]->getFrame(i)); + } emit dataChanged(index, index); @@ -170,7 +182,7 @@ ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int bool ConfigurationModel::setData(const rl::math::Vector& q) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } diff --git a/demos/rlCoachKin/ConfigurationModel.h b/demos/rlCoachKin/ConfigurationModel.h index fc34f465..c29f068f 100644 --- a/demos/rlCoachKin/ConfigurationModel.h +++ b/demos/rlCoachKin/ConfigurationModel.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONMODEL_H_ -#define _CONFIGURATIONMODEL_H_ +#ifndef CONFIGURATIONMODEL_H +#define CONFIGURATIONMODEL_H #include #include @@ -35,7 +35,7 @@ class ConfigurationModel : public QAbstractTableModel Q_OBJECT public: - ConfigurationModel(QObject* parent = NULL); + ConfigurationModel(QObject* parent = nullptr); virtual ~ConfigurationModel(); @@ -64,4 +64,4 @@ public slots: }; -#endif // _CONFIGURATIONMODEL_H_ +#endif // CONFIGURATIONMODEL_H diff --git a/demos/rlCoachKin/MainWindow.cpp b/demos/rlCoachKin/MainWindow.cpp index ef51386b..8d121d89 100644 --- a/demos/rlCoachKin/MainWindow.cpp +++ b/demos/rlCoachKin/MainWindow.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -38,8 +37,9 @@ #include "OperationalDelegate.h" #include "OperationalModel.h" #include "Server.h" +#include "SoGradientBackground.h" -MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : +MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags f) : QMainWindow(parent, f), configurationModels(), scene(), @@ -47,27 +47,35 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : configurationDockWidget(new QDockWidget(this)), configurationTabWidget(new QTabWidget(this)), configurationViews(), + gradientBackground(), operationalDelegates(), operationalDockWidget(new QDockWidget(this)), operationalTabWidget(new QTabWidget(this)), operationalViews(), - saveImageAction(new QAction(this)), + saveImageWithAlphaAction(new QAction(this)), + saveImageWithoutAlphaAction(new QAction(this)), saveSceneAction(new QAction(this)), server(new Server(this)), - viewer(NULL) + viewer(nullptr) { MainWindow::singleton = this; SoQt::init(this); SoDB::init(); + SoGradientBackground::initClass(); - this->scene = boost::make_shared< rl::sg::so::Scene >(); + QGLFormat format; + format.setAlpha(true); + format.setSampleBuffers(true); + QGLFormat::setDefaultFormat(format); + + this->scene = std::make_shared(); this->scene->load(QApplication::arguments()[1].toStdString()); for (int i = 2; i < QApplication::arguments().size(); ++i) { this->geometryModels.push_back(this->scene->getModel(i - 2)); - boost::shared_ptr< rl::kin::Kinematics > kinematicModel; + std::shared_ptr kinematicModel; kinematicModel.reset(rl::kin::Kinematics::create(QApplication::arguments()[i].toStdString())); this->kinematicModels.push_back(kinematicModel); } @@ -83,12 +91,15 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->configurationModels.push_back(configurationModel); QTableView* configurationView = new QTableView(this); +#if QT_VERSION >= 0x050000 + configurationView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION configurationView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION configurationView->horizontalHeader()->hide(); configurationView->setAlternatingRowColors(true); configurationView->setItemDelegate(configurationDelegate); configurationView->setModel(configurationModel); - configurationView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); this->configurationViews.push_back(configurationView); this->configurationTabWidget->addTab(configurationView, QString::number(i)); @@ -101,11 +112,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->operationalModels.push_back(operationalModel); QTableView* operationalView = new QTableView(this); +#if QT_VERSION >= 0x050000 + operationalView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION operationalView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION operationalView->setAlternatingRowColors(true); operationalView->setItemDelegate(operationalDelegate); operationalView->setModel(operationalModel); - operationalView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); this->operationalViews.push_back(operationalView); this->operationalTabWidget->addTab(operationalView, QString::number(i)); @@ -129,17 +143,24 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : configurationModel->setData(q); } - this->addDockWidget(Qt::LeftDockWidgetArea, configurationDockWidget); this->configurationDockWidget->resize(160, 320); this->configurationDockWidget->setWidget(this->configurationTabWidget); this->configurationDockWidget->setWindowTitle("Configuration"); - this->addDockWidget(Qt::LeftDockWidgetArea, operationalDockWidget); this->operationalDockWidget->resize(160, 320); this->operationalDockWidget->setWidget(this->operationalTabWidget); this->operationalDockWidget->setWindowTitle("Operational"); - this->viewer = new SoQtExaminerViewer(this, NULL, true, SoQtFullViewer::BUILD_POPUP); + this->addDockWidget(Qt::LeftDockWidgetArea, this->configurationDockWidget); + this->addDockWidget(Qt::BottomDockWidgetArea, this->operationalDockWidget); + + this->gradientBackground = new SoGradientBackground(); + this->gradientBackground->ref(); + this->gradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); + this->scene->root->insertChild(this->gradientBackground, 0); + + this->viewer = new SoQtExaminerViewer(this, nullptr, true, SoQtFullViewer::BUILD_POPUP); this->viewer->setSceneGraph(this->scene->root); this->viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); this->viewer->viewAll(); @@ -156,13 +177,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : MainWindow::~MainWindow() { - MainWindow::singleton = NULL; + this->gradientBackground->unref(); + MainWindow::singleton = nullptr; } MainWindow* MainWindow::instance() { - if (NULL == MainWindow::singleton) + if (nullptr == MainWindow::singleton) { new MainWindow(); } @@ -176,9 +198,13 @@ MainWindow::init() this->configurationDockWidget->toggleViewAction()->setShortcut(QKeySequence("F5")); this->addAction(this->configurationDockWidget->toggleViewAction()); - this->saveImageAction->setShortcut(QKeySequence("Return")); - QObject::connect(this->saveImageAction, SIGNAL(triggered()), this, SLOT(saveImage())); - this->addAction(this->saveImageAction); + this->saveImageWithoutAlphaAction->setShortcut(QKeySequence("Return")); + QObject::connect(this->saveImageWithoutAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithoutAlpha())); + this->addAction(this->saveImageWithoutAlphaAction); + + this->saveImageWithAlphaAction->setShortcut(QKeySequence("Shift+Return")); + QObject::connect(this->saveImageWithAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithAlpha())); + this->addAction(this->saveImageWithAlphaAction); this->saveSceneAction->setShortcut(QKeySequence("Ctrl+Return")); QObject::connect(this->saveSceneAction, SIGNAL(triggered()), this, SLOT(saveScene())); @@ -186,10 +212,36 @@ MainWindow::init() } void -MainWindow::saveImage() +MainWindow::saveImage(bool withAlpha) +{ + if (withAlpha) + { + this->scene->root->removeChild(this->gradientBackground); + this->viewer->render(); + } + + glReadBuffer(GL_FRONT); + QImage image = static_cast(this->viewer->getGLWidget())->grabFrameBuffer(withAlpha); + + if (withAlpha) + { + this->scene->root->insertChild(this->gradientBackground, 0); + this->viewer->render(); + } + + image.save("rlCoachKin-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png", "PNG"); +} + +void +MainWindow::saveImageWithAlpha() +{ + this->saveImage(true); +} + +void +MainWindow::saveImageWithoutAlpha() { - QImage image = static_cast< QGLWidget* >(this->viewer->getGLWidget())->grabFrameBuffer(true); - image.save("coach-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png", "PNG"); + this->saveImage(false); } void diff --git a/demos/rlCoachKin/MainWindow.h b/demos/rlCoachKin/MainWindow.h index 72fe99b9..22edccf7 100644 --- a/demos/rlCoachKin/MainWindow.h +++ b/demos/rlCoachKin/MainWindow.h @@ -24,16 +24,16 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _MAINWINDOW_H_ -#define _MAINWINDOW_H_ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H +#include #include #include #include #include #include #include -#include #include #include #include @@ -44,6 +44,7 @@ class ConfigurationModel; class OperationalDelegate; class OperationalModel; class Server; +class SoGradientBackground; class MainWindow : public QMainWindow { @@ -54,44 +55,52 @@ class MainWindow : public QMainWindow static MainWindow* instance(); - std::vector< ConfigurationModel* > configurationModels; + std::vector configurationModels; - std::vector< rl::sg::Model* > geometryModels; + std::vector geometryModels; - std::vector< boost::shared_ptr< rl::kin::Kinematics > > kinematicModels; + std::vector> kinematicModels; - std::vector< OperationalModel* > operationalModels; + std::vector operationalModels; - boost::shared_ptr< rl::sg::so::Scene > scene; + std::shared_ptr scene; public slots: - void saveImage(); + void saveImageWithAlpha(); + + void saveImageWithoutAlpha(); void saveScene(); protected: - MainWindow(QWidget* parent = NULL, Qt::WindowFlags f = 0); + MainWindow(QWidget* parent = nullptr, Qt::WindowFlags f = 0); private: void init(); - std::vector< ConfigurationDelegate* > configurationDelegates; + void saveImage(bool withAlpha); + + std::vector configurationDelegates; QDockWidget* configurationDockWidget; QTabWidget* configurationTabWidget; - std::vector< QTableView* > configurationViews; + std::vector configurationViews; - std::vector< OperationalDelegate* > operationalDelegates; + SoGradientBackground* gradientBackground; + + std::vector operationalDelegates; QDockWidget* operationalDockWidget; QTabWidget* operationalTabWidget; - std::vector< QTableView* > operationalViews; + std::vector operationalViews; + + QAction* saveImageWithAlphaAction; - QAction* saveImageAction; + QAction* saveImageWithoutAlphaAction; QAction* saveSceneAction; @@ -102,4 +111,4 @@ public slots: SoQtExaminerViewer* viewer; }; -#endif // _MAINWINDOW_H_ +#endif // MAINWINDOW_H diff --git a/demos/rlCoachKin/OperationalDelegate.cpp b/demos/rlCoachKin/OperationalDelegate.cpp index c8636535..a71f3f12 100644 --- a/demos/rlCoachKin/OperationalDelegate.cpp +++ b/demos/rlCoachKin/OperationalDelegate.cpp @@ -44,19 +44,21 @@ OperationalDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& o { QDoubleSpinBox* editor = new QDoubleSpinBox(parent); - editor->setMaximum(std::numeric_limits< double >::max()); - editor->setMinimum(-std::numeric_limits< double >::max()); + editor->setMaximum(std::numeric_limits::max()); + editor->setMinimum(-std::numeric_limits::max()); switch (index.column()) { case 0: case 1: case 2: + editor->setDecimals(4); editor->setSingleStep(0.01f); break; case 3: case 4: case 5: + editor->setDecimals(2); editor->setSingleStep(1.0f); break; default: @@ -71,19 +73,19 @@ OperationalDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& o void OperationalDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } void OperationalDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); doubleSpinBox->interpretText(); if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) { - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } } @@ -96,5 +98,5 @@ OperationalDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionVie void OperationalDelegate::valueChanged(double d) { - emit commitData(static_cast< QWidget* >(QObject::sender())); + emit commitData(static_cast(QObject::sender())); } diff --git a/demos/rlCoachKin/OperationalDelegate.h b/demos/rlCoachKin/OperationalDelegate.h index 1b74453c..2e1f4108 100644 --- a/demos/rlCoachKin/OperationalDelegate.h +++ b/demos/rlCoachKin/OperationalDelegate.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _OPERATIONALDELEGATE_H_ -#define _OPERATIONALDELEGATE_H_ +#ifndef OPERATIONALDELEGATE_H +#define OPERATIONALDELEGATE_H #include @@ -34,16 +34,16 @@ class OperationalDelegate : public QItemDelegate Q_OBJECT public: - OperationalDelegate(QObject* parent = NULL); + OperationalDelegate(QObject* parent = nullptr); virtual ~OperationalDelegate(); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - + void setEditorData(QWidget* editor, const QModelIndex& index) const; - + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; public slots: @@ -55,4 +55,4 @@ public slots: }; -#endif // _OPERATIONALDELEGATE_H_ +#endif // OPERATIONALDELEGATE_H diff --git a/demos/rlCoachKin/OperationalModel.cpp b/demos/rlCoachKin/OperationalModel.cpp index 4b4f72db..1474d8da 100644 --- a/demos/rlCoachKin/OperationalModel.cpp +++ b/demos/rlCoachKin/OperationalModel.cpp @@ -51,13 +51,14 @@ OperationalModel::columnCount(const QModelIndex& parent) const void OperationalModel::configurationChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } QVariant OperationalModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -67,41 +68,48 @@ OperationalModel::data(const QModelIndex& index, int role) const return QVariant(); } + const rl::math::Transform& transform = MainWindow::instance()->kinematicModels[this->id]->forwardPosition(index.row()); + rl::math::Transform::ConstTranslationPart position = transform.translation(); + rl::math::Vector3 orientation = transform.rotation().eulerAngles(2, 1, 0).reverse(); + switch (role) { case Qt::DisplayRole: + switch (index.column()) + { + case 0: + case 1: + case 2: + return QString::number(position(index.column()), 'f', 4) + QString(" m"); + break; + case 3: + case 4: + case 5: + return QString::number(orientation(index.column() - 3) * rl::math::RAD2DEG, 'f', 2) + QChar(176); + break; + default: + break; + } + break; case Qt::EditRole: + switch (index.column()) { - const rl::math::Transform::ConstTranslationPart& position = MainWindow::instance()->kinematicModels[this->id]->forwardPosition(index.row()).translation(); - rl::math::Vector3 orientation = MainWindow::instance()->kinematicModels[this->id]->forwardPosition(index.row()).rotation().eulerAngles(2, 1, 0).reverse(); - - switch (index.column()) - { - case 0: - return position.x(); - break; - case 1: - return position.y(); - break; - case 2: - return position.z(); - break; - case 3: - return orientation.x() * rl::math::RAD2DEG; - break; - case 4: - return orientation.y() * rl::math::RAD2DEG; - break; - case 5: - return orientation.z() * rl::math::RAD2DEG; - break; - default: - break; - } + case 0: + case 1: + case 2: + return position(index.column()); + break; + case 3: + case 4: + case 5: + return orientation(index.column() - 3) * rl::math::RAD2DEG; + break; + default: + break; } break; case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -124,7 +132,7 @@ OperationalModel::flags(const QModelIndex &index) const QVariant OperationalModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -167,7 +175,7 @@ OperationalModel::headerData(int section, Qt::Orientation orientation, int role) int OperationalModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return 0; } @@ -178,46 +186,40 @@ OperationalModel::rowCount(const QModelIndex& parent) const bool OperationalModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } if (index.isValid() && Qt::EditRole == role) { - rl::math::Transform x = MainWindow::instance()->kinematicModels[this->id]->forwardPosition(index.row()); - - rl::math::Transform::TranslationPart position = x.translation(); - rl::math::Vector3 orientation = x.linear().eulerAngles(2, 1, 0).reverse(); + rl::math::Transform transform = MainWindow::instance()->kinematicModels[this->id]->forwardPosition(index.row()); + rl::math::Vector3 orientation = transform.linear().eulerAngles(2, 1, 0).reverse(); switch (index.column()) { case 0: - x.translation().x() = value.value< rl::math::Real >(); - break; case 1: - x.translation().y() = value.value< rl::math::Real >(); - break; case 2: - x.translation().z() = value.value< rl::math::Real >(); + transform.translation()(index.column()) = value.value(); break; case 3: - x.linear() = ( + transform.linear() = ( rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) ).toRotationMatrix(); break; case 4: - x.linear() = ( + transform.linear() = ( rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) ).toRotationMatrix(); break; case 5: - x.linear() = ( - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + transform.linear() = ( + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) ).toRotationMatrix(); @@ -230,7 +232,7 @@ OperationalModel::setData(const QModelIndex& index, const QVariant& value, int r MainWindow::instance()->kinematicModels[this->id]->getPosition(q); rl::math::Vector qInv(MainWindow::instance()->kinematicModels[this->id]->getDof()); - if (MainWindow::instance()->kinematicModels[this->id]->inversePosition(x, qInv, index.row(), 1.0f)) + if (MainWindow::instance()->kinematicModels[this->id]->inversePosition(transform, qInv, index.row(), 1.0f)) { MainWindow::instance()->kinematicModels[this->id]->setPosition(qInv); MainWindow::instance()->kinematicModels[this->id]->updateFrames(); diff --git a/demos/rlCoachKin/OperationalModel.h b/demos/rlCoachKin/OperationalModel.h index b443f324..2f4bfb0c 100644 --- a/demos/rlCoachKin/OperationalModel.h +++ b/demos/rlCoachKin/OperationalModel.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _OPERATIONALMODEL_H_ -#define _OPERATIONALMODEL_H_ +#ifndef OPERATIONALMODEL_H +#define OPERATIONALMODEL_H #include @@ -34,7 +34,7 @@ class OperationalModel : public QAbstractTableModel Q_OBJECT public: - OperationalModel(QObject* parent = NULL); + OperationalModel(QObject* parent = nullptr); virtual ~OperationalModel(); @@ -61,4 +61,4 @@ public slots: }; -#endif // _OPERATIONALMODEL_H_ +#endif // OPERATIONALMODEL_H diff --git a/demos/rlCoachKin/Server.cpp b/demos/rlCoachKin/Server.cpp index 7f91ad7a..6b28dc9f 100644 --- a/demos/rlCoachKin/Server.cpp +++ b/demos/rlCoachKin/Server.cpp @@ -37,7 +37,11 @@ Server::~Server() } void +#if QT_VERSION >= 0x050000 +Server::incomingConnection(qintptr socketDescriptor) +#else // QT_VERSION Server::incomingConnection(int socketDescriptor) +#endif // QT_VERSION { Socket* socket = new Socket(this); socket->setSocketDescriptor(socketDescriptor); diff --git a/demos/rlCoachKin/Server.h b/demos/rlCoachKin/Server.h index 918e471c..d2bc1ffd 100644 --- a/demos/rlCoachKin/Server.h +++ b/demos/rlCoachKin/Server.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _SERVER_H_ -#define _SERVER_H_ +#ifndef SERVER_H +#define SERVER_H #include @@ -34,15 +34,19 @@ class Server : public QTcpServer Q_OBJECT public: - Server(QObject* parent = NULL); + Server(QObject* parent = nullptr); virtual ~Server(); protected: +#if QT_VERSION >= 0x050000 + void incomingConnection(qintptr socketDescriptor); +#else // QT_VERSION void incomingConnection(int socketDescriptor); +#endif // QT_VERSION private: }; -#endif //_SERVER_H_ +#endif //_SERVER_H diff --git a/demos/rlCoachKin/SoGradientBackground.cpp b/demos/rlCoachKin/SoGradientBackground.cpp new file mode 100644 index 00000000..bd1d852f --- /dev/null +++ b/demos/rlCoachKin/SoGradientBackground.cpp @@ -0,0 +1,109 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifdef WIN32 +#include +#endif // WIN32 + +#ifdef __APPLE__ +#include +#else // __APPLE__ +#include +#endif // __APPLE__ + +#include + +#include "SoGradientBackground.h" + +SO_NODE_SOURCE(SoGradientBackground); + +SoGradientBackground::SoGradientBackground() : + SoNode(), + color0(), + color1() +{ + SO_NODE_CONSTRUCTOR(SoGradientBackground); + + SO_NODE_ADD_FIELD(color0, (1.0f, 1.0f, 1.0f)); + SO_NODE_ADD_FIELD(color1, (0.0f, 0.0f, 0.0f)); +} + +SoGradientBackground::~SoGradientBackground() +{ +} + +SbBool +SoGradientBackground::affectsState() const +{ + return false; +} + +void +SoGradientBackground::exitClass() +{ +} + +void +SoGradientBackground::GLRender(SoGLRenderAction* action) +{ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glBegin(GL_QUADS); + + glColor3f(this->color0.getValue()[0], this->color0.getValue()[1], this->color0.getValue()[2]); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glColor3f(this->color1.getValue()[0], this->color1.getValue()[1], this->color1.getValue()[2]); + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + + glEnd(); + + glPopAttrib(); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void +SoGradientBackground::initClass() +{ + SO_NODE_INIT_CLASS(SoGradientBackground, SoNode, "Node"); +} diff --git a/demos/rlCoachKin/SoGradientBackground.h b/demos/rlCoachKin/SoGradientBackground.h new file mode 100644 index 00000000..5fc080f5 --- /dev/null +++ b/demos/rlCoachKin/SoGradientBackground.h @@ -0,0 +1,59 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOGRADIENTBACKGROUND_H +#define SOGRADIENTBACKGROUND_H + +#include +#include + +class SoGradientBackground : public SoNode +{ + SO_NODE_HEADER(SoGradientBackground); + +public: + SoGradientBackground(); + + virtual SbBool affectsState() const; + + static void exitClass(); + + virtual void GLRender(SoGLRenderAction* action); + + static void initClass(); + + SoSFColor color0; + + SoSFColor color1; + +protected: + virtual ~SoGradientBackground(); + +private: + +}; + +#endif // SOGRADIENTBACKGROUND_H diff --git a/demos/rlCoachKin/Socket.cpp b/demos/rlCoachKin/Socket.cpp index e58992ed..ec5fa2e4 100644 --- a/demos/rlCoachKin/Socket.cpp +++ b/demos/rlCoachKin/Socket.cpp @@ -49,38 +49,34 @@ Socket::readClient() { QTextStream textStream(this); - while (this->canReadLine()) + for (QString line = textStream.readLine(); QString() != line; line = textStream.readLine()) { - std::size_t cmd = 0; - textStream >> cmd; + QStringList list = line.split(" "); + + if (list.size() < 1) + { + continue; + } + + std::size_t cmd = list[0].toUInt(); switch (cmd) { case 0: { - std::size_t i = 0; - textStream >> i; - - std::size_t j = 0; - textStream >> j; - - rl::math::Real x = 0; - textStream >> x; - - rl::math::Real y = 0; - textStream >> y; - - rl::math::Real z = 0; - textStream >> z; - - rl::math::Real a = 0; - textStream >> a; - - rl::math::Real b = 0; - textStream >> b; + if (9 != list.size()) + { + continue; + } - rl::math::Real c = 0; - textStream >> c; + std::size_t i = list[1].toUInt(); + std::size_t j = list[2].toUInt(); + rl::math::Real x = list[3].toDouble(); + rl::math::Real y = list[4].toDouble(); + rl::math::Real z = list[5].toDouble(); + rl::math::Real a = list[6].toDouble(); + rl::math::Real b = list[7].toDouble(); + rl::math::Real c = list[8].toDouble(); rl::math::Transform t; t = rl::math::AngleAxis(c, rl::math::Vector3::UnitZ()) * @@ -101,32 +97,20 @@ Socket::readClient() break; case 1: { - std::size_t i = 0; - textStream >> i; - - std::size_t j = 0; - textStream >> j; - - std::size_t k = 0; - textStream >> k; - - rl::math::Real x = 0; - textStream >> x; - - rl::math::Real y = 0; - textStream >> y; - - rl::math::Real z = 0; - textStream >> z; - - rl::math::Real a = 0; - textStream >> a; - - rl::math::Real b = 0; - textStream >> b; + if (10 != list.size()) + { + continue; + } - rl::math::Real c = 0; - textStream >> c; + std::size_t i = list[1].toUInt(); + std::size_t j = list[2].toUInt(); + std::size_t k = list[3].toUInt(); + rl::math::Real x = list[4].toDouble(); + rl::math::Real y = list[5].toDouble(); + rl::math::Real z = list[6].toDouble(); + rl::math::Real a = list[7].toDouble(); + rl::math::Real b = list[8].toDouble(); + rl::math::Real c = list[9].toDouble(); rl::math::Transform t; t = rl::math::AngleAxis(c, rl::math::Vector3::UnitZ()) * @@ -150,8 +134,17 @@ Socket::readClient() break; case 2: { - std::size_t i = 0; - textStream >> i; + if (list.size() < 2) + { + continue; + } + + std::size_t i = list[1].toUInt(); + + if (2 + MainWindow::instance()->kinematicModels[i]->getDof() != list.size()) + { + continue; + } if (i < MainWindow::instance()->kinematicModels.size()) { @@ -160,17 +153,42 @@ Socket::readClient() for (std::ptrdiff_t j = 0; j < q.size(); ++j) { - textStream >> q(j); + q(j) = list[2 + j].toDouble(); } MainWindow::instance()->configurationModels[i]->setData(q); } } break; + case 6: + { + textStream << cmd; + + if (list.size() < 2) + { + textStream << endl; + continue; + } + + std::size_t i = list[1].toUInt(); + textStream << " " << i; + + if (i < MainWindow::instance()->kinematicModels.size()) + { + rl::math::Vector q(MainWindow::instance()->kinematicModels[i]->getDof()); + MainWindow::instance()->kinematicModels[i]->getPosition(q); + + for (std::size_t i = 0; i < q.size(); ++i) + { + textStream << " " << q(i); + } + } + + textStream << endl; + } + break; default: break; } - - textStream << endl; } } diff --git a/demos/rlCoachKin/Socket.h b/demos/rlCoachKin/Socket.h index 37e7ac8c..b37369c7 100644 --- a/demos/rlCoachKin/Socket.h +++ b/demos/rlCoachKin/Socket.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _SOCKET_H_ -#define _SOCKET_H_ +#ifndef SOCKET_H +#define SOCKET_H #include @@ -34,7 +34,7 @@ class Socket : public QTcpSocket Q_OBJECT public: - Socket(QObject* parent = NULL); + Socket(QObject* parent = nullptr); virtual ~Socket(); @@ -46,4 +46,4 @@ private slots: void readClient(); }; -#endif // _SOCKET_H_ +#endif // SOCKET_H diff --git a/demos/rlCoachKin/rlCoachKin.cpp b/demos/rlCoachKin/rlCoachKin.cpp index 03e3e89f..380ce0f2 100644 --- a/demos/rlCoachKin/rlCoachKin.cpp +++ b/demos/rlCoachKin/rlCoachKin.cpp @@ -30,7 +30,7 @@ #include "MainWindow.h" -MainWindow* MainWindow::singleton = NULL; +MainWindow* MainWindow::singleton = nullptr; int main(int argc, char** argv) @@ -38,7 +38,7 @@ main(int argc, char** argv) if (argc < 3) { std::cout << "Usage: rlCoachKin SCENEFILE KINEMATICSFILE1 ... KINEMATICSFILEn" << std::endl; - return 1; + return EXIT_FAILURE; } try @@ -54,6 +54,6 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return -1; + return EXIT_FAILURE; } } diff --git a/demos/rlCoachKin/rlCoachKin.desktop b/demos/rlCoachKin/rlCoachKin.desktop.in similarity index 57% rename from demos/rlCoachKin/rlCoachKin.desktop rename to demos/rlCoachKin/rlCoachKin.desktop.in index 7bd322da..864d5628 100644 --- a/demos/rlCoachKin/rlCoachKin.desktop +++ b/demos/rlCoachKin/rlCoachKin.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Categories=Science;Robotics; Comment=Visualization and kinematics demo with Unimation Puma 560 -Exec=sh -c "rlCoachKin $(dirname %k)/../rl/examples/rlsg/unimation-puma560_boxes.xml $(dirname %k)/../rl/examples/rlkin/unimation-puma560.xml" +Exec=sh -c "rlCoachKin $(dirname %k)/../rl-@VERSION@/examples/rlsg/unimation-puma560_boxes.xml $(dirname %k)/../rl-@VERSION@/examples/rlkin/unimation-puma560.xml" Icon=robotics-library Name=Robotics Library (rlCoachKin) Type=Application diff --git a/demos/rlCoachMdl/CMakeLists.txt b/demos/rlCoachMdl/CMakeLists.txt index 99f781b6..65b41f33 100644 --- a/demos/rlCoachMdl/CMakeLists.txt +++ b/demos/rlCoachMdl/CMakeLists.txt @@ -1,13 +1,24 @@ -project(rlCoachMdl) +find_package(OpenGL REQUIRED) +find_package(SoQt) -find_package(Boost REQUIRED) -find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL) -set(QT_USE_QTMAIN TRUE) -include(${QT_USE_FILE}) +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui Network OpenGL Widgets QUIET) +endif() -find_package(SoQt) +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(QT_FOUND AND SOQT_FOUND) +if(QT_FOUND AND SoQt_FOUND) set( HDRS ConfigurationDelegate.h @@ -17,6 +28,7 @@ if(QT_FOUND AND SOQT_FOUND) OperationalModel.h Server.h Socket.h + SoGradientBackground.h ) set( @@ -29,61 +41,54 @@ if(QT_FOUND AND SOQT_FOUND) rlCoachMdl.cpp Server.cpp Socket.cpp + SoGradientBackground.cpp ${rl_SOURCE_DIR}/robotics-library.rc ) - qt4_wrap_cpp( - MOC_SRCS - ConfigurationDelegate.h - ConfigurationModel.h - MainWindow.h - OperationalDelegate.h - OperationalModel.h - Server.h - Socket.h - OPTIONS - -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED - ) - add_executable( rlCoachMdl WIN32 ${HDRS} ${SRCS} - ${MOC_SRCS} ) target_compile_definitions( rlCoachMdl PUBLIC - ${QT_DEFINITIONS} - ${SOQT_DEFINITIONS} + ${SoQt_DEFINITIONS} ) target_include_directories( rlCoachMdl PUBLIC - ${Boost_INCLUDE_DIR} - ${QT_INCLUDES} - ${SOQT_INCLUDE_DIRS} + ${OPENGL_INCLUDE_DIR} + ${SoQt_INCLUDE_DIRS} ) target_link_libraries( rlCoachMdl - rlmath - rlmdl - rlsg + math + mdl + sg + ${OPENGL_LIBRARIES} ${QT_LIBRARIES} - ${SOQT_LIBRARIES} + ${SoQt_LIBRARIES} ) set_target_properties( rlCoachMdl PROPERTIES VERSION ${VERSION} - DEBUG_POSTFIX d ) + if(WIN32) + set_target_properties( + rlCoachMdl + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + install( TARGETS rlCoachMdl COMPONENT demos @@ -92,23 +97,42 @@ if(QT_FOUND AND SOQT_FOUND) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + if(UNIX) - install(FILES rlCoachMdl.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) - endif(UNIX) + configure_file(rlCoachMdl.desktop.in rlCoachMdl.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlCoachMdl.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} "CreateShortCut \\\\ \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlCoachMdl.lnk\\\" \\\\ \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlCoachMdl.exe\\\" \\\\ \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\" \\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlmdl\\\\unimation-puma560.xml\\\$\\\\\\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\" \\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlmdl\\\\unimation-puma560.xml\\\$\\\\\\\"\\\\ \\\" \\\\ \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ \\\"Visualization and kinematics demo with Unimation Puma 560\\\"" PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCoachMdl.lnk\\\"" PARENT_SCOPE) -endif(QT_FOUND AND SOQT_FOUND) + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCoachMdl.lnk\\\"" PARENT_SCOPE) + + set( + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" + PARENT_SCOPE + ) +endif() diff --git a/demos/rlCoachMdl/ConfigurationDelegate.cpp b/demos/rlCoachMdl/ConfigurationDelegate.cpp index 3303a965..2a6ba1e3 100644 --- a/demos/rlCoachMdl/ConfigurationDelegate.cpp +++ b/demos/rlCoachMdl/ConfigurationDelegate.cpp @@ -48,24 +48,23 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& { QDoubleSpinBox* editor = new QDoubleSpinBox(parent); - rl::math::Vector maximum(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getMaximum(maximum); - rl::math::Vector minimum(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getMinimum(minimum); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); + rl::math::Vector maximum = MainWindow::instance()->kinematicModels[this->id]->getMaximum(); + rl::math::Vector minimum = MainWindow::instance()->kinematicModels[this->id]->getMinimum(); + Eigen::Matrix qUnits = MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { + editor->setDecimals(2); editor->setMinimum(minimum(index.row()) * rl::math::RAD2DEG); editor->setMaximum(maximum(index.row()) * rl::math::RAD2DEG); editor->setSingleStep(1.0f); } else { + editor->setDecimals(4); editor->setMinimum(minimum(index.row())); editor->setMaximum(maximum(index.row())); - editor->setSingleStep(0.1f); + editor->setSingleStep(0.01f); } QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); @@ -76,19 +75,19 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& void ConfigurationDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } void ConfigurationDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); doubleSpinBox->interpretText(); if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) { - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } } @@ -101,5 +100,5 @@ ConfigurationDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionV void ConfigurationDelegate::valueChanged(double d) { - emit commitData(static_cast< QWidget* >(QObject::sender())); + emit commitData(static_cast(QObject::sender())); } diff --git a/demos/rlCoachMdl/ConfigurationDelegate.h b/demos/rlCoachMdl/ConfigurationDelegate.h index 31654638..8e1c1b07 100644 --- a/demos/rlCoachMdl/ConfigurationDelegate.h +++ b/demos/rlCoachMdl/ConfigurationDelegate.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONDELEGATE_H_ -#define _CONFIGURATIONDELEGATE_H_ +#ifndef CONFIGURATIONDELEGATE_H +#define CONFIGURATIONDELEGATE_H #include @@ -34,16 +34,16 @@ class ConfigurationDelegate : public QItemDelegate Q_OBJECT public: - ConfigurationDelegate(QObject* parent = NULL); + ConfigurationDelegate(QObject* parent = nullptr); virtual ~ConfigurationDelegate(); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - + void setEditorData(QWidget* editor, const QModelIndex& index) const; - + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; std::size_t id; @@ -57,4 +57,4 @@ public slots: }; -#endif // _CONFIGURATIONDELEGATE_H_ +#endif // CONFIGURATIONDELEGATE_H diff --git a/demos/rlCoachMdl/ConfigurationModel.cpp b/demos/rlCoachMdl/ConfigurationModel.cpp index 7207b4e9..2e32417b 100644 --- a/demos/rlCoachMdl/ConfigurationModel.cpp +++ b/demos/rlCoachMdl/ConfigurationModel.cpp @@ -51,7 +51,7 @@ ConfigurationModel::columnCount(const QModelIndex& parent) const QVariant ConfigurationModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -61,28 +61,45 @@ ConfigurationModel::data(const QModelIndex& index, int role) const return QVariant(); } + rl::math::Vector q = MainWindow::instance()->kinematicModels[this->id]->getPosition(); + rl::math::Vector maximum = MainWindow::instance()->kinematicModels[this->id]->getMaximum(); + rl::math::Vector minimum = MainWindow::instance()->kinematicModels[this->id]->getMinimum(); + Eigen::Matrix qUnits = MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(); + switch (role) { case Qt::DisplayRole: + switch (qUnits(index.row())) + { + case rl::math::UNIT_METER: + return QString::number(q(index.row()), 'f', 4) + QString(" m"); + break; + case rl::math::UNIT_RADIAN: + return QString::number(q(index.row()) * rl::math::RAD2DEG, 'f', 2) + QChar(176); + break; + default: + return q(index.row()); + break; + } + break; case Qt::EditRole: + if (rl::math::UNIT_RADIAN == qUnits(index.row())) { - rl::math::Vector q(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getPosition(q); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->kinematicModels[this->id]->getDof()); - MainWindow::instance()->kinematicModels[this->id]->getPositionUnits(qUnits); - - if (rl::math::UNIT_RADIAN == qUnits(index.row())) - { - return q(index.row()) * rl::math::RAD2DEG; - } - else - { - return q(index.row()); - } + return q(index.row()) * rl::math::RAD2DEG; + } + else + { + return q(index.row()); + } + break; + case Qt::ForegroundRole: + if (q(index.row()) < minimum(index.row()) || q(index.row()) > maximum(index.row())) + { + return QBrush(Qt::red); } break; case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -105,14 +122,14 @@ ConfigurationModel::flags(const QModelIndex &index) const QVariant ConfigurationModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } if (Qt::DisplayRole == role && Qt::Vertical == orientation) { - if (rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(MainWindow::instance()->kinematicModels[this->id].get())) + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels[this->id].get())) { for (std::size_t i = 0, j = 0; i < kinematic->getJoints(); ++i) { @@ -135,44 +152,43 @@ ConfigurationModel::headerData(int section, Qt::Orientation orientation, int rol void ConfigurationModel::operationalChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } int ConfigurationModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return 0; } - return MainWindow::instance()->kinematicModels[this->id]->getDof(); + return MainWindow::instance()->kinematicModels[this->id]->getDofPosition(); } bool ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } if (index.isValid() && Qt::EditRole == role) { - if (rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(MainWindow::instance()->kinematicModels[this->id].get())) + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels[this->id].get())) { - rl::math::Vector q(kinematic->getDof()); - kinematic->getPosition(q); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(kinematic->getDof()); - kinematic->getPositionUnits(qUnits); + rl::math::Vector q = kinematic->getPosition(); + Eigen::Matrix qUnits = kinematic->getPositionUnits(); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { - q(index.row()) = value.value< ::rl::math::Real >() * rl::math::DEG2RAD; + q(index.row()) = value.value() * rl::math::DEG2RAD; } else { - q(index.row()) = value.value< ::rl::math::Real >(); + q(index.row()) = value.value(); } kinematic->setPosition(q); @@ -195,12 +211,12 @@ ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int bool ConfigurationModel::setData(const rl::math::Vector& q) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } - if (rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(MainWindow::instance()->kinematicModels[this->id].get())) + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels[this->id].get())) { kinematic->setPosition(q); kinematic->forwardPosition(); diff --git a/demos/rlCoachMdl/ConfigurationModel.h b/demos/rlCoachMdl/ConfigurationModel.h index fc34f465..c29f068f 100644 --- a/demos/rlCoachMdl/ConfigurationModel.h +++ b/demos/rlCoachMdl/ConfigurationModel.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONMODEL_H_ -#define _CONFIGURATIONMODEL_H_ +#ifndef CONFIGURATIONMODEL_H +#define CONFIGURATIONMODEL_H #include #include @@ -35,7 +35,7 @@ class ConfigurationModel : public QAbstractTableModel Q_OBJECT public: - ConfigurationModel(QObject* parent = NULL); + ConfigurationModel(QObject* parent = nullptr); virtual ~ConfigurationModel(); @@ -64,4 +64,4 @@ public slots: }; -#endif // _CONFIGURATIONMODEL_H_ +#endif // CONFIGURATIONMODEL_H diff --git a/demos/rlCoachMdl/MainWindow.cpp b/demos/rlCoachMdl/MainWindow.cpp index 197fe14f..c9bae168 100644 --- a/demos/rlCoachMdl/MainWindow.cpp +++ b/demos/rlCoachMdl/MainWindow.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,30 +39,41 @@ #include "OperationalDelegate.h" #include "OperationalModel.h" #include "Server.h" +#include "SoGradientBackground.h" -MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : +MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags f) : QMainWindow(parent, f), configurationModels(), + geometryModels(), + ikAlgorithmComboBox(new QComboBox(this)), + ikDurationSpinBox(new QSpinBox(this)), + ikJacobianComboBox(new QComboBox(this)), + ikJacobianInverseComboBox(new QComboBox(this)), + kinematicModels(), + operationalModels(), scene(), configurationDelegates(), configurationDockWidget(new QDockWidget(this)), configurationTabWidget(new QTabWidget(this)), configurationViews(), + gradientBackground(), operationalDelegates(), operationalDockWidget(new QDockWidget(this)), operationalTabWidget(new QTabWidget(this)), operationalViews(), - saveImageAction(new QAction(this)), + saveImageWithAlphaAction(new QAction(this)), + saveImageWithoutAlphaAction(new QAction(this)), saveSceneAction(new QAction(this)), server(new Server(this)), - viewer(NULL) + viewer(nullptr) { MainWindow::singleton = this; SoQt::init(this); SoDB::init(); + SoGradientBackground::initClass(); - this->scene = boost::make_shared< rl::sg::so::Scene >(); + this->scene = std::make_shared(); this->scene->load(QApplication::arguments()[1].toStdString()); rl::mdl::XmlFactory factory; @@ -70,7 +81,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : for (int i = 2; i < QApplication::arguments().size(); ++i) { this->geometryModels.push_back(this->scene->getModel(i - 2)); - boost::shared_ptr< rl::mdl::Model > kinematicModel; + std::shared_ptr kinematicModel; kinematicModel.reset(factory.create(QApplication::arguments()[i].toStdString())); this->kinematicModels.push_back(kinematicModel); } @@ -86,12 +97,15 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->configurationModels.push_back(configurationModel); QTableView* configurationView = new QTableView(this); +#if QT_VERSION >= 0x050000 + configurationView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION configurationView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION configurationView->horizontalHeader()->hide(); configurationView->setAlternatingRowColors(true); configurationView->setItemDelegate(configurationDelegate); configurationView->setModel(configurationModel); - configurationView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); this->configurationViews.push_back(configurationView); this->configurationTabWidget->addTab(configurationView, QString::number(i)); @@ -104,11 +118,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->operationalModels.push_back(operationalModel); QTableView* operationalView = new QTableView(this); +#if QT_VERSION >= 0x050000 + operationalView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION operationalView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION operationalView->setAlternatingRowColors(true); operationalView->setItemDelegate(operationalDelegate); operationalView->setModel(operationalModel); - operationalView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); this->operationalViews.push_back(operationalView); this->operationalTabWidget->addTab(operationalView, QString::number(i)); @@ -127,22 +144,63 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : SLOT(operationalChanged(const QModelIndex&, const QModelIndex&)) ); - rl::math::Vector q(this->kinematicModels[i]->getDof()); - q.setZero(); - configurationModel->setData(q); + configurationModel->setData(this->kinematicModels[i]->getHomePosition()); } - this->addDockWidget(Qt::LeftDockWidgetArea, configurationDockWidget); this->configurationDockWidget->resize(160, 320); this->configurationDockWidget->setWidget(this->configurationTabWidget); this->configurationDockWidget->setWindowTitle("Configuration"); - this->addDockWidget(Qt::LeftDockWidgetArea, operationalDockWidget); this->operationalDockWidget->resize(160, 320); this->operationalDockWidget->setWidget(this->operationalTabWidget); this->operationalDockWidget->setWindowTitle("Operational"); - this->viewer = new SoQtExaminerViewer(this, NULL, true, SoQtFullViewer::BUILD_POPUP); + this->addDockWidget(Qt::LeftDockWidgetArea, this->configurationDockWidget); + this->addDockWidget(Qt::BottomDockWidgetArea, this->operationalDockWidget); + + this->ikAlgorithmComboBox->addItem("JacobianInverseKinematics"); +#ifdef RL_MDL_NLOPT + this->ikAlgorithmComboBox->addItem("NloptInverseKinematics"); +#endif + this->ikAlgorithmComboBox->setToolTip("IK Algorithm"); + +#ifdef RL_MDL_NLOPT + this->ikAlgorithmComboBox->setCurrentIndex(this->ikAlgorithmComboBox->findText("NloptInverseKinematics")); +#endif + + QObject::connect(this->ikAlgorithmComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeIkAlgorithm())); + + this->ikDurationSpinBox->setMaximum(10000); + this->ikDurationSpinBox->setMinimum(1); + this->ikDurationSpinBox->setSuffix(" ms"); + this->ikDurationSpinBox->setToolTip("Max. IK Duration"); + this->ikDurationSpinBox->setValue(500); + + this->ikJacobianComboBox->addItem("Inverse"); + this->ikJacobianComboBox->addItem("Transpose"); + this->ikJacobianComboBox->setToolTip("Jacobian Method"); + + QObject::connect(this->ikJacobianComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeIkJacobian())); + + this->ikJacobianInverseComboBox->addItem("SVD"); + this->ikJacobianInverseComboBox->addItem("DLS"); + this->ikJacobianInverseComboBox->setToolTip("Jacobian Inverse Method"); + + this->statusBar()->addPermanentWidget(this->ikAlgorithmComboBox); + this->statusBar()->addPermanentWidget(this->ikJacobianComboBox); + this->statusBar()->addPermanentWidget(this->ikJacobianInverseComboBox); + this->statusBar()->addPermanentWidget(this->ikDurationSpinBox); + + this->changeIkAlgorithm(); + this->changeIkJacobian(); + + this->gradientBackground = new SoGradientBackground(); + this->gradientBackground->ref(); + this->gradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); + this->scene->root->insertChild(this->gradientBackground, 0); + + this->viewer = new SoQtExaminerViewer(this, nullptr, true, SoQtFullViewer::BUILD_POPUP); this->viewer->setSceneGraph(this->scene->root); this->viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); this->viewer->viewAll(); @@ -159,13 +217,56 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : MainWindow::~MainWindow() { - MainWindow::singleton = NULL; + this->gradientBackground->unref(); + MainWindow::singleton = nullptr; +} + +void +MainWindow::changeIkAlgorithm() +{ + if ("JacobianInverseKinematics" == this->ikAlgorithmComboBox->currentText()) + { + this->ikDurationSpinBox->setVisible(true); + + if ("Inverse" != this->ikJacobianComboBox->currentText()) + { + this->ikJacobianInverseComboBox->setVisible(false); + } + else + { + this->ikJacobianInverseComboBox->setVisible(true); + } + + this->ikJacobianComboBox->setVisible(true); + } + else if ("NloptInverseKinematics" == this->ikAlgorithmComboBox->currentText()) + { + this->ikDurationSpinBox->setVisible(true); + this->ikJacobianInverseComboBox->setVisible(false); + this->ikJacobianComboBox->setVisible(false); + } +} + +void +MainWindow::changeIkJacobian() +{ + if ("JacobianInverseKinematics" == this->ikAlgorithmComboBox->currentText()) + { + if ("Inverse" != this->ikJacobianComboBox->currentText()) + { + this->ikJacobianInverseComboBox->setVisible(false); + } + else + { + this->ikJacobianInverseComboBox->setVisible(true); + } + } } MainWindow* MainWindow::instance() { - if (NULL == MainWindow::singleton) + if (nullptr == MainWindow::singleton) { new MainWindow(); } @@ -179,9 +280,13 @@ MainWindow::init() this->configurationDockWidget->toggleViewAction()->setShortcut(QKeySequence("F5")); this->addAction(this->configurationDockWidget->toggleViewAction()); - this->saveImageAction->setShortcut(QKeySequence("Return")); - QObject::connect(this->saveImageAction, SIGNAL(triggered()), this, SLOT(saveImage())); - this->addAction(this->saveImageAction); + this->saveImageWithoutAlphaAction->setShortcut(QKeySequence("Return")); + QObject::connect(this->saveImageWithoutAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithoutAlpha())); + this->addAction(this->saveImageWithoutAlphaAction); + + this->saveImageWithAlphaAction->setShortcut(QKeySequence("Shift+Return")); + QObject::connect(this->saveImageWithAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithAlpha())); + this->addAction(this->saveImageWithAlphaAction); this->saveSceneAction->setShortcut(QKeySequence("Ctrl+Return")); QObject::connect(this->saveSceneAction, SIGNAL(triggered()), this, SLOT(saveScene())); @@ -189,10 +294,36 @@ MainWindow::init() } void -MainWindow::saveImage() +MainWindow::saveImage(bool withAlpha) +{ + if (withAlpha) + { + this->scene->root->removeChild(this->gradientBackground); + this->viewer->render(); + } + + glReadBuffer(GL_FRONT); + QImage image = static_cast(this->viewer->getGLWidget())->grabFrameBuffer(withAlpha); + + if (withAlpha) + { + this->scene->root->insertChild(this->gradientBackground, 0); + this->viewer->render(); + } + + image.save("rlCoachMdl-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png", "PNG"); +} + +void +MainWindow::saveImageWithAlpha() +{ + this->saveImage(true); +} + +void +MainWindow::saveImageWithoutAlpha() { - QImage image = static_cast< QGLWidget* >(this->viewer->getGLWidget())->grabFrameBuffer(true); - image.save("coach-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png", "PNG"); + this->saveImage(false); } void diff --git a/demos/rlCoachMdl/MainWindow.h b/demos/rlCoachMdl/MainWindow.h index b94e1b0c..797285c0 100644 --- a/demos/rlCoachMdl/MainWindow.h +++ b/demos/rlCoachMdl/MainWindow.h @@ -24,16 +24,18 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _MAINWINDOW_H_ -#define _MAINWINDOW_H_ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H +#include #include #include +#include #include +#include #include #include #include -#include #include #include #include @@ -44,6 +46,7 @@ class ConfigurationModel; class OperationalDelegate; class OperationalModel; class Server; +class SoGradientBackground; class MainWindow : public QMainWindow { @@ -54,44 +57,64 @@ class MainWindow : public QMainWindow static MainWindow* instance(); - std::vector< ConfigurationModel* > configurationModels; + std::vector configurationModels; - std::vector< rl::sg::Model* > geometryModels; + std::vector geometryModels; - std::vector< boost::shared_ptr< rl::mdl::Model > > kinematicModels; + QComboBox* ikAlgorithmComboBox; - std::vector< OperationalModel* > operationalModels; + QSpinBox* ikDurationSpinBox; - boost::shared_ptr< rl::sg::so::Scene > scene; + QComboBox* ikJacobianComboBox; + + QComboBox* ikJacobianInverseComboBox; + + std::vector> kinematicModels; + + std::vector operationalModels; + + std::shared_ptr scene; public slots: - void saveImage(); + void changeIkAlgorithm(); + + void changeIkJacobian(); + + void saveImageWithAlpha(); + + void saveImageWithoutAlpha(); void saveScene(); protected: - MainWindow(QWidget* parent = NULL, Qt::WindowFlags f = 0); + MainWindow(QWidget* parent = nullptr, Qt::WindowFlags f = 0); private: void init(); - std::vector< ConfigurationDelegate* > configurationDelegates; + void saveImage(bool withAlpha); + + std::vector configurationDelegates; QDockWidget* configurationDockWidget; QTabWidget* configurationTabWidget; - std::vector< QTableView* > configurationViews; + std::vector configurationViews; - std::vector< OperationalDelegate* > operationalDelegates; + SoGradientBackground* gradientBackground; + + std::vector operationalDelegates; QDockWidget* operationalDockWidget; QTabWidget* operationalTabWidget; - std::vector< QTableView* > operationalViews; + std::vector operationalViews; + + QAction* saveImageWithAlphaAction; - QAction* saveImageAction; + QAction* saveImageWithoutAlphaAction; QAction* saveSceneAction; @@ -102,4 +125,4 @@ public slots: SoQtExaminerViewer* viewer; }; -#endif // _MAINWINDOW_H_ +#endif // MAINWINDOW_H diff --git a/demos/rlCoachMdl/OperationalDelegate.cpp b/demos/rlCoachMdl/OperationalDelegate.cpp index c8636535..a71f3f12 100644 --- a/demos/rlCoachMdl/OperationalDelegate.cpp +++ b/demos/rlCoachMdl/OperationalDelegate.cpp @@ -44,19 +44,21 @@ OperationalDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& o { QDoubleSpinBox* editor = new QDoubleSpinBox(parent); - editor->setMaximum(std::numeric_limits< double >::max()); - editor->setMinimum(-std::numeric_limits< double >::max()); + editor->setMaximum(std::numeric_limits::max()); + editor->setMinimum(-std::numeric_limits::max()); switch (index.column()) { case 0: case 1: case 2: + editor->setDecimals(4); editor->setSingleStep(0.01f); break; case 3: case 4: case 5: + editor->setDecimals(2); editor->setSingleStep(1.0f); break; default: @@ -71,19 +73,19 @@ OperationalDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& o void OperationalDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } void OperationalDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); doubleSpinBox->interpretText(); if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) { - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } } @@ -96,5 +98,5 @@ OperationalDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionVie void OperationalDelegate::valueChanged(double d) { - emit commitData(static_cast< QWidget* >(QObject::sender())); + emit commitData(static_cast(QObject::sender())); } diff --git a/demos/rlCoachMdl/OperationalDelegate.h b/demos/rlCoachMdl/OperationalDelegate.h index 1b74453c..2e1f4108 100644 --- a/demos/rlCoachMdl/OperationalDelegate.h +++ b/demos/rlCoachMdl/OperationalDelegate.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _OPERATIONALDELEGATE_H_ -#define _OPERATIONALDELEGATE_H_ +#ifndef OPERATIONALDELEGATE_H +#define OPERATIONALDELEGATE_H #include @@ -34,16 +34,16 @@ class OperationalDelegate : public QItemDelegate Q_OBJECT public: - OperationalDelegate(QObject* parent = NULL); + OperationalDelegate(QObject* parent = nullptr); virtual ~OperationalDelegate(); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - + void setEditorData(QWidget* editor, const QModelIndex& index) const; - + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; public slots: @@ -55,4 +55,4 @@ public slots: }; -#endif // _OPERATIONALDELEGATE_H_ +#endif // OPERATIONALDELEGATE_H diff --git a/demos/rlCoachMdl/OperationalModel.cpp b/demos/rlCoachMdl/OperationalModel.cpp index 26bf38ac..4619f368 100644 --- a/demos/rlCoachMdl/OperationalModel.cpp +++ b/demos/rlCoachMdl/OperationalModel.cpp @@ -24,11 +24,18 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include #include #include +#include #include +#include #include +#ifdef RL_MDL_NLOPT +#include +#endif + #include "ConfigurationModel.h" #include "OperationalModel.h" #include "MainWindow.h" @@ -52,13 +59,14 @@ OperationalModel::columnCount(const QModelIndex& parent) const void OperationalModel::configurationChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } QVariant OperationalModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -68,41 +76,48 @@ OperationalModel::data(const QModelIndex& index, int role) const return QVariant(); } + const rl::math::Transform& transform = MainWindow::instance()->kinematicModels[this->id]->getOperationalPosition(index.row()); + rl::math::Transform::ConstTranslationPart position = transform.translation(); + rl::math::Vector3 orientation = transform.rotation().eulerAngles(2, 1, 0).reverse(); + switch (role) { case Qt::DisplayRole: + switch (index.column()) + { + case 0: + case 1: + case 2: + return QString::number(position(index.column()), 'f', 4) + QString(" m"); + break; + case 3: + case 4: + case 5: + return QString::number(orientation(index.column() - 3) * rl::math::RAD2DEG, 'f', 2) + QChar(176); + break; + default: + break; + } + break; case Qt::EditRole: + switch (index.column()) { - const rl::math::Transform::ConstTranslationPart& position = MainWindow::instance()->kinematicModels[this->id]->getOperationalPosition(index.row()).translation(); - rl::math::Vector3 orientation = MainWindow::instance()->kinematicModels[this->id]->getOperationalPosition(index.row()).rotation().eulerAngles(2, 1, 0).reverse(); - - switch (index.column()) - { - case 0: - return position.x(); - break; - case 1: - return position.y(); - break; - case 2: - return position.z(); - break; - case 3: - return orientation.x() * rl::math::RAD2DEG; - break; - case 4: - return orientation.y() * rl::math::RAD2DEG; - break; - case 5: - return orientation.z() * rl::math::RAD2DEG; - break; - default: - break; - } + case 0: + case 1: + case 2: + return position(index.column()); + break; + case 3: + case 4: + case 5: + return orientation(index.column() - 3) * rl::math::RAD2DEG; + break; + default: + break; } break; case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -125,7 +140,7 @@ OperationalModel::flags(const QModelIndex &index) const QVariant OperationalModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return QVariant(); } @@ -168,7 +183,7 @@ OperationalModel::headerData(int section, Qt::Orientation orientation, int role) int OperationalModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return 0; } @@ -179,48 +194,42 @@ OperationalModel::rowCount(const QModelIndex& parent) const bool OperationalModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->kinematicModels[this->id]) + if (nullptr == MainWindow::instance()->kinematicModels[this->id]) { return false; } if (index.isValid() && Qt::EditRole == role) { - if (rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(MainWindow::instance()->kinematicModels[this->id].get())) + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels[this->id].get())) { - rl::math::Transform x = kinematic->getOperationalPosition(index.row()); - - rl::math::Transform::TranslationPart position = x.translation(); - rl::math::Vector3 orientation = x.linear().eulerAngles(2, 1, 0).reverse(); + rl::math::Transform transform = kinematic->getOperationalPosition(index.row()); + rl::math::Vector3 orientation = transform.linear().eulerAngles(2, 1, 0).reverse(); switch (index.column()) { case 0: - x.translation().x() = value.value< rl::math::Real >(); - break; case 1: - x.translation().y() = value.value< rl::math::Real >(); - break; case 2: - x.translation().z() = value.value< rl::math::Real >(); + transform.translation()(index.column()) = value.value(); break; case 3: - x.linear() = ( + transform.linear() = ( rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) ).toRotationMatrix(); break; case 4: - x.linear() = ( + transform.linear() = ( rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) ).toRotationMatrix(); break; case 5: - x.linear() = ( - rl::math::AngleAxis(value.value< rl::math::Real >() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + transform.linear() = ( + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) ).toRotationMatrix(); @@ -229,11 +238,44 @@ OperationalModel::setData(const QModelIndex& index, const QVariant& value, int r break; } - rl::math::Vector q(kinematic->getDof()); - kinematic->getPosition(q); + rl::math::Vector q = kinematic->getPosition(); + + std::shared_ptr ik; + + if ("JacobianInverseKinematics" == MainWindow::instance()->ikAlgorithmComboBox->currentText()) + { + ik = std::make_shared(kinematic); + rl::mdl::JacobianInverseKinematics* jacobianIk = static_cast(ik.get()); + jacobianIk->duration = std::chrono::milliseconds(MainWindow::instance()->ikDurationSpinBox->cleanText().toUInt()); + jacobianIk->svd = "SVD" == MainWindow::instance()->ikJacobianInverseComboBox->currentText() ? true : false; + jacobianIk->transpose = "Transpose" == MainWindow::instance()->ikJacobianComboBox->currentText() ? true : false; + } +#ifdef RL_MDL_NLOPT + else if ("NloptInverseKinematics" == MainWindow::instance()->ikAlgorithmComboBox->currentText()) + { + ik = std::make_shared(kinematic); + rl::mdl::NloptInverseKinematics* nloptIk = static_cast(ik.get()); + nloptIk->duration = std::chrono::milliseconds(MainWindow::instance()->ikDurationSpinBox->cleanText().toUInt()); + } +#endif + +#if 0 + ik->goals.push_back(::std::make_pair(transform, index.row())); +#else + for (std::size_t i = 0; i < kinematic->getOperationalDof(); ++i) + { + ik->goals.push_back(::std::make_pair(i == index.row() ? transform : kinematic->getOperationalPosition(i), i)); + } +#endif - if (kinematic->calculateInversePosition(x, index.row(), 1.0f)) + std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); + bool solved = ik->solve(); + std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now(); + + if (solved) { + MainWindow::instance()->statusBar()->showMessage("IK solved in " + QString::number(std::chrono::duration(stop - start).count() * rl::math::UNIT2MILLI) + " ms", 2000); + kinematic->forwardPosition(); for (std::size_t i = 0; i < MainWindow::instance()->geometryModels[this->id]->getNumBodies(); ++i) @@ -247,6 +289,8 @@ OperationalModel::setData(const QModelIndex& index, const QVariant& value, int r } else { + MainWindow::instance()->statusBar()->showMessage("IK failed", 2000); + kinematic->setPosition(q); kinematic->forwardPosition(); } diff --git a/demos/rlCoachMdl/OperationalModel.h b/demos/rlCoachMdl/OperationalModel.h index b443f324..2f4bfb0c 100644 --- a/demos/rlCoachMdl/OperationalModel.h +++ b/demos/rlCoachMdl/OperationalModel.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _OPERATIONALMODEL_H_ -#define _OPERATIONALMODEL_H_ +#ifndef OPERATIONALMODEL_H +#define OPERATIONALMODEL_H #include @@ -34,7 +34,7 @@ class OperationalModel : public QAbstractTableModel Q_OBJECT public: - OperationalModel(QObject* parent = NULL); + OperationalModel(QObject* parent = nullptr); virtual ~OperationalModel(); @@ -61,4 +61,4 @@ public slots: }; -#endif // _OPERATIONALMODEL_H_ +#endif // OPERATIONALMODEL_H diff --git a/demos/rlCoachMdl/Server.cpp b/demos/rlCoachMdl/Server.cpp index 7f91ad7a..6b28dc9f 100644 --- a/demos/rlCoachMdl/Server.cpp +++ b/demos/rlCoachMdl/Server.cpp @@ -37,7 +37,11 @@ Server::~Server() } void +#if QT_VERSION >= 0x050000 +Server::incomingConnection(qintptr socketDescriptor) +#else // QT_VERSION Server::incomingConnection(int socketDescriptor) +#endif // QT_VERSION { Socket* socket = new Socket(this); socket->setSocketDescriptor(socketDescriptor); diff --git a/demos/rlCoachMdl/Server.h b/demos/rlCoachMdl/Server.h index 918e471c..d2bc1ffd 100644 --- a/demos/rlCoachMdl/Server.h +++ b/demos/rlCoachMdl/Server.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _SERVER_H_ -#define _SERVER_H_ +#ifndef SERVER_H +#define SERVER_H #include @@ -34,15 +34,19 @@ class Server : public QTcpServer Q_OBJECT public: - Server(QObject* parent = NULL); + Server(QObject* parent = nullptr); virtual ~Server(); protected: +#if QT_VERSION >= 0x050000 + void incomingConnection(qintptr socketDescriptor); +#else // QT_VERSION void incomingConnection(int socketDescriptor); +#endif // QT_VERSION private: }; -#endif //_SERVER_H_ +#endif //_SERVER_H diff --git a/demos/rlCoachMdl/SoGradientBackground.cpp b/demos/rlCoachMdl/SoGradientBackground.cpp new file mode 100644 index 00000000..bd1d852f --- /dev/null +++ b/demos/rlCoachMdl/SoGradientBackground.cpp @@ -0,0 +1,109 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifdef WIN32 +#include +#endif // WIN32 + +#ifdef __APPLE__ +#include +#else // __APPLE__ +#include +#endif // __APPLE__ + +#include + +#include "SoGradientBackground.h" + +SO_NODE_SOURCE(SoGradientBackground); + +SoGradientBackground::SoGradientBackground() : + SoNode(), + color0(), + color1() +{ + SO_NODE_CONSTRUCTOR(SoGradientBackground); + + SO_NODE_ADD_FIELD(color0, (1.0f, 1.0f, 1.0f)); + SO_NODE_ADD_FIELD(color1, (0.0f, 0.0f, 0.0f)); +} + +SoGradientBackground::~SoGradientBackground() +{ +} + +SbBool +SoGradientBackground::affectsState() const +{ + return false; +} + +void +SoGradientBackground::exitClass() +{ +} + +void +SoGradientBackground::GLRender(SoGLRenderAction* action) +{ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glBegin(GL_QUADS); + + glColor3f(this->color0.getValue()[0], this->color0.getValue()[1], this->color0.getValue()[2]); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glColor3f(this->color1.getValue()[0], this->color1.getValue()[1], this->color1.getValue()[2]); + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + + glEnd(); + + glPopAttrib(); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void +SoGradientBackground::initClass() +{ + SO_NODE_INIT_CLASS(SoGradientBackground, SoNode, "Node"); +} diff --git a/demos/rlCoachMdl/SoGradientBackground.h b/demos/rlCoachMdl/SoGradientBackground.h new file mode 100644 index 00000000..5fc080f5 --- /dev/null +++ b/demos/rlCoachMdl/SoGradientBackground.h @@ -0,0 +1,59 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOGRADIENTBACKGROUND_H +#define SOGRADIENTBACKGROUND_H + +#include +#include + +class SoGradientBackground : public SoNode +{ + SO_NODE_HEADER(SoGradientBackground); + +public: + SoGradientBackground(); + + virtual SbBool affectsState() const; + + static void exitClass(); + + virtual void GLRender(SoGLRenderAction* action); + + static void initClass(); + + SoSFColor color0; + + SoSFColor color1; + +protected: + virtual ~SoGradientBackground(); + +private: + +}; + +#endif // SOGRADIENTBACKGROUND_H diff --git a/demos/rlCoachMdl/Socket.cpp b/demos/rlCoachMdl/Socket.cpp index 58259124..29fcdb7b 100644 --- a/demos/rlCoachMdl/Socket.cpp +++ b/demos/rlCoachMdl/Socket.cpp @@ -24,6 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include +#include #include #include #include @@ -47,45 +49,43 @@ Socket::~Socket() void Socket::readClient() { + MainWindow::instance()->statusBar()->showMessage("Received data from " + this->peerAddress().toString() + ":" + QString::number(this->peerPort()), 1000); + QTextStream textStream(this); - while (this->canReadLine()) + for (QString line = textStream.readLine(); QString() != line; line = textStream.readLine()) { - std::size_t cmd = 0; - textStream >> cmd; + QStringList list = line.split(" "); + + if (list.size() < 1) + { + continue; + } + + std::size_t cmd = list[0].toUInt(); switch (cmd) { case 0: { - std::size_t i = 0; - textStream >> i; - - std::size_t j = 0; - textStream >> j; - - rl::math::Real x = 0; - textStream >> x; - - rl::math::Real y = 0; - textStream >> y; - - rl::math::Real z = 0; - textStream >> z; - - rl::math::Real a = 0; - textStream >> a; - - rl::math::Real b = 0; - textStream >> b; + if (9 != list.size()) + { + continue; + } - rl::math::Real c = 0; - textStream >> c; + std::size_t i = list[1].toUInt(); + std::size_t j = list[2].toUInt(); + rl::math::Real x = list[3].toDouble(); + rl::math::Real y = list[4].toDouble(); + rl::math::Real z = list[5].toDouble(); + rl::math::Real a = list[6].toDouble(); + rl::math::Real b = list[7].toDouble(); + rl::math::Real c = list[8].toDouble(); rl::math::Transform t; - t = rl::math::AngleAxis(a, rl::math::Vector3::UnitZ()) * + t = rl::math::AngleAxis(c, rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(b, rl::math::Vector3::UnitY()) * - rl::math::AngleAxis(c, rl::math::Vector3::UnitX()); + rl::math::AngleAxis(a, rl::math::Vector3::UnitX()); t.translation().x() = x; t.translation().y() = y; t.translation().z() = z; @@ -101,37 +101,25 @@ Socket::readClient() break; case 1: { - std::size_t i = 0; - textStream >> i; - - std::size_t j = 0; - textStream >> j; - - std::size_t k = 0; - textStream >> k; - - rl::math::Real x = 0; - textStream >> x; - - rl::math::Real y = 0; - textStream >> y; - - rl::math::Real z = 0; - textStream >> z; - - rl::math::Real a = 0; - textStream >> a; - - rl::math::Real b = 0; - textStream >> b; + if (10 != list.size()) + { + continue; + } - rl::math::Real c = 0; - textStream >> c; + std::size_t i = list[1].toUInt(); + std::size_t j = list[2].toUInt(); + std::size_t k = list[3].toUInt(); + rl::math::Real x = list[4].toDouble(); + rl::math::Real y = list[5].toDouble(); + rl::math::Real z = list[6].toDouble(); + rl::math::Real a = list[7].toDouble(); + rl::math::Real b = list[8].toDouble(); + rl::math::Real c = list[9].toDouble(); rl::math::Transform t; - t = rl::math::AngleAxis(a, rl::math::Vector3::UnitZ()) * + t = rl::math::AngleAxis(c, rl::math::Vector3::UnitZ()) * rl::math::AngleAxis(b, rl::math::Vector3::UnitY()) * - rl::math::AngleAxis(c, rl::math::Vector3::UnitX()); + rl::math::AngleAxis(a, rl::math::Vector3::UnitX()); t.translation().x() = x; t.translation().y() = y; t.translation().z() = z; @@ -150,27 +138,60 @@ Socket::readClient() break; case 2: { - std::size_t i = 0; - textStream >> i; + if (list.size() < 2) + { + continue; + } + + std::size_t i = list[1].toUInt(); + + if (2 + MainWindow::instance()->kinematicModels[i]->getDofPosition() != list.size()) + { + continue; + } if (i < MainWindow::instance()->kinematicModels.size()) { - rl::math::Vector q(MainWindow::instance()->kinematicModels[i]->getDof()); + rl::math::Vector q(MainWindow::instance()->kinematicModels[i]->getDofPosition()); q.setZero(); for (std::ptrdiff_t j = 0; j < q.size(); ++j) { - textStream >> q(j); + q(j) = list[2 + j].toDouble(); } MainWindow::instance()->configurationModels[i]->setData(q); } } break; + case 6: + { + textStream << cmd; + + if (list.size() < 2) + { + textStream << endl; + continue; + } + + std::size_t i = list[1].toUInt(); + textStream << " " << i; + + if (i < MainWindow::instance()->kinematicModels.size()) + { + rl::math::Vector q = MainWindow::instance()->kinematicModels[i]->getPosition(); + + for (std::size_t i = 0; i < q.size(); ++i) + { + textStream << " " << q(i); + } + } + + textStream << endl; + } + break; default: break; } - - textStream << endl; } } diff --git a/demos/rlCoachMdl/Socket.h b/demos/rlCoachMdl/Socket.h index 37e7ac8c..b37369c7 100644 --- a/demos/rlCoachMdl/Socket.h +++ b/demos/rlCoachMdl/Socket.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _SOCKET_H_ -#define _SOCKET_H_ +#ifndef SOCKET_H +#define SOCKET_H #include @@ -34,7 +34,7 @@ class Socket : public QTcpSocket Q_OBJECT public: - Socket(QObject* parent = NULL); + Socket(QObject* parent = nullptr); virtual ~Socket(); @@ -46,4 +46,4 @@ private slots: void readClient(); }; -#endif // _SOCKET_H_ +#endif // SOCKET_H diff --git a/demos/rlCoachMdl/rlCoachMdl.cpp b/demos/rlCoachMdl/rlCoachMdl.cpp index 5b0db1bf..34dd0519 100644 --- a/demos/rlCoachMdl/rlCoachMdl.cpp +++ b/demos/rlCoachMdl/rlCoachMdl.cpp @@ -30,7 +30,7 @@ #include "MainWindow.h" -MainWindow* MainWindow::singleton = NULL; +MainWindow* MainWindow::singleton = nullptr; int main(int argc, char** argv) @@ -38,12 +38,17 @@ main(int argc, char** argv) if (argc < 3) { std::cout << "Usage: rlCoachMdl SCENEFILE MODELFILE1 ... MODELFILEn" << std::endl; - return 1; + return EXIT_FAILURE; } try { QApplication application(argc, argv); + application.setStyleSheet("\ + QStatusBar QComboBox { background: transparent; border: none; }\ + QStatusBar QComboBox::drop-down { border: none; }\ + QStatusBar QSpinBox { background: transparent; border: none; }\ + "); QObject::connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit())); @@ -54,6 +59,6 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return -1; + return EXIT_FAILURE; } } diff --git a/demos/rlCoachMdl/rlCoachMdl.desktop b/demos/rlCoachMdl/rlCoachMdl.desktop.in similarity index 57% rename from demos/rlCoachMdl/rlCoachMdl.desktop rename to demos/rlCoachMdl/rlCoachMdl.desktop.in index b754f8f5..1c3ee0a7 100644 --- a/demos/rlCoachMdl/rlCoachMdl.desktop +++ b/demos/rlCoachMdl/rlCoachMdl.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Categories=Science;Robotics; Comment=Visualization and kinematics demo with Unimation Puma 560 -Exec=sh -c "rlCoachMdl $(dirname %k)/../rl/examples/rlsg/unimation-puma560_boxes.xml $(dirname %k)/../rl/examples/rlmdl/unimation-puma560.xml" +Exec=sh -c "rlCoachMdl $(dirname %k)/../rl-@VERSION@/examples/rlsg/unimation-puma560_boxes.xml $(dirname %k)/../rl-@VERSION@/examples/rlmdl/unimation-puma560.xml" Icon=robotics-library Name=Robotics Library (rlCoachMdl) Type=Application diff --git a/demos/rlCollisionDemo/BodyDelegate.cpp b/demos/rlCollisionDemo/BodyDelegate.cpp new file mode 100644 index 00000000..c9860dfa --- /dev/null +++ b/demos/rlCollisionDemo/BodyDelegate.cpp @@ -0,0 +1,103 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include + +#include "BodyDelegate.h" +#include "MainWindow.h" + +BodyDelegate::BodyDelegate(QObject* parent) : + QItemDelegate(parent) +{ +} + +BodyDelegate::~BodyDelegate() +{ +} + +QWidget* +BodyDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + editor->setMaximum(std::numeric_limits::max()); + editor->setMinimum(-std::numeric_limits::max()); + + switch (index.row()) + { + case 0: + case 1: + case 2: + editor->setDecimals(4); + editor->setSingleStep(0.01f); + break; + case 3: + case 4: + case 5: + editor->setDecimals(2); + editor->setSingleStep(1.0f); + break; + default: + break; + } + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} + +void +BodyDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); +} + +void +BodyDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->interpretText(); + + if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) + { + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); + } +} + +void +BodyDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + editor->setGeometry(option.rect); +} + +void +BodyDelegate::valueChanged(double d) +{ + emit commitData(static_cast(QObject::sender())); +} diff --git a/demos/rlCollisionDemo/BodyDelegate.h b/demos/rlCollisionDemo/BodyDelegate.h new file mode 100644 index 00000000..3f75cb78 --- /dev/null +++ b/demos/rlCollisionDemo/BodyDelegate.h @@ -0,0 +1,58 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef BODYDELEGATE_H +#define BODYDELEGATE_H + +#include + +class BodyDelegate : public QItemDelegate +{ + Q_OBJECT + +public: + BodyDelegate(QObject* parent = nullptr); + + virtual ~BodyDelegate(); + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; + + void setEditorData(QWidget* editor, const QModelIndex& index) const; + + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; + +public slots: + void valueChanged(double d); + +protected: + +private: + +}; + +#endif // BODYDELEGATE_H diff --git a/demos/rlCollisionDemo/BodyModel.cpp b/demos/rlCollisionDemo/BodyModel.cpp new file mode 100644 index 00000000..666b3159 --- /dev/null +++ b/demos/rlCollisionDemo/BodyModel.cpp @@ -0,0 +1,240 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include + +#include "BodyModel.h" +#include "MainWindow.h" + +BodyModel::BodyModel(QObject* parent) : + QAbstractTableModel(parent), + collision(nullptr), + view(nullptr) +{ +} + +BodyModel::~BodyModel() +{ +} + +int +BodyModel::columnCount(const QModelIndex& parent) const +{ + return 1; +} + +QVariant +BodyModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == this->collision || nullptr == this->view) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + rl::math::Transform transform; + this->collision->getFrame(transform); + rl::math::Transform::TranslationPart position = transform.translation(); + rl::math::Vector3 orientation = transform.rotation().eulerAngles(2, 1, 0).reverse(); + + switch (role) + { + case Qt::DisplayRole: + switch (index.row()) + { + case 0: + case 1: + case 2: + return QString::number(position(index.row()), 'f', 4) + QString(" m"); + break; + case 3: + case 4: + case 5: + return QString::number(orientation(index.row() - 3) * rl::math::RAD2DEG, 'f', 2) + QChar(176); + break; + default: + break; + } + break; + case Qt::EditRole: + switch (index.row()) + { + case 0: + case 1: + case 2: + return position(index.row()); + break; + case 3: + case 4: + case 5: + return orientation(index.row() - 3) * rl::math::RAD2DEG; + break; + default: + break; + } + break; + case Qt::TextAlignmentRole: + return QVariant(Qt::AlignRight | Qt::AlignVCenter); + break; + default: + break; + } + + return QVariant(); +} + +Qt::ItemFlags +BodyModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + { + return Qt::NoItemFlags; + } + + return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; +} + +QVariant +BodyModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (nullptr == this->collision || nullptr == this->view) + { + return QVariant(); + } + + if (Qt::DisplayRole == role && Qt::Vertical == orientation) + { + switch (section) + { + case 0: + return "x"; + break; + case 1: + return "y"; + break; + case 2: + return "z"; + break; + case 3: + return "a"; + break; + case 4: + return "b"; + break; + case 5: + return "c"; + break; + default: + break; + } + } + + return QVariant(); +} + +int +BodyModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == this->collision || nullptr == this->view) + { + return 0; + } + + return 6; +} + +void +BodyModel::setBody(rl::sg::Body* collision, rl::sg::Body* view) +{ + this->beginResetModel(); + this->collision = collision; + this->view = view; + this->endResetModel(); +} + +bool +BodyModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + if (nullptr == this->collision || nullptr == this->view) + { + return false; + } + + if (index.isValid() && Qt::EditRole == role) + { + rl::math::Transform transform; + this->collision->getFrame(transform); + rl::math::Transform::TranslationPart position = transform.translation(); + rl::math::Vector3 orientation = transform.linear().eulerAngles(2, 1, 0).reverse(); + + switch (index.row()) + { + case 0: + case 1: + case 2: + transform.translation()(index.row()) = value.value(); + break; + case 3: + transform.linear() = ( + rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + case 4: + transform.linear() = ( + rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + case 5: + transform.linear() = ( + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + default: + break; + } + + this->collision->setFrame(transform); + this->view->setFrame(transform); + + MainWindow::instance()->test(); + emit dataChanged(this->createIndex(0, 0), this->createIndex(this->rowCount(), this->columnCount())); + + return true; + } + + return false; +} diff --git a/demos/rlCollisionDemo/BodyModel.h b/demos/rlCollisionDemo/BodyModel.h new file mode 100644 index 00000000..8ca36c07 --- /dev/null +++ b/demos/rlCollisionDemo/BodyModel.h @@ -0,0 +1,64 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef BODYMODEL_H +#define BODYMODEL_H + +#include +#include + +class BodyModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + BodyModel(QObject* parent = nullptr); + + virtual ~BodyModel(); + + int columnCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + void setBody(rl::sg::Body* collision, rl::sg::Body* view); + + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + +protected: + +private: + rl::sg::Body* collision; + + rl::sg::Body* view; +}; + +#endif // BODYMODEL_H diff --git a/demos/rlCollisionDemo/CMakeLists.txt b/demos/rlCollisionDemo/CMakeLists.txt index c529b0e5..11edbdd3 100644 --- a/demos/rlCollisionDemo/CMakeLists.txt +++ b/demos/rlCollisionDemo/CMakeLists.txt @@ -1,74 +1,92 @@ -project(rlCollisionDemo) +find_package(OpenGL REQUIRED) +find_package(SoQt) + +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui OpenGL Widgets QUIET) +endif() + +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() -find_package(Boost REQUIRED) -find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) -include(${QT_USE_FILE}) +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Bullet) -find_package(Ode) -find_package(Pqp) -find_package(Solid) -find_package(SoQt) +find_package(ccd) +find_package(FCL) +find_package(ODE) +find_package(PQP) +find_package(SOLID3) -if(QT_FOUND AND SOQT_FOUND) - if(BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_FOUND) +if(QT_FOUND AND SoQt_FOUND) + if(BULLET_FOUND OR (CCD_FOUND AND FCL_FOUND) OR ODE_FOUND OR PQP_FOUND OR SOLID3_FOUND) set( HDRS + BodyDelegate.h + BodyModel.h MainWindow.h - TestWidget.h + SoGradientBackground.h ) set( SRCS + BodyDelegate.cpp + BodyModel.cpp MainWindow.cpp rlCollisionDemo.cpp - TestWidget.cpp + SoGradientBackground.cpp ${rl_SOURCE_DIR}/robotics-library.rc ) - qt4_wrap_cpp( - MOC_SRCS - TestWidget.h - OPTIONS - -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED - ) - add_executable( rlCollisionDemo + WIN32 ${HDRS} ${SRCS} - ${MOC_SRCS} ) target_compile_definitions( rlCollisionDemo PUBLIC - ${QT_DEFINITIONS} - ${SOQT_DEFINITIONS} + ${SoQt_DEFINITIONS} ) target_include_directories( rlCollisionDemo PUBLIC - ${Boost_INCLUDE_DIR} - ${QT_INCLUDES} - ${SOQT_INCLUDE_DIRS} + ${OPENGL_INCLUDE_DIR} + ${SoQt_INCLUDE_DIRS} ) target_link_libraries( rlCollisionDemo - rlsg + sg + ${OPENGL_LIBRARIES} ${QT_LIBRARIES} - ${SOQT_LIBRARIES} + ${SoQt_LIBRARIES} ) set_target_properties( rlCollisionDemo PROPERTIES VERSION ${VERSION} - DEBUG_POSTFIX d ) + if(WIN32) + set_target_properties( + rlCollisionDemo + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + install( TARGETS rlCollisionDemo COMPONENT demos @@ -77,23 +95,42 @@ if(QT_FOUND AND SOQT_FOUND) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + if(UNIX) - install(FILES rlCollisionDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) - endif(UNIX) + configure_file(rlCollisionDemo.desktop.in rlCollisionDemo.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlCollisionDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} "CreateShortCut \\\\ \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlCollisionDemo.lnk\\\" \\\\ \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlCollisionDemo.exe\\\" \\\\ \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlsg\\\\scene.xml\\\$\\\\\\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlsg\\\\scene.xml\\\$\\\\\\\"\\\\ \\\" \\\\ \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ \\\"Collision detection and distance computation demo with basic scene\\\"" PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCollisionDemo.lnk\\\"" PARENT_SCOPE) - endif(BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_FOUND) -endif(QT_FOUND AND SOQT_FOUND) + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlCollisionDemo.lnk\\\"" PARENT_SCOPE) + + set( + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" + PARENT_SCOPE + ) + endif() +endif() diff --git a/demos/rlCollisionDemo/MainWindow.cpp b/demos/rlCollisionDemo/MainWindow.cpp index d84b671b..ce1b8f01 100644 --- a/demos/rlCollisionDemo/MainWindow.cpp +++ b/demos/rlCollisionDemo/MainWindow.cpp @@ -24,68 +24,93 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include #include #include #include -#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include #include -#ifdef RL_SG_HAVE_BULLET +#ifdef RL_SG_BULLET #include -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_ODE +#endif // RL_SG_BULLET +#ifdef RL_SG_FCL +#include +#endif // RL_SG_FCL +#ifdef RL_SG_ODE #include -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP #include -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_PQP +#ifdef RL_SG_SOLID #include -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID +#include "BodyDelegate.h" +#include "BodyModel.h" #include "MainWindow.h" -#include "TestWidget.h" +#include "SoGradientBackground.h" -MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : +MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags f) : QMainWindow(parent, f), collisionScene(), viewScene(), body(0), + depthCoordinate(nullptr), + depthLabel(new QLabel(this)), + depthLineSet(nullptr), + depthPointSet(nullptr), + distanceCoordinate(nullptr), + distanceLabel(new QLabel(this)), + distanceLineSet(nullptr), + distancePointSet(nullptr), engine(), filename(), - model(0) + gradientBackground(), + model(0), + simpleLabel(new QLabel(this)), + viewer(nullptr) { MainWindow::singleton = this; SoQt::init(this); SoDB::init(); + SoGradientBackground::initClass(); QStringList engines; -#ifdef RL_SG_HAVE_ODE +#ifdef RL_SG_FCL + engines.push_back("fcl"); + this->engine = "fcl"; +#endif // RL_SG_FCL +#ifdef RL_SG_ODE engines.push_back("ode"); this->engine = "ode"; -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP engines.push_back("pqp"); this->engine = "pqp"; -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_BULLET +#endif // RL_SG_PQP +#ifdef RL_SG_BULLET engines.push_back("bullet"); this->engine = "bullet"; -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_BULLET +#ifdef RL_SG_SOLID engines.push_back("solid"); this->engine = "solid"; -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID engines.sort(); QRegExp bodyRegExp("--body=(\\d*)"); @@ -105,7 +130,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : } else if (-1 != helpRegExp.indexIn(QApplication::arguments()[i])) { - std::cout << "Usage: rlCollisionDemo [SCENEFILE] [--engine=" << engines.join("|").toStdString() << "] [--help] [--model=MODEL] [--body=BODY]" << std::endl; + QMessageBox::information(this, "Usage", "rlCollisionDemo [SCENEFILE] [--engine=" + engines.join("|") + "] [--help] [--model=MODEL] [--body=BODY]"); + exit(0); } else if (-1 != modelRegExp.indexIn(QApplication::arguments()[i])) { @@ -124,34 +150,45 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->resize(1024, 768); -#ifdef RL_SG_HAVE_BULLET +#ifdef RL_SG_BULLET if ("bullet" == this->engine) { - this->collisionScene = boost::make_shared< rl::sg::bullet::Scene >(); + this->collisionScene = std::make_shared(); } -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_ODE +#endif // RL_SG_BULLET +#ifdef RL_SG_FCL + if ("fcl" == this->engine) + { + this->collisionScene = std::make_shared(); + } +#endif // RL_SG_FCL +#ifdef RL_SG_ODE if ("ode" == this->engine) { - this->collisionScene = boost::make_shared< rl::sg::ode::Scene >(); + this->collisionScene = std::make_shared(); } -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP if ("pqp" == this->engine) { - this->collisionScene = boost::make_shared< rl::sg::pqp::Scene >(); + this->collisionScene = std::make_shared(); } -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_PQP +#ifdef RL_SG_SOLID if ("solid" == this->engine) { - this->collisionScene = boost::make_shared< rl::sg::solid::Scene >(); + this->collisionScene = std::make_shared(); } -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID + this->viewScene = std::make_shared(); - this->viewScene = boost::make_shared< rl::sg::so::Scene >(); + this->gradientBackground = new SoGradientBackground(); + this->gradientBackground->ref(); + this->gradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); + this->viewScene->root->insertChild(this->gradientBackground, 0); - this->viewer = new SoQtExaminerViewer(this, NULL, true, SoQtFullViewer::BUILD_POPUP); + this->viewer = new SoQtExaminerViewer(this, nullptr, true, SoQtFullViewer::BUILD_POPUP); this->viewer->setFeedbackVisibility(true); this->viewer->setSceneGraph(this->viewScene->root); this->viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); @@ -159,49 +196,116 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : this->setCentralWidget(this->viewer->getWidget()); this->setFocusProxy(this->viewer->getWidget()); - this->setWindowTitle(filename + " - " + this->engine + " - rlCollisionDemo"); + this->setWindowTitle(filename + " - " + this->engine.toUpper() + " - rlCollisionDemo"); this->collisionScene->load(this->filename.toStdString()); this->viewScene->load(this->filename.toStdString()); this->viewer->viewAll(); - TestWidget* testWidget = new TestWidget( + BodyDelegate* bodyDelegate = new BodyDelegate(this); + + BodyModel* bodyModel = new BodyModel(this); + bodyModel->setBody( this->viewScene->getModel(this->model)->getBody(this->body), - this->collisionScene->getModel(this->model)->getBody(this->body), - this + this->collisionScene->getModel(this->model)->getBody(this->body) ); - QDockWidget* testDockWidget = new QDockWidget(this); - testDockWidget->setFeatures(QDockWidget::NoDockWidgetFeatures | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable); - testDockWidget->setFloating(true); - testDockWidget->setWidget(testWidget); - testDockWidget->show(); - - SoVRMLShape* lineShape = new SoVRMLShape(); - this->lineCoordinate = new SoVRMLCoordinate(); - this->lineSet = new SoVRMLIndexedLineSet(); - SoVRMLAppearance* lineAppearance = new SoVRMLAppearance(); - SoVRMLMaterial* lineMaterial = new SoVRMLMaterial(); - lineMaterial->diffuseColor.setValue(1.0f, 0.0f, 0.0f); - lineAppearance->material = lineMaterial; - lineShape->appearance = lineAppearance; - this->lineSet->coord = this->lineCoordinate; - lineShape->geometry = this->lineSet; - this->viewScene->root->addChild(lineShape); + QTableView* bodyView = new QTableView(this); +#if QT_VERSION >= 0x050000 + bodyView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + bodyView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + bodyView->horizontalHeader()->hide(); + bodyView->setAlternatingRowColors(true); + bodyView->setItemDelegate(bodyDelegate); + bodyView->setModel(bodyModel); + + QDockWidget* bodyDockWidget = new QDockWidget(this); + bodyDockWidget->resize(160, 240); + bodyDockWidget->setFeatures(QDockWidget::NoDockWidgetFeatures | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable); + bodyDockWidget->setFloating(true); + bodyDockWidget->setWidget(bodyView); + bodyDockWidget->setWindowTitle("Model[" + QString::number(this->model) + "]->Body[" + QString::number(this->body) + "]"); + + SoDrawStyle* drawStyle = new SoDrawStyle(); + drawStyle->lineWidth = 0.0f; + drawStyle->pointSize = 10.0f; + this->viewScene->root->addChild(drawStyle); + + this->depthCoordinate = new SoVRMLCoordinate(); + this->depthLineSet = new SoVRMLIndexedLineSet(); + this->depthPointSet = new SoVRMLPointSet(); + + SoVRMLAppearance* depthAppearance = new SoVRMLAppearance(); + SoVRMLMaterial* depthMaterial = new SoVRMLMaterial(); + depthMaterial->diffuseColor.setValue(1.0f, 0.0f, 0.0f); + depthMaterial->emissiveColor.setValue(1.0f, 0.0f, 0.0f); + depthAppearance->material = depthMaterial; + + SoVRMLShape* depthLineShape = new SoVRMLShape(); + depthLineShape->appearance = depthAppearance; + this->depthLineSet->coord = this->depthCoordinate; + depthLineShape->geometry = this->depthLineSet; + this->viewScene->root->addChild(depthLineShape); + + SoVRMLShape* depthPointShape = new SoVRMLShape(); + depthPointShape->appearance = depthAppearance; + this->depthPointSet->coord = this->depthCoordinate; + depthPointShape->geometry = this->depthPointSet; + this->viewScene->root->addChild(depthPointShape); + + this->distanceCoordinate = new SoVRMLCoordinate(); + this->distanceLineSet = new SoVRMLIndexedLineSet(); + this->distancePointSet = new SoVRMLPointSet(); + + SoVRMLAppearance* distanceAppearance = new SoVRMLAppearance(); + SoVRMLMaterial* distanceMaterial = new SoVRMLMaterial(); + distanceMaterial->diffuseColor.setValue(0.0f, 1.0f, 0.0f); + distanceMaterial->emissiveColor.setValue(0.0f, 1.0f, 0.0f); + distanceAppearance->material = distanceMaterial; + + SoVRMLShape* distanceLineShape = new SoVRMLShape(); + distanceLineShape->appearance = distanceAppearance; + this->distanceLineSet->coord = this->distanceCoordinate; + distanceLineShape->geometry = this->distanceLineSet; + this->viewScene->root->addChild(distanceLineShape); + + SoVRMLShape* distancePointShape = new SoVRMLShape(); + distancePointShape->appearance = distanceAppearance; + this->distancePointSet->coord = this->distanceCoordinate; + distancePointShape->geometry = this->distancePointSet; + this->viewScene->root->addChild(distancePointShape); + + if (dynamic_cast(this->collisionScene.get())) + { + this->statusBar()->addWidget(this->simpleLabel); + } + + if (dynamic_cast(this->collisionScene.get())) + { + this->statusBar()->addWidget(this->distanceLabel); + } + + if (dynamic_cast(this->collisionScene.get())) + { + this->statusBar()->addWidget(this->depthLabel); + } this->test(); } MainWindow::~MainWindow() { - MainWindow::singleton = NULL; + this->gradientBackground->unref(); + MainWindow::singleton = nullptr; } MainWindow* MainWindow::instance() { - if (NULL == MainWindow::singleton) + if (nullptr == MainWindow::singleton) { new MainWindow(); } @@ -212,22 +316,32 @@ MainWindow::instance() void MainWindow::test() { - if (rl::sg::SimpleScene* simpleScene = dynamic_cast< rl::sg::SimpleScene* >(this->collisionScene.get())) + if (rl::sg::SimpleScene* simpleScene = dynamic_cast(this->collisionScene.get())) { bool test = simpleScene->isColliding(); if (test) { - this->viewer->setBackgroundColor(SbColor(1, 0, 0)); + this->simpleLabel->setText("Collision: true"); + this->viewer->setBackgroundColor(SbColor(0.5, 0, 0)); + this->gradientBackground->color0.setValue(0.5f, 0.0f, 0.0f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); } else { + this->simpleLabel->setText("Collision: false"); this->viewer->setBackgroundColor(SbColor(0, 0, 0)); + this->gradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); } } - if (rl::sg::DistanceScene* distanceScene = dynamic_cast< rl::sg::DistanceScene* >(this->collisionScene.get())) + if (rl::sg::DistanceScene* distanceScene = dynamic_cast(this->collisionScene.get())) { + this->distanceCoordinate->point.setNum(0); + this->distanceLineSet->coordIndex.setNum(0); + this->distanceCoordinate->point.setNum(0); + rl::math::Vector3 point1; rl::math::Vector3 point2; @@ -238,23 +352,83 @@ MainWindow::test() point2 ); - this->lineCoordinate->point.setNum(0); - this->lineSet->coordIndex.setNum(0); - this->lineCoordinate->point.set1Value( - this->lineCoordinate->point.getNum(), - point1.x(), point1.y(), point1.z() - ); - this->lineSet->coordIndex.set1Value( - this->lineSet->coordIndex.getNum(), - this->lineCoordinate->point.getNum() - 1 - ); - this->lineCoordinate->point.set1Value( - this->lineCoordinate->point.getNum(), - point2.x(), point2.y(), point2.z() - ); - this->lineSet->coordIndex.set1Value( - this->lineSet->coordIndex.getNum(), - this->lineCoordinate->point.getNum() - 1 + this->distanceLabel->setText("Distance: " + QString::number(distance)); + + if (distance > std::numeric_limits::epsilon()) + { + this->distanceCoordinate->point.set1Value( + this->distanceCoordinate->point.getNum(), + point1.x(), point1.y(), point1.z() + ); + this->distanceLineSet->coordIndex.set1Value( + this->distanceLineSet->coordIndex.getNum(), + this->distanceCoordinate->point.getNum() - 1 + ); + this->distanceCoordinate->point.set1Value( + this->distanceCoordinate->point.getNum(), + point2.x(), point2.y(), point2.z() + ); + this->distanceLineSet->coordIndex.set1Value( + this->distanceLineSet->coordIndex.getNum(), + this->distanceCoordinate->point.getNum() - 1 + ); + + this->distanceCoordinate->point.set1Value( + this->distanceCoordinate->point.getNum(), + point1.x(), point1.y(), point1.z() + ); + this->distanceCoordinate->point.set1Value( + this->distanceCoordinate->point.getNum(), + point2.x(), point2.y(), point2.z() + ); + } + } + + if (rl::sg::DepthScene* depthScene = dynamic_cast(this->collisionScene.get())) + { + this->depthCoordinate->point.setNum(0); + this->depthLineSet->coordIndex.setNum(0); + this->depthCoordinate->point.setNum(0); + + rl::math::Vector3 point1; + rl::math::Vector3 point2; + + rl::math::Real depth = depthScene->depth( + this->collisionScene->getModel(0)->getBody(0), + this->collisionScene->getModel(1)->getBody(0), + point1, + point2 ); + + this->depthLabel->setText("Depth: " + QString::number(depth)); + + if (depth > std::numeric_limits::epsilon()) + { + this->depthCoordinate->point.set1Value( + this->depthCoordinate->point.getNum(), + point1.x(), point1.y(), point1.z() + ); + this->depthLineSet->coordIndex.set1Value( + this->depthLineSet->coordIndex.getNum(), + this->depthCoordinate->point.getNum() - 1 + ); + this->depthCoordinate->point.set1Value( + this->depthCoordinate->point.getNum(), + point2.x(), point2.y(), point2.z() + ); + this->depthLineSet->coordIndex.set1Value( + this->depthLineSet->coordIndex.getNum(), + this->depthCoordinate->point.getNum() - 1 + ); + + this->depthCoordinate->point.set1Value( + this->depthCoordinate->point.getNum(), + point1.x(), point1.y(), point1.z() + ); + this->depthCoordinate->point.set1Value( + this->depthCoordinate->point.getNum(), + point2.x(), point2.y(), point2.z() + ); + } } } diff --git a/demos/rlCollisionDemo/MainWindow.h b/demos/rlCollisionDemo/MainWindow.h index 4d25ec2b..f6ef5ac9 100644 --- a/demos/rlCollisionDemo/MainWindow.h +++ b/demos/rlCollisionDemo/MainWindow.h @@ -24,19 +24,23 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _MAINWINDOW_H_ -#define _MAINWINDOW_H_ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H +#include #include +#include #include -#include #include #include #include +#include #include #include #include +class SoGradientBackground; + class MainWindow : public QMainWindow { public: @@ -46,29 +50,45 @@ class MainWindow : public QMainWindow void test(); - boost::shared_ptr< rl::sg::Scene > collisionScene; + std::shared_ptr collisionScene; - boost::shared_ptr< rl::sg::so::Scene > viewScene; + std::shared_ptr viewScene; protected: - MainWindow(QWidget* parent = NULL, Qt::WFlags f = 0); + MainWindow(QWidget* parent = nullptr, Qt::WindowFlags f = 0); private: std::size_t body; + SoVRMLCoordinate* depthCoordinate; + + QLabel* depthLabel; + + SoVRMLIndexedLineSet* depthLineSet; + + SoVRMLPointSet* depthPointSet; + + SoVRMLCoordinate* distanceCoordinate; + + QLabel* distanceLabel; + + SoVRMLIndexedLineSet* distanceLineSet; + + SoVRMLPointSet* distancePointSet; + QString engine; QString filename; - SoVRMLCoordinate* lineCoordinate; - - SoVRMLIndexedLineSet* lineSet; + SoGradientBackground* gradientBackground; std::size_t model; + QLabel* simpleLabel; + static MainWindow* singleton; SoQtExaminerViewer* viewer; }; -#endif // _MAINWINDOW_H_ +#endif // MAINWINDOW_H diff --git a/demos/rlCollisionDemo/SoGradientBackground.cpp b/demos/rlCollisionDemo/SoGradientBackground.cpp new file mode 100644 index 00000000..bd1d852f --- /dev/null +++ b/demos/rlCollisionDemo/SoGradientBackground.cpp @@ -0,0 +1,109 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifdef WIN32 +#include +#endif // WIN32 + +#ifdef __APPLE__ +#include +#else // __APPLE__ +#include +#endif // __APPLE__ + +#include + +#include "SoGradientBackground.h" + +SO_NODE_SOURCE(SoGradientBackground); + +SoGradientBackground::SoGradientBackground() : + SoNode(), + color0(), + color1() +{ + SO_NODE_CONSTRUCTOR(SoGradientBackground); + + SO_NODE_ADD_FIELD(color0, (1.0f, 1.0f, 1.0f)); + SO_NODE_ADD_FIELD(color1, (0.0f, 0.0f, 0.0f)); +} + +SoGradientBackground::~SoGradientBackground() +{ +} + +SbBool +SoGradientBackground::affectsState() const +{ + return false; +} + +void +SoGradientBackground::exitClass() +{ +} + +void +SoGradientBackground::GLRender(SoGLRenderAction* action) +{ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glBegin(GL_QUADS); + + glColor3f(this->color0.getValue()[0], this->color0.getValue()[1], this->color0.getValue()[2]); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glColor3f(this->color1.getValue()[0], this->color1.getValue()[1], this->color1.getValue()[2]); + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + + glEnd(); + + glPopAttrib(); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void +SoGradientBackground::initClass() +{ + SO_NODE_INIT_CLASS(SoGradientBackground, SoNode, "Node"); +} diff --git a/demos/rlCollisionDemo/SoGradientBackground.h b/demos/rlCollisionDemo/SoGradientBackground.h new file mode 100644 index 00000000..5fc080f5 --- /dev/null +++ b/demos/rlCollisionDemo/SoGradientBackground.h @@ -0,0 +1,59 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOGRADIENTBACKGROUND_H +#define SOGRADIENTBACKGROUND_H + +#include +#include + +class SoGradientBackground : public SoNode +{ + SO_NODE_HEADER(SoGradientBackground); + +public: + SoGradientBackground(); + + virtual SbBool affectsState() const; + + static void exitClass(); + + virtual void GLRender(SoGLRenderAction* action); + + static void initClass(); + + SoSFColor color0; + + SoSFColor color1; + +protected: + virtual ~SoGradientBackground(); + +private: + +}; + +#endif // SOGRADIENTBACKGROUND_H diff --git a/demos/rlCollisionDemo/TestWidget.cpp b/demos/rlCollisionDemo/TestWidget.cpp deleted file mode 100644 index e0bf49ee..00000000 --- a/demos/rlCollisionDemo/TestWidget.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) 2009, Markus Rickert -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include -#include -#include - -#include "MainWindow.h" -#include "TestWidget.h" - -TestWidget::TestWidget(rl::sg::Body* body0, rl::sg::Body* body1, QWidget* parent, Qt::WFlags f) : - QWidget(parent, f), - body0(body0), - body1(body1) -{ - QVBoxLayout* mainLayout = new QVBoxLayout(this); - mainLayout->setMargin(4); - - rl::math::Transform frame; - this->body0->getFrame(frame); - - QDoubleSpinBox* xDoubleSpinBox = new QDoubleSpinBox(this); - mainLayout->addWidget(xDoubleSpinBox); - xDoubleSpinBox->setRange(-std::numeric_limits< rl::math::Real >::max(), std::numeric_limits< rl::math::Real >::max()); - xDoubleSpinBox->setSingleStep(0.1f); - xDoubleSpinBox->setValue(frame(0, 3)); - QObject::connect(xDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setX(double))); - - QDoubleSpinBox* yDoubleSpinBox = new QDoubleSpinBox(this); - mainLayout->addWidget(yDoubleSpinBox); - yDoubleSpinBox->setRange(-std::numeric_limits< rl::math::Real >::max(), std::numeric_limits< rl::math::Real >::max()); - yDoubleSpinBox->setSingleStep(0.1f); - yDoubleSpinBox->setValue(frame(1, 3)); - QObject::connect(yDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setY(double))); - - QDoubleSpinBox* zDoubleSpinBox = new QDoubleSpinBox(this); - mainLayout->addWidget(zDoubleSpinBox); - zDoubleSpinBox->setRange(-std::numeric_limits< rl::math::Real >::max(), std::numeric_limits< rl::math::Real >::max()); - zDoubleSpinBox->setSingleStep(0.1f); - zDoubleSpinBox->setValue(frame(2, 3)); - QObject::connect(zDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZ(double))); -} - -TestWidget::~TestWidget() -{ -} - -void -TestWidget::setX(double x) -{ - rl::math::Transform frame; - this->body0->getFrame(frame); - frame(0, 3) = x; - this->body0->setFrame(frame); - this->body1->setFrame(frame); - MainWindow::instance()->test(); -} - -void -TestWidget::setY(double y) -{ - rl::math::Transform frame; - this->body0->getFrame(frame); - frame(1, 3) = y; - this->body0->setFrame(frame); - this->body1->setFrame(frame); - MainWindow::instance()->test(); -} - -void -TestWidget::setZ(double z) -{ - rl::math::Transform frame; - this->body0->getFrame(frame); - frame(2, 3) = z; - this->body0->setFrame(frame); - this->body1->setFrame(frame); - MainWindow::instance()->test(); -} diff --git a/demos/rlCollisionDemo/rlCollisionDemo.cpp b/demos/rlCollisionDemo/rlCollisionDemo.cpp index aafcb770..43471473 100644 --- a/demos/rlCollisionDemo/rlCollisionDemo.cpp +++ b/demos/rlCollisionDemo/rlCollisionDemo.cpp @@ -25,20 +25,31 @@ // #include +#include #include +#include #include "MainWindow.h" -MainWindow* MainWindow::singleton = NULL; +MainWindow* MainWindow::singleton = nullptr; int main(int argc, char** argv) { - QApplication application(argc, argv); - - QObject::connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit())); - - MainWindow::instance()->show(); - - return application.exec(); + try + { + QApplication application(argc, argv); + + QObject::connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit())); + + MainWindow::instance()->show(); + + return application.exec(); + } + catch (const std::exception& e) + { + QApplication application(argc, argv); + QMessageBox::critical(nullptr, "Error", e.what()); + return EXIT_FAILURE; + } } diff --git a/demos/rlCollisionDemo/rlCollisionDemo.desktop b/demos/rlCollisionDemo/rlCollisionDemo.desktop.in similarity index 73% rename from demos/rlCollisionDemo/rlCollisionDemo.desktop rename to demos/rlCollisionDemo/rlCollisionDemo.desktop.in index 30db9d5e..c1e1a146 100644 --- a/demos/rlCollisionDemo/rlCollisionDemo.desktop +++ b/demos/rlCollisionDemo/rlCollisionDemo.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Categories=Science;Robotics; Comment=Collision detection and distance computation demo with basic scene -Exec=sh -c "rlCollisionDemo $(dirname %k)/../rl/examples/rlsg/scene.xml" +Exec=sh -c "rlCollisionDemo $(dirname %k)/../rl-@VERSION@/examples/rlsg/scene.xml" Icon=robotics-library Name=Robotics Library (rlCollisionDemo) Type=Application diff --git a/demos/rlDenavitHartenbergDemo/CMakeLists.txt b/demos/rlDenavitHartenbergDemo/CMakeLists.txt index 899a0192..3dbc2266 100644 --- a/demos/rlDenavitHartenbergDemo/CMakeLists.txt +++ b/demos/rlDenavitHartenbergDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlDenavitHartenbergDemo) - add_executable( rlDenavitHartenbergDemo rlDenavitHartenbergDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlDenavitHartenbergDemo - rlmath + math ) diff --git a/demos/rlDenavitHartenbergDemo/rlDenavitHartenbergDemo.cpp b/demos/rlDenavitHartenbergDemo/rlDenavitHartenbergDemo.cpp index eb37f00e..875217a2 100644 --- a/demos/rlDenavitHartenbergDemo/rlDenavitHartenbergDemo.cpp +++ b/demos/rlDenavitHartenbergDemo/rlDenavitHartenbergDemo.cpp @@ -39,26 +39,26 @@ main(int argc, char** argv) rl::math::Real d = 101.0f; rl::math::Real theta = 181.0f * rl::math::DEG2RAD; - rl::math::Transform t_d(::rl::math::Translation(0, 0, d)); + rl::math::Transform t_d(rl::math::Translation(0, 0, d)); std::cout << "T_d = " << std::endl << t_d.matrix() << std::endl; rl::math::Transform t_theta( - ::rl::math::AngleAxis(theta, ::rl::math::Vector3::UnitZ()) * - ::rl::math::AngleAxis(0, ::rl::math::Vector3::UnitY()) * - ::rl::math::AngleAxis(0, ::rl::math::Vector3::UnitX()) + rl::math::AngleAxis(theta, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(0, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(0, rl::math::Vector3::UnitX()) ); std::cout << "T_theta = " << std::endl << t_theta.matrix() << std::endl; - rl::math::Transform t_a(::rl::math::Translation(a, 0, 0)); + rl::math::Transform t_a(rl::math::Translation(a, 0, 0)); std::cout << "T_a = " << std::endl << t_a.matrix() << std::endl; rl::math::Transform t_alpha( - ::rl::math::AngleAxis(0, ::rl::math::Vector3::UnitZ()) * - ::rl::math::AngleAxis(0, ::rl::math::Vector3::UnitY()) * - ::rl::math::AngleAxis(alpha, ::rl::math::Vector3::UnitX()) + rl::math::AngleAxis(0, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(0, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(alpha, rl::math::Vector3::UnitX()) ); std::cout << "T_alpha = " << std::endl << t_alpha.matrix() << std::endl; @@ -68,16 +68,16 @@ main(int argc, char** argv) std::cout << "A = " << std::endl << t.matrix() << std::endl; rl::math::Transform dh; - rl::math::transform::setDenavitHartenberg(d, theta, a, alpha, dh); + dh.fromDenavitHartenbergPaul(d, theta, a, alpha); std::cout << "A = " << std::endl << dh.matrix() << std::endl; - rl::math::transform::getDenavitHartenberg(dh, d, theta, a, alpha); + dh.toDenavitHartenbergPaul(d, theta, a, alpha); std::cout << "a = " << a << std::endl; std::cout << "alpha = " << alpha * rl::math::RAD2DEG << std::endl; std::cout << "d = " << d << std::endl; std::cout << "theta = " << theta * rl::math::RAD2DEG << std::endl; - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlDynamics1Demo/CMakeLists.txt b/demos/rlDynamics1Demo/CMakeLists.txt index 4546653c..58f18455 100644 --- a/demos/rlDynamics1Demo/CMakeLists.txt +++ b/demos/rlDynamics1Demo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlDynamics1Demo) - find_package(Boost REQUIRED) add_executable( @@ -15,5 +13,5 @@ target_include_directories( target_link_libraries( rlDynamics1Demo - rlmdl + mdl ) diff --git a/demos/rlDynamics1Demo/rlDynamics1Demo.cpp b/demos/rlDynamics1Demo/rlDynamics1Demo.cpp index 094a4132..8deb7291 100644 --- a/demos/rlDynamics1Demo/rlDynamics1Demo.cpp +++ b/demos/rlDynamics1Demo/rlDynamics1Demo.cpp @@ -25,9 +25,9 @@ // #include +#include #include #include -#include #include #include #include @@ -38,26 +38,25 @@ main(int argc, char** argv) if (argc < 2) { std::cout << "Usage: rlDynamics1Demo MODELFILE Q1 ... Qn QD1 ... QDn QDD1 ... QDDn" << std::endl; - return 1; + return EXIT_FAILURE; } try { rl::mdl::XmlFactory factory; - boost::shared_ptr< rl::mdl::Model > model(factory.create(argv[1])); + std::shared_ptr model(factory.create(argv[1])); - rl::mdl::Dynamic* dynamic = dynamic_cast< rl::mdl::Dynamic* >(model.get()); + rl::mdl::Dynamic* dynamic = dynamic_cast(model.get()); rl::math::Vector q(model->getDof()); rl::math::Vector qd(model->getDof()); rl::math::Vector qdd(model->getDof()); - rl::math::Vector tau(model->getDof()); for (std::size_t i = 0; i < model->getDof(); ++i) { - q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]); - qd(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2 + model->getDof()]); - qdd(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2 + 2 * model->getDof()]); + q(i) = boost::lexical_cast(argv[i + 2]); + qd(i) = boost::lexical_cast(argv[i + 2 + model->getDof()]); + qdd(i) = boost::lexical_cast(argv[i + 2 + 2 * model->getDof()]); } dynamic->setPosition(q); @@ -65,24 +64,20 @@ main(int argc, char** argv) dynamic->setAcceleration(qdd); dynamic->inverseDynamics(); - dynamic->getTorque(tau); - std::cout << "tau = " << tau.transpose() << std::endl; + std::cout << "tau = " << dynamic->getTorque().transpose() << std::endl; dynamic->forwardDynamics(); - dynamic->getAcceleration(qdd); - std::cout << "qdd = " << qdd.transpose() << std::endl; + std::cout << "qdd = " << dynamic->getAcceleration().transpose() << std::endl; dynamic->rungeKuttaNystrom(1); - dynamic->getPosition(q); - dynamic->getVelocity(qd); - std::cout << "q = " << q.transpose() << std::endl; - std::cout << "qd = " << qd.transpose() << std::endl; + std::cout << "q = " << dynamic->getPosition().transpose() << std::endl; + std::cout << "qd = " << dynamic->getVelocity().transpose() << std::endl; } catch (const std::exception& e) { std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlDynamics2Demo/CMakeLists.txt b/demos/rlDynamics2Demo/CMakeLists.txt index ec8de1c5..e18f88a7 100644 --- a/demos/rlDynamics2Demo/CMakeLists.txt +++ b/demos/rlDynamics2Demo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlDynamics2Demo) - find_package(Boost REQUIRED) add_executable( @@ -15,5 +13,5 @@ target_include_directories( target_link_libraries( rlDynamics2Demo - rlmdl + mdl ) diff --git a/demos/rlDynamics2Demo/rlDynamics2Demo.cpp b/demos/rlDynamics2Demo/rlDynamics2Demo.cpp index 5f155083..b1192c02 100644 --- a/demos/rlDynamics2Demo/rlDynamics2Demo.cpp +++ b/demos/rlDynamics2Demo/rlDynamics2Demo.cpp @@ -25,9 +25,9 @@ // #include +#include #include #include -#include #include #include #include @@ -39,26 +39,25 @@ main(int argc, char** argv) if (argc < 2) { std::cout << "Usage: rlDynamics2Demo MODELFILE Q1 ... Qn QD1 ... QDn QDD1 ... QDDn" << std::endl; - return 1; + return EXIT_FAILURE; } try { rl::mdl::XmlFactory factory; - boost::shared_ptr< rl::mdl::Model > model(factory.create(argv[1])); + std::shared_ptr model(factory.create(argv[1])); - rl::mdl::Dynamic* dynamic = dynamic_cast< rl::mdl::Dynamic* >(model.get()); + rl::mdl::Dynamic* dynamic = dynamic_cast(model.get()); rl::math::Vector q(dynamic->getDof()); rl::math::Vector qd(dynamic->getDof()); rl::math::Vector qdd(dynamic->getDof()); - rl::math::Vector tau(dynamic->getDof()); for (std::size_t i = 0; i < dynamic->getDof(); ++i) { - q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]); - qd(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2 + dynamic->getDof()]); - qdd(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2 + 2 * dynamic->getDof()]); + q(i) = boost::lexical_cast(argv[i + 2]); + qd(i) = boost::lexical_cast(argv[i + 2 + dynamic->getDof()]); + qdd(i) = boost::lexical_cast(argv[i + 2 + 2 * dynamic->getDof()]); } rl::math::Vector g(3); @@ -138,8 +137,9 @@ main(int argc, char** argv) dynamic->setVelocity(qd); dynamic->setAcceleration(qdd); dynamic->inverseDynamics(); - dynamic->getTorque(tau); - std::cout << "tau = " << tau.transpose() << std::endl; + std::cout << "tau = " << dynamic->getTorque().transpose() << std::endl; + + rl::math::Vector tau = dynamic->getTorque(); std::cout << "-------------------------------------------------------------------------------" << std::endl; @@ -179,8 +179,7 @@ main(int argc, char** argv) dynamic->setVelocity(qd); dynamic->setTorque(tau); dynamic->forwardDynamics(); - dynamic->getAcceleration(tmp); - std::cout << "qdd = " << tmp.transpose() << std::endl; + std::cout << "qdd = " << dynamic->getAcceleration().transpose() << std::endl; std::cout << "-------------------------------------------------------------------------------" << std::endl; @@ -209,8 +208,8 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlEulerAnglesDemo/CMakeLists.txt b/demos/rlEulerAnglesDemo/CMakeLists.txt new file mode 100644 index 00000000..e4c2e8cd --- /dev/null +++ b/demos/rlEulerAnglesDemo/CMakeLists.txt @@ -0,0 +1,17 @@ +find_package(Boost REQUIRED) + +add_executable( + rlEulerAnglesDemo + rlEulerAnglesDemo.cpp +) + +target_include_directories( + rlEulerAnglesDemo + PUBLIC + ${Boost_INCLUDE_DIR} +) + +target_link_libraries( + rlEulerAnglesDemo + math +) diff --git a/demos/rlRodriguesDemo/rlRodriguesDemo.cpp b/demos/rlEulerAnglesDemo/rlEulerAnglesDemo.cpp similarity index 50% rename from demos/rlRodriguesDemo/rlRodriguesDemo.cpp rename to demos/rlEulerAnglesDemo/rlEulerAnglesDemo.cpp index 489606d9..76d5ec0c 100644 --- a/demos/rlRodriguesDemo/rlRodriguesDemo.cpp +++ b/demos/rlEulerAnglesDemo/rlEulerAnglesDemo.cpp @@ -24,6 +24,9 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include +#include +#include #include #include #include @@ -31,30 +34,38 @@ int main(int argc, char** argv) { - rl::math::Rotation r; - rl::math::rotation::fromXyz(0.0f * rl::math::DEG2RAD, 0.0f * rl::math::DEG2RAD, 90.0f * rl::math::DEG2RAD, r); - std::cout << r << std::endl; + if (argc < 7) + { + std::cout << "Usage: rlEulerAnglesDemo AXIS0 AXIS1 AXIS2 DEG0 DEG1 DEG2" << std::endl; + return EXIT_FAILURE; + } - rl::math::Vector3 rodrigues; - rl::math::rotation::toRodrigues(r, rodrigues); - std::cout << rodrigues(0) * rl::math::RAD2DEG << " " << rodrigues(1) * rl::math::RAD2DEG << " " << rodrigues(2) * rl::math::RAD2DEG << std::endl; + rl::math::Matrix33 rotation = rl::math::Matrix33::Identity(); - rl::math::rotation::fromRodrigues(rodrigues(0), rodrigues(1), rodrigues(2), r); - std::cout << r << std::endl; + for (std::size_t i = 0; i < 3; ++i) + { + rl::math::Real angle = boost::lexical_cast(argv[i + 4]) * rl::math::DEG2RAD; + + rl::math::Vector3 axis( + 0 == boost::lexical_cast(argv[i + 1]) ? 1 : 0, + 1 == boost::lexical_cast(argv[i + 1]) ? 1 : 0, + 2 == boost::lexical_cast(argv[i + 1]) ? 1 : 0 + ); + std::cout << "angle" << i << ": " << angle << " rad - axis" << i << ": " << axis.transpose() << std::endl; + + rotation = rotation * rl::math::AngleAxis(angle, axis); + } - rl::math::Rotation t0; - boost::numeric::bindings::ippm::loadIdentity(t0); - rl::math::Rotation t1; - boost::numeric::bindings::ippm::loadIdentity(t1); - rl::math::rotation::fromXyz(10.0f * rl::math::DEG2RAD, 20.0f * rl::math::DEG2RAD, 30.0f * rl::math::DEG2RAD, t1); + std::cout << std::endl; - rl::math::Vector3 e; + rl::math::Quaternion quaternion(rotation); + std::cout << "quaternion.w: " << quaternion.w() << " - quaternion.vec: " << quaternion.vec().transpose() << std::endl; - e(0) = t0(1, 0) * t1(2, 0) / 0.2e1 - t0(2, 0) * t1(1, 0) / 0.2e1 + t0(1, 1) * t1(2, 1) / 0.2e1 - t0(2, 1) * t1(1, 1) / 0.2e1 + t0(1, 2) * t1(2, 2) / 0.2e1 - t0(2, 2) * t1(1, 2) / 0.2e1; - e(1) = t0(2, 0) * t1(0, 0) / 0.2e1 - t0(0, 0) * t1(2, 0) / 0.2e1 + t0(2, 1) * t1(0, 1) / 0.2e1 - t0(0, 1) * t1(2, 1) / 0.2e1 + t0(2, 2) * t1(0, 2) / 0.2e1 - t0(0, 2) * t1(2, 2) / 0.2e1; - e(2) = t0(0, 0) * t1(1, 0) / 0.2e1 - t0(1, 0) * t1(0, 0) / 0.2e1 + t0(0, 1) * t1(1, 1) / 0.2e1 - t0(1, 1) * t1(0, 1) / 0.2e1 + t0(0, 2) * t1(1, 2) / 0.2e1 - t0(1, 2) * t1(0, 2) / 0.2e1; + rl::math::AngleAxis angleAxis(rotation); + std::cout << "angle: " << angleAxis.angle() << " rad - axis: " << angleAxis.axis().transpose() << std::endl; - std::cout << e(0) * rl::math::RAD2DEG << " " << e(1) * rl::math::RAD2DEG << " " << e(2) * rl::math::RAD2DEG << std::endl; + rl::math::Vector3 orientation = rotation.eulerAngles(2, 1, 0).reverse(); + std::cout << "x: " << orientation.x() * rl::math::RAD2DEG << " deg - y: " << orientation.y() * rl::math::RAD2DEG << " deg - z: " << orientation.z() * rl::math::RAD2DEG << " deg" << std::endl; - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlFilterDemo/CMakeLists.txt b/demos/rlFilterDemo/CMakeLists.txt new file mode 100644 index 00000000..bbb8770f --- /dev/null +++ b/demos/rlFilterDemo/CMakeLists.txt @@ -0,0 +1,29 @@ +add_executable( + rlKalmanDemo + rlKalmanDemo.cpp +) + +target_link_libraries( + rlKalmanDemo + math +) + +add_executable( + rlKalmanDemo2 + rlKalmanDemo2.cpp +) + +target_link_libraries( + rlKalmanDemo2 + math +) + +add_executable( + rlLowPassDemo + rlLowPassDemo.cpp +) + +target_link_libraries( + rlLowPassDemo + math +) diff --git a/demos/rlFilterDemo/rlKalmanDemo.cpp b/demos/rlFilterDemo/rlKalmanDemo.cpp new file mode 100644 index 00000000..277b2cec --- /dev/null +++ b/demos/rlFilterDemo/rlKalmanDemo.cpp @@ -0,0 +1,89 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include +#include + +int +main(int argc, char** argv) +{ + std::size_t ss = 4; + std::size_t os = 2; + + rl::math::Kalman kalman(ss, os); + + kalman.stateTransitionModel().setIdentity(); + kalman.stateTransitionModel().topRightCorner(os, os).setIdentity(); + + kalman.measurementModel().setIdentity(); + kalman.processNoiseCovariance() = 0.1 * rl::math::Matrix::Identity(ss, ss); + kalman.measurementNoiseCovariance().setIdentity(); + + rl::math::Vector initx(ss); + initx << 10, 10, 1, 0; + + rl::math::Matrix initV = 10 * rl::math::Matrix::Identity(ss, ss); + + std::vector y(15, rl::math::Vector(os)); + y[0] << 11.4975, 10.3752; + y[1] << 8.3492, 11.7446; + y[2] << 12.2346, 10.1007; + y[3] << 13.0197, 9.0750; + y[4] << 12.9370, 9.4789; + y[5] << 14.9108, 9.6574; + y[6] << 17.0387, 9.1131; + y[7] << 14.6307, 7.5850; + y[8] << 18.1220, 6.4678; + y[9] << 16.8157, 5.0222; + y[10] << 18.0819, 5.7949; + y[11] << 17.9199, 4.4554; + y[12] << 20.4956, 6.4279; + y[13] << 18.9063, 6.4588; + y[14] << 19.4037, 2.7445; + + for (std::size_t i = 0; i < y.size(); ++i) + { + if (i > 0) + { + kalman.predict(); + } + else + { + kalman.statePriori() = initx; + kalman.errorCovariancePriori() = initV; + } + + kalman.correct(y[i]); + + std::cout << "xfilt[" << i << "] = " << kalman.statePosteriori().transpose() << std::endl; + std::cout << "Vfilt[" << i << "] = " << std::endl << kalman.errorCovariancePosteriori().transpose() << std::endl; + } + + return EXIT_SUCCESS; +} diff --git a/demos/rlFilterDemo/rlKalmanDemo2.cpp b/demos/rlFilterDemo/rlKalmanDemo2.cpp new file mode 100644 index 00000000..11aa63b4 --- /dev/null +++ b/demos/rlFilterDemo/rlKalmanDemo2.cpp @@ -0,0 +1,96 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include +#include + +int +main(int argc, char** argv) +{ + if (argc < 3) + { + std::cout << "Usage: rlKalmanDemo2 DATA FILTERED" << std::endl; + return EXIT_FAILURE; + } + + // plot for [i=2:4] "DATA" using 1:i with lines, for [i=2:4] "FILTERED" using 1:i with lines + + std::ifstream data; + data.open(argv[1]); + + std::ofstream filtered; + filtered.open(argv[2], std::fstream::trunc); + + std::size_t ss = 3; + std::size_t os = 3; + + rl::math::Kalman kalman(ss, os); + + kalman.stateTransitionModel().setIdentity(); + + kalman.measurementModel().setIdentity(); + kalman.processNoiseCovariance() = 0.001 * rl::math::Matrix::Identity(ss, ss); + kalman.measurementNoiseCovariance() = 5 * rl::math::Matrix::Identity(ss, ss); + + kalman.statePosteriori().setZero(); + kalman.errorCovariancePosteriori() = 1 * rl::math::Matrix::Identity(ss, ss); + + for (std::string line; std::getline(data, line);) + { + std::istringstream stream(line); + + rl::math::Real time = 0; + stream >> time; + + rl::math::Vector prediction = kalman.predict(); + + rl::math::Vector measurement(os); + + for (std::size_t i = 0; i < os; ++i) + { + stream >> measurement(i); + } + + rl::math::Vector estimation = kalman.correct(measurement); + + filtered << time; + + for (std::size_t i = 0; i < ss; ++i) + { + filtered << "\t" << estimation(i); + } + + filtered << std::endl; + } + + data.close(); + filtered.close(); + + return EXIT_SUCCESS; +} diff --git a/demos/rlFilterDemo/rlLowPassDemo.cpp b/demos/rlFilterDemo/rlLowPassDemo.cpp new file mode 100644 index 00000000..1af03819 --- /dev/null +++ b/demos/rlFilterDemo/rlLowPassDemo.cpp @@ -0,0 +1,81 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include + +int +main(int argc, char** argv) +{ + if (argc < 3) + { + std::cout << "Usage: rlLowPassDemo DATA FILTERED" << std::endl; + return EXIT_FAILURE; + } + + // plot for [i=2:4] "DATA" using 1:i with lines, for [i=2:4] "FILTERED" using 1:i with lines + + std::ifstream data; + data.open(argv[1]); + + std::ofstream filtered; + filtered.open(argv[2], std::fstream::trunc); + + rl::math::LowPass lowPass = rl::math::LowPass::Frequency(5, 1.0 / 500.0, rl::math::Vector::Zero(3)); + + for (std::string line; std::getline(data, line);) + { + std::istringstream stream(line); + + rl::math::Real time = 0; + stream >> time; + + rl::math::Vector measurement(3); + + for (std::size_t i = 0; i < measurement.size(); ++i) + { + stream >> measurement(i); + } + + rl::math::Vector estimation = lowPass(measurement); + + filtered << time; + + for (std::size_t i = 0; i < estimation.size(); ++i) + { + filtered << "\t" << estimation(i); + } + + filtered << std::endl; + } + + data.close(); + filtered.close(); + + return EXIT_SUCCESS; +} diff --git a/demos/rlGripperDemo/CMakeLists.txt b/demos/rlGripperDemo/CMakeLists.txt index ff8bd439..64bfdf55 100644 --- a/demos/rlGripperDemo/CMakeLists.txt +++ b/demos/rlGripperDemo/CMakeLists.txt @@ -1,12 +1,31 @@ -project(rlGripperDemo) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + find_package(Boost REQUIRED COMPONENTS thread) +endif() add_executable( rlGripperDemo rlGripperDemo.cpp ) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( + rlGripperDemo + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED + ) + + target_include_directories(rlGripperDemo PUBLIC ${Boost_INCLUDE_DIR}) +endif() + target_link_libraries( rlGripperDemo - rlhal - rlutil + hal + util ) + +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_link_libraries(rlGripperDemo ${Boost_LIBRARIES}) +endif() diff --git a/demos/rlGripperDemo/rlGripperDemo.cpp b/demos/rlGripperDemo/rlGripperDemo.cpp index 5ec3dfb9..c689c17d 100644 --- a/demos/rlGripperDemo/rlGripperDemo.cpp +++ b/demos/rlGripperDemo/rlGripperDemo.cpp @@ -25,37 +25,84 @@ // #include +#include #include +#include #include -#include + +bool running = true; + +void handler(int signum) +{ + running = false; +} int main(int argc, char** argv) { + signal(SIGINT, handler); + try { rl::hal::WeissWsg50 gripper; gripper.open(); - gripper.start(); - gripper.doSetAcceleration(0.2f); - gripper.doSetForceLimit(40.0f); - gripper.doPrePositionFingers(0.02f); - rl::util::Timer::sleep(1.0f); + std::chrono::steady_clock::time_point time = std::chrono::steady_clock::now(); + + do + { + time += std::chrono::duration_cast(gripper.getUpdateRate()); + std::this_thread::sleep_until(time); + gripper.start(); + } + while (!gripper.isRunning()); + + for (std::size_t i = 0; running; ++i) + { + time += std::chrono::duration_cast(gripper.getUpdateRate()); + std::this_thread::sleep_until(time); + + gripper.step(); + + std::cout << "openingWidth: " << gripper.getOpeningWidth() << std::endl; + std::cout << "force: " << gripper.getForce() << std::endl; + std::cout << "speed: " << gripper.getSpeed() << std::endl; + + rl::hal::WeissWsg50::SystemState systemState = gripper.getSystemState(); + + std::cout << "isReferenced: " << (rl::hal::WeissWsg50::SYSTEM_STATE_REFERENCED & systemState) << std::endl; + std::cout << "isMoving: " << (rl::hal::WeissWsg50::SYSTEM_STATE_MOVING & systemState) << std::endl; + std::cout << "isTargetPositionReached: " << (rl::hal::WeissWsg50::SYSTEM_STATE_TARGET_POSITION_REACHED & systemState) << std::endl; + + if (0 == i % 100) + { + if (gripper.getOpeningWidth() > 0.1f) + { + gripper.shut(); + } + else + { + gripper.release(); + } + } + } - gripper.doSetAcceleration(0.5f); - gripper.doSetForceLimit(20.0f); - gripper.doPrePositionFingers(0.1f, 0.4f); + do + { + time += std::chrono::duration_cast(gripper.getUpdateRate()); + std::this_thread::sleep_until(time); + gripper.stop(); + } + while (gripper.isRunning()); - gripper.stop(); gripper.close(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlInterpolatorDemo/CMakeLists.txt b/demos/rlInterpolatorDemo/CMakeLists.txt index 229a9a42..f195df4e 100644 --- a/demos/rlInterpolatorDemo/CMakeLists.txt +++ b/demos/rlInterpolatorDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlInterpolatorDemo) - add_executable( rlInterpolatorDemo rlInterpolatorDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlInterpolatorDemo - rlmath + math ) diff --git a/demos/rlInterpolatorDemo/rlInterpolatorDemo.cpp b/demos/rlInterpolatorDemo/rlInterpolatorDemo.cpp index ec8b4c3e..bc71a808 100644 --- a/demos/rlInterpolatorDemo/rlInterpolatorDemo.cpp +++ b/demos/rlInterpolatorDemo/rlInterpolatorDemo.cpp @@ -24,38 +24,250 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include #include -#include -#include +#include +#include +#include +#include + +#define FILE + +template +void eval(const T& f) +{ + T fd = f.derivative(); + T fdd = fd.derivative(); + T fddd = fdd.derivative(); + + std::size_t steps = 999; + +#ifdef FILE + // plot for [i=2:5] "interpolation.dat" using 1:i with lines + std::ofstream stream; + stream.open("interpolation.dat", std::fstream::trunc); +#else + std::ostream& stream = std::cout; +#endif + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = f.duration() * i / static_cast(steps - 1); + stream << t << "\t" << f(t) << "\t" << fd(t) << "\t" << fdd(t) << "\t" << fddd(t) << std::endl; + } + +#ifdef FILE + stream.close(); +#endif +} int main(int argc, char** argv) { -// rl::math::Cubic< rl::math::Real > interpolator; - rl::math::Quintic< rl::math::Real > interpolator; + { + rl::math::Polynomial f0 = rl::math::Polynomial::Linear(0, 1, 2); + rl::math::Polynomial f1 = rl::math::Polynomial::CubicFirst(1, 0, 0, 0, 2); + rl::math::Polynomial f2 = rl::math::Polynomial::QuinticFirstSecond(0, 1, 0, 0, 0, 0, 2); + eval(f0); + eval(f1); + eval(f2); + rl::math::Spline f3; + f3.push_back(f0); + f3.push_back(f1); + f3.push_back(f2); + eval(f3); + } - interpolator.te = 2.0f; + { + rl::math::Polynomial f0 = rl::math::Polynomial::Linear( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + 2 + ); + rl::math::Polynomial f1 = rl::math::Polynomial::CubicFirst( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + 2 + ); + rl::math::Polynomial f2 = rl::math::Polynomial::QuinticFirstSecond( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + 2 + ); + eval(f0); + eval(f1); + eval(f2); + } - interpolator.x0 = 0.0f; - interpolator.v0 = 0.0f; - interpolator.a0 = 0.0f; - interpolator.xe = 1.0f; - interpolator.ve = 0.0f; - interpolator.ae = 0.0f; + { + rl::math::Polynomial f0 = rl::math::Polynomial::Linear( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + 2 + ); + rl::math::Polynomial f1 = rl::math::Polynomial::CubicFirst( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 0), + 2 + ); + rl::math::Polynomial f2 = rl::math::Polynomial::QuinticFirstSecond( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 0), + 2 + ); + eval(f0); + eval(f1); + eval(f2); + } - interpolator.interpolate(); + { + rl::math::Polynomial f0 = rl::math::Polynomial::CubicFirst(0, 1, 0, 0, 1); + rl::math::Polynomial f1 = rl::math::Polynomial::CubicFirst(1, -1, 0, 0, 2); + rl::math::Polynomial f2 = rl::math::Polynomial::CubicFirst(-1, 0, 0, 0, 1.5); + rl::math::Spline f; + f.push_back(f0); + f.push_back(f1); + f.push_back(f2); + eval(f); + } + + { + rl::math::Polynomial f0 = rl::math::Polynomial::Linear( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + 2 + ); + rl::math::Polynomial f1 = rl::math::Polynomial::CubicFirst( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + 2 + ); + rl::math::Polynomial f2 = rl::math::Polynomial::QuinticFirstSecond( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 0), + 2 + ); + rl::math::Spline f; + f.push_back(f0); + f.push_back(f1); + f.push_back(f2); + eval(f); + } + + { + ::std::vector x; + x.push_back(0); + x.push_back(1); + x.push_back(3); + x.push_back(3.5); + x.push_back(6); + x.push_back(7); + ::std::vector y; + y.push_back(0); + y.push_back(1); + y.push_back(-1); + y.push_back(3); + y.push_back(3); + y.push_back(-2); + rl::math::Spline f2 = rl::math::Spline::LinearParabolic(x, y, 0.25f); + eval(f2); + rl::math::Spline f3 = rl::math::Spline::LinearQuartic(x, y, 0.25f); + eval(f3); + rl::math::Spline f4 = rl::math::Spline::LinearSextic(x, y, 0.25f); + eval(f4); + } + + { + ::std::vector x; + x.push_back(0); + x.push_back(1); + x.push_back(3); + x.push_back(3.5); + x.push_back(6); + x.push_back(7); + ::std::vector y; + y.push_back(rl::math::ArrayX::Constant(1, 0)); + y.push_back(rl::math::ArrayX::Constant(1, 1)); + y.push_back(rl::math::ArrayX::Constant(1, -1)); + y.push_back(rl::math::ArrayX::Constant(1, 3)); + y.push_back(rl::math::ArrayX::Constant(1, 3)); + y.push_back(rl::math::ArrayX::Constant(1, -2)); + rl::math::Spline f3 = rl::math::Spline::LinearQuartic(x, y, 0.25f); + eval(f3); + rl::math::Spline f4 = rl::math::Spline::LinearSextic(x, y, 0.25f); + eval(f4); + } + + { + rl::math::Spline f0 = rl::math::Spline::QuarticLinearQuarticAtRest( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1) + ); + eval(f0); + rl::math::Spline f1 = rl::math::Spline::QuarticLinearQuarticAtRest( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1) + ); + eval(f1); + } + + { + rl::math::Spline f0 = rl::math::Spline::SexticLinearSexticAtRest( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1) + ); + eval(f0); + rl::math::Spline f1 = rl::math::Spline::SexticLinearSexticAtRest( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1) + ); + eval(f1); + } - for (std::size_t i = 0; i <= 100; ++i) { - std::cout << i * interpolator.te / 100.0f; - std::cout << "\t"; - std::cout << interpolator.x(i * interpolator.te / 100.0f); - std::cout << "\t"; - std::cout << interpolator.v(i * interpolator.te / 100.0f); - std::cout << "\t"; - std::cout << interpolator.a(i * interpolator.te / 100.0f); - std::cout << std::endl; + rl::math::Spline f0 = rl::math::Spline::TrapeziodalAccelerationAtRest( + rl::math::Vector::Constant(1, 0), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1), + rl::math::Vector::Constant(1, 1) + ); + eval(f0); + rl::math::Spline f1 = rl::math::Spline::TrapeziodalAccelerationAtRest( + rl::math::ArrayX::Constant(1, 0), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1), + rl::math::ArrayX::Constant(1, 1) + ); + eval(f1); } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlInversePositionDemo/CMakeLists.txt b/demos/rlInversePositionDemo/CMakeLists.txt index 3e64b6fb..36063c5b 100644 --- a/demos/rlInversePositionDemo/CMakeLists.txt +++ b/demos/rlInversePositionDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlInversePositionDemo) - find_package(Boost REQUIRED) add_executable( @@ -7,6 +5,17 @@ add_executable( rlInversePositionDemo.cpp ) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( + rlInversePositionDemo + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED + ) +endif() + target_include_directories( rlInversePositionDemo PUBLIC @@ -15,7 +24,7 @@ target_include_directories( target_link_libraries( rlInversePositionDemo - rlhal - rlmdl - rlutil + hal + mdl + util ) diff --git a/demos/rlInversePositionDemo/rlInversePositionDemo.cpp b/demos/rlInversePositionDemo/rlInversePositionDemo.cpp index 25180638..bce49821 100644 --- a/demos/rlInversePositionDemo/rlInversePositionDemo.cpp +++ b/demos/rlInversePositionDemo/rlInversePositionDemo.cpp @@ -24,15 +24,23 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include +#include #include +#include +#include #include #include -#include #include +#include #include +#include #include #include -#include + +#ifdef RL_MDL_NLOPT +#include +#endif #define COACH @@ -42,23 +50,37 @@ main(int argc, char** argv) if (argc < 2) { std::cout << "Usage: rlInversePositionDemo MODELFILE Q1 ... Qn" << std::endl; - return 1; + return EXIT_FAILURE; } try { - srand(static_cast< unsigned int >(rl::util::Timer::now() * 1.0e9f)); + std::function rand = std::bind( + std::uniform_real_distribution(0, 1), + std::mt19937(std::random_device()()) + ); - rl::mdl::XmlFactory factory; - boost::shared_ptr< rl::mdl::Model > model(factory.create(argv[1])); + std::string filename(argv[1]); + std::shared_ptr model; - rl::mdl::Kinematic* kinematic = dynamic_cast< rl::mdl::Kinematic* >(model.get()); + if ("urdf" == filename.substr(filename.length() - 4, 4)) + { + rl::mdl::UrdfFactory factory; + model.reset(factory.create(filename)); + } + else + { + rl::mdl::XmlFactory factory; + model.reset(factory.create(filename)); + } + + rl::mdl::Kinematic* kinematic = dynamic_cast(model.get()); rl::math::Vector q(kinematic->getDof()); for (std::ptrdiff_t i = 0; i < q.size(); ++i) { - q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]); + q(i) = boost::lexical_cast(argv[i + 2]); } kinematic->setPosition(q); @@ -68,27 +90,44 @@ main(int argc, char** argv) rl::math::Vector3 orientation = kinematic->getOperationalPosition(0).rotation().eulerAngles(2, 1, 0).reverse(); std::cout << "x: " << position.x() << " m, y: " << position.y() << " m, z: " << position.z() << " m, a: " << orientation.x() * rl::math::RAD2DEG << " deg, b: " << orientation.y() * rl::math::RAD2DEG << " deg, c: " << orientation.z() * rl::math::RAD2DEG << " deg" << std::endl; - rl::math::Transform x = kinematic->getOperationalPosition(0); - kinematic->setPosition(rl::math::Vector::Random(kinematic->getDof())); - rl::util::Timer timer; - timer.start(); - bool result = kinematic->calculateInversePosition(x); - timer.stop(); - std::cout << (result ? "true" : "false") << " " << timer.elapsed() * 1000 << " ms" << std::endl; +#ifdef RL_MDL_NLOPT + rl::mdl::NloptInverseKinematics ik(kinematic); + std::cout << "IK using rl::mdl::NloptInverseKinematics"; +#else + rl::mdl::JacobianInverseKinematics ik(kinematic); + std::cout << "IK using rl::mdl::JacobianInverseKinematics"; +#endif + ik.duration = std::chrono::seconds(1); + std::cout << " with timeout of " << std::chrono::duration_cast(ik.duration).count() << " ms" << std::endl; + ik.goals.push_back(::std::make_pair(kinematic->getOperationalPosition(0), 0)); + + rl::math::Vector min = kinematic->getMinimum(); + rl::math::Vector max = kinematic->getMaximum(); + + for (std::size_t i = 0; i < kinematic->getDofPosition(); ++i) + { + q(i) = min(i) + rand() * (max(i) - min(i)); + } + + kinematic->setPosition(q); + + std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); + bool result = ik.solve(); + std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now(); + std::cout << (result ? "true" : "false") << " " << std::chrono::duration_cast>(stop - start).count() * 1000 << " ms" << std::endl; kinematic->forwardPosition(); position = kinematic->getOperationalPosition(0).translation(); orientation = kinematic->getOperationalPosition(0).rotation().eulerAngles(2, 1, 0).reverse(); std::cout << "x: " << position.x() << " m, y: " << position.y() << " m, z: " << position.z() << " m, a: " << orientation.x() * rl::math::RAD2DEG << " deg, b: " << orientation.y() * rl::math::RAD2DEG << " deg, c: " << orientation.z() * rl::math::RAD2DEG << " deg" << std::endl; - kinematic->getPosition(q); - std::cout << "q: " << q.transpose() << std::endl; + std::cout << "q: " << kinematic->getPosition().transpose() << std::endl; #ifdef COACH - rl::hal::Coach controller(kinematic->getDof(), 0.001f, 0, "localhost"); + rl::hal::Coach controller(kinematic->getDof(), std::chrono::milliseconds(1), 0, "localhost"); controller.open(); controller.start(); - controller.setJointPosition(q); + controller.setJointPosition(kinematic->getPosition()); controller.step(); controller.stop(); controller.close(); @@ -97,8 +136,8 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlJacobianDemo/CMakeLists.txt b/demos/rlJacobianDemo/CMakeLists.txt index f47a28e8..0a28f443 100644 --- a/demos/rlJacobianDemo/CMakeLists.txt +++ b/demos/rlJacobianDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlJacobianDemo) - find_package(Boost REQUIRED) add_executable( @@ -15,5 +13,5 @@ target_include_directories( target_link_libraries( rlJacobianDemo - rlkin + kin ) diff --git a/demos/rlJacobianDemo/rlJacobianDemo.cpp b/demos/rlJacobianDemo/rlJacobianDemo.cpp index 7221bd89..21715aae 100644 --- a/demos/rlJacobianDemo/rlJacobianDemo.cpp +++ b/demos/rlJacobianDemo/rlJacobianDemo.cpp @@ -25,9 +25,9 @@ // #include +#include #include #include -#include #include #include @@ -37,25 +37,25 @@ main(int argc, char** argv) if (argc < 2) { std::cout << "Usage: rlJacobianDemo KINEMATICSFILE Q1 ... Qn QD1 ... QDn" << std::endl; - return 1; + return EXIT_FAILURE; } try { - boost::shared_ptr< rl::kin::Kinematics > kinematics(rl::kin::Kinematics::create(argv[1])); + std::shared_ptr kinematics(rl::kin::Kinematics::create(argv[1])); rl::math::Vector q(kinematics->getDof()); for (std::ptrdiff_t i = 0; i < q.size(); ++i) { - q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]); + q(i) = boost::lexical_cast(argv[i + 2]); } rl::math::Vector qdot(kinematics->getDof()); for (std::ptrdiff_t i = 0; i < qdot.size(); ++i) { - qdot(i) = boost::lexical_cast< rl::math::Real >(argv[q.size() + i + 2]); + qdot(i) = boost::lexical_cast(argv[q.size() + i + 2]); } kinematics->setPosition(q); @@ -86,8 +86,8 @@ main(int argc, char** argv) catch (const std::exception& e) { std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlKalmanDemo/CMakeLists.txt b/demos/rlKalmanDemo/CMakeLists.txt deleted file mode 100644 index 90c5dbe8..00000000 --- a/demos/rlKalmanDemo/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(rlKalmanDemo) - -add_executable( - rlKalmanDemo - rlKalmanDemo.cpp -) - -target_link_libraries( - rlKalmanDemo - rlmath -) diff --git a/demos/rlKalmanDemo/rlKalmanDemo.cpp b/demos/rlKalmanDemo/rlKalmanDemo.cpp deleted file mode 100644 index 93b26bbf..00000000 --- a/demos/rlKalmanDemo/rlKalmanDemo.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// -// Copyright (c) 2009, Markus Rickert -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// - -#include -#include -#include -#include - -int -main(int argc, char** argv) -{ - std::size_t t = 20; - - std::size_t ss = 4; - std::size_t os = 2; - - rl::math::Matrix a(ss, ss); - a.setIdentity(); -// rl::math::Matrix b(ss, ss); -// b.setZero(); - std::vector< rl::math::Matrix > p(t + 1, rl::math::Matrix(ss, ss)); - p[0].setIdentity(); - rl::math::Matrix q(ss, ss); - q.setIdentity(); -// rl::math::Vector u(ss); -// u.setZero(); - - rl::math::Matrix h(os, ss); - h.setIdentity(); - rl::math::Matrix r(os, os); - r.setIdentity(); - - std::vector< rl::math::Vector > x(t + 1, rl::math::Vector(ss)); - x[0].setZero(); - std::vector< rl::math::Vector > z(t, rl::math::Vector(os)); - z[0].setZero(); - - a(0, 2) = 1; - a(1, 3) = 1; - p[0] *= 1.0e-12f; - q *= 0.01f; - r *= 0.01f; - - for (std::size_t i = 0; i < t; ++i) - { - x[i](0) = static_cast< rl::math::Real >(i) + 1; - x[i](1) = static_cast< rl::math::Real >(i) + 1; - - if (i > 0) - { - x[i](2) = x[i](0) - x[i - 1](0); - x[i](3) = x[i](1) - x[i - 1](1); - } - else - { - x[i](2) = 0; - x[i](3) = 0; - } - - z[i](0) = x[i](0); - z[i](1) = x[i](1); - } - - for (std::size_t i = 0; i < t; ++i) std::cout << "x[" << i << "] = " << x[i].transpose() << std::endl; - for (std::size_t i = 0; i < t; ++i) std::cout << "z[" << i << "] = " << z[i].transpose() << std::endl; - - for (std::size_t i = 0; i < t; ++i) - { - if (i > 0) - { - rl::math::Kalman::predict(x[i - 1], p[i - 1], a, q, x[i], p[i]); - } - - rl::math::Kalman::correct(x[i], p[i], h, r, z[i], x[i], p[i]); - } - - rl::math::Kalman::predict(x[t - 1], p[t - 1], a, q, x[t], p[t]); - - for (std::size_t i = 0; i < t + 1; ++i) std::cout << "x[" << i << "] = " << x[i].transpose() << std::endl; - for (std::size_t i = 0; i < t + 1; ++i) std::cout << "p[" << i << "] = " << std::endl << p[i] << std::endl; - - return 0; -} diff --git a/demos/rlLaserDemo/CMakeLists.txt b/demos/rlLaserDemo/CMakeLists.txt index 1a52b34f..9a476328 100644 --- a/demos/rlLaserDemo/CMakeLists.txt +++ b/demos/rlLaserDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlLaserDemo) - add_executable( rlLaserDemo rlLaserDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlLaserDemo - rlhal + hal ) diff --git a/demos/rlLaserDemo/rlLaserDemo.cpp b/demos/rlLaserDemo/rlLaserDemo.cpp index 7b9951ea..e701ab37 100644 --- a/demos/rlLaserDemo/rlLaserDemo.cpp +++ b/demos/rlLaserDemo/rlLaserDemo.cpp @@ -73,10 +73,10 @@ main(int argc, char** argv) FILE* gnuplot = popen(GNUPLOT, "w"); - if (NULL == gnuplot) + if (nullptr == gnuplot) { std::cerr << "cannot open " << GNUPLOT << std::endl; - return 1; + return EXIT_FAILURE; } try @@ -116,20 +116,16 @@ main(int argc, char** argv) laser.start(); - rl::math::Vector data(laser.getDistancesCount()); - rl::math::Real resolution = laser.getResolution(); - rl::math::Real startAngle = laser.getStartAngle(); - while (running) { laser.step(); - laser.getDistances(data); + rl::math::Vector data = laser.getDistances(); fprintf(gnuplot, "plot '-' with lines\n"); for (std::ptrdiff_t i = 0; i < data.size(); ++i) { - fprintf(gnuplot, "%f %f\n", startAngle + resolution * i, data(i)); + fprintf(gnuplot, "%f %f\n", laser.getStartAngle() + laser.getResolution() * i, data(i)); } fprintf(gnuplot, "e\n"); @@ -145,8 +141,8 @@ main(int argc, char** argv) { pclose(gnuplot); std::cerr << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlLoadXmlDemo/CMakeLists.txt b/demos/rlLoadXmlDemo/CMakeLists.txt index 21d313ea..9cf35b5d 100644 --- a/demos/rlLoadXmlDemo/CMakeLists.txt +++ b/demos/rlLoadXmlDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlLoadXmlDemo) - add_executable( rlLoadXmlDemo rlLoadXmlDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlLoadXmlDemo - rlxml + xml ) diff --git a/demos/rlLoadXmlDemo/rlLoadXmlDemo.cpp b/demos/rlLoadXmlDemo/rlLoadXmlDemo.cpp index aa82aa88..98875506 100644 --- a/demos/rlLoadXmlDemo/rlLoadXmlDemo.cpp +++ b/demos/rlLoadXmlDemo/rlLoadXmlDemo.cpp @@ -27,20 +27,42 @@ #include #include #include +#include int main(int argc, char** argv) { if (argc < 2) { - std::cout << "Usage: rlLoadXmlDemo XMLFILE" << std::endl; - return 1; + std::cout << "Usage: rlLoadXmlDemo XMLFILE [PARAM1 VALUE1 ... PARAMN VALUEN]" << std::endl; + return EXIT_FAILURE; } rl::xml::DomParser parser; - rl::xml::Document doc = parser.readFile(argv[1], "", XML_PARSE_NOENT | XML_PARSE_XINCLUDE); - doc.substitute(XML_PARSE_NOENT | XML_PARSE_XINCLUDE); - doc.save("-"); + rl::xml::Document document = parser.readFile(argv[1], "", XML_PARSE_NOENT | XML_PARSE_XINCLUDE); + document.substitute(XML_PARSE_NOENT | XML_PARSE_XINCLUDE); - return 0; + if ("stylesheet" == document.getRootElement().getName() || "transform" == document.getRootElement().getName()) + { + if ("1.0" == document.getRootElement().getProperty("version")) + { + if (document.getRootElement().hasNamespace() && "http://www.w3.org/1999/XSL/Transform" == document.getRootElement().getNamespace().getHref()) + { + ::std::map< ::std::string, ::std::string> parameters; + + for (int i = 2; i < argc - 1; i += 2) + { + parameters[argv[i]] = argv[i + 1]; + std::cout << "param['" << argv[i] << "'] = '" << argv[i + 1] << "'" << std::endl; + } + + rl::xml::Stylesheet stylesheet(document); + document = stylesheet.apply(parameters); + } + } + } + + document.save("-"); + + return EXIT_SUCCESS; } diff --git a/demos/rlPcaDemo/CMakeLists.txt b/demos/rlPcaDemo/CMakeLists.txt index 5f51207a..c09bcf7d 100644 --- a/demos/rlPcaDemo/CMakeLists.txt +++ b/demos/rlPcaDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlPcaDemo) - add_executable( rlPcaDemo rlPcaDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlPcaDemo - rlmath + math ) diff --git a/demos/rlPcaDemo/rlPcaDemo.cpp b/demos/rlPcaDemo/rlPcaDemo.cpp index 8c274a60..cceab501 100644 --- a/demos/rlPcaDemo/rlPcaDemo.cpp +++ b/demos/rlPcaDemo/rlPcaDemo.cpp @@ -36,7 +36,7 @@ main(int argc, char** argv) if (argc < 2) { std::cout << "Usage: rlPcaDemo FILE" << std::endl; - return 1; + return EXIT_FAILURE; } std::ifstream data; @@ -69,7 +69,7 @@ main(int argc, char** argv) mean += src.row(i); } - mean /= static_cast< rl::math::Real >(rows); + mean /= static_cast(rows); std::cout << "mean = " << mean.transpose() << std::endl; @@ -82,14 +82,14 @@ main(int argc, char** argv) covariance += delta * delta.transpose(); } - covariance /= static_cast< rl::math::Real >(rows) - 1; + covariance /= static_cast(rows) - 1; std::cout << "covariance = " << std::endl << covariance << std::endl; - Eigen::EigenSolver< rl::math::Matrix > eigen(covariance); + Eigen::EigenSolver eigen(covariance); std::cout << "eigenvectors = " << std::endl << eigen.eigenvectors() << std::endl; std::cout << "eigenvalues = " << std::endl << eigen.eigenvalues() << std::endl; - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlPlanDemo/CMakeLists.txt b/demos/rlPlanDemo/CMakeLists.txt index 2545c87d..2728638b 100644 --- a/demos/rlPlanDemo/CMakeLists.txt +++ b/demos/rlPlanDemo/CMakeLists.txt @@ -1,25 +1,43 @@ -project(rlPlanDemo) - find_package(Boost REQUIRED) find_package(OpenGL REQUIRED) -find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) -include(${QT_USE_FILE}) +find_package(SoQt) + +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui OpenGL PrintSupport Widgets QUIET) +endif() + +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Bullet) -find_package(Ode) -find_package(Pqp) -find_package(Solid) -find_package(SoQt) +find_package(ccd) +find_package(FCL) +find_package(ODE) +find_package(PQP) +find_package(SOLID3) -if(QT_FOUND AND SOQT_FOUND AND (BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_FOUND)) +if(QT_FOUND AND SoQt_FOUND AND (Bullet_FOUND OR (CCD_FOUND AND FCL_FOUND) OR ODE_FOUND OR PQP_FOUND OR SOLID3_FOUND)) set( HDRS ConfigurationDelegate.h ConfigurationModel.h + ConfigurationSpaceModel.h ConfigurationSpaceScene.h ConfigurationSpaceThread.h + GraphicsView.h MainWindow.h PlannerModel.h + SoGradientBackground.h Thread.h Viewer.h ) @@ -28,67 +46,64 @@ if(QT_FOUND AND SOQT_FOUND AND (BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_ SRCS ConfigurationDelegate.cpp ConfigurationModel.cpp + ConfigurationSpaceModel.cpp ConfigurationSpaceScene.cpp ConfigurationSpaceThread.cpp + GraphicsView.cpp MainWindow.cpp PlannerModel.cpp rlPlanDemo.cpp + SoGradientBackground.cpp Thread.cpp Viewer.cpp ${rl_SOURCE_DIR}/robotics-library.rc ) - qt4_wrap_cpp( - MOC_SRCS - ConfigurationDelegate.h - ConfigurationSpaceScene.h - ConfigurationSpaceThread.h - MainWindow.h - Thread.h - Viewer.h - OPTIONS - -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED - ) - add_executable( rlPlanDemo + WIN32 ${HDRS} ${SRCS} - ${MOC_SRCS} ) target_compile_definitions( rlPlanDemo PUBLIC - ${QT_DEFINITIONS} - ${SOQT_DEFINITIONS} + ${SoQt_DEFINITIONS} ) target_include_directories( rlPlanDemo PUBLIC + ${Boost_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} - ${QT_INCLUDES} - ${SOQT_INCLUDE_DIRS} + ${SoQt_INCLUDE_DIRS} ) target_link_libraries( rlPlanDemo - rlplan - rlkin - rlsg + plan + kin + sg ${OPENGL_LIBRARIES} ${QT_LIBRARIES} - ${SOQT_LIBRARIES} + ${SoQt_LIBRARIES} ) set_target_properties( rlPlanDemo PROPERTIES VERSION ${VERSION} - DEBUG_POSTFIX d ) + if(WIN32) + set_target_properties( + rlPlanDemo + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + install( TARGETS rlPlanDemo COMPONENT demos @@ -97,50 +112,41 @@ if(QT_FOUND AND SOQT_FOUND AND (BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + if(UNIX) - install(FILES rlPlanDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) - endif(UNIX) + configure_file(rlPlanDemo.desktop.in rlPlanDemo.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlPlanDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} "CreateShortCut \\\\ \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlPlanDemo.lnk\\\" \\\\ \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlPlanDemo.exe\\\" \\\\ \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlplan\\\\unimation-puma560_boxes_rrtConCon.xml\\\$\\\\\\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlplan\\\\unimation-puma560_boxes_rrtConCon.xml\\\$\\\\\\\"\\\\ \\\" \\\\ \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ \\\"Path planning demo with Unimation Puma 560 and RRT algorithm\\\"" + PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlPlanDemo.lnk\\\"") - - set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} - "CreateShortCut \\\\ - \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlPlanDemo2.lnk\\\" \\\\ - \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlPlanDemo.exe\\\" \\\\ - \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlplan\\\\staeubli-tx60l_wall_rrtConCon.xml\\\$\\\\\\\"\\\\ - \\\" \\\\ - \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ - \\\"Path planning demo with Staeubli TX-60L and RRT algorithm\\\"" - ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlPlanDemo2.lnk\\\"") + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlPlanDemo.lnk\\\"" PARENT_SCOPE) set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} - "CreateShortCut \\\\ - \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlPlanDemo3.lnk\\\" \\\\ - \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlPlanDemo.exe\\\" \\\\ - \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlplan\\\\mitsubishi-rv6sl_boxes_rrtConCon.xml\\\$\\\\\\\"\\\\ - \\\" \\\\ - \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ - \\\"Path planning demo with Mitsubishi RV-6SL and RRT algorithm\\\"" + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlPlanDemo3.lnk\\\"" PARENT_SCOPE) -endif(QT_FOUND AND SOQT_FOUND AND (BULLET_FOUND OR ODE_FOUND OR PQP_FOUND OR SOLID_FOUND)) +endif() diff --git a/demos/rlPlanDemo/ConfigurationDelegate.cpp b/demos/rlPlanDemo/ConfigurationDelegate.cpp index e79a8aee..df5bfa95 100644 --- a/demos/rlPlanDemo/ConfigurationDelegate.cpp +++ b/demos/rlPlanDemo/ConfigurationDelegate.cpp @@ -44,24 +44,23 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& { QDoubleSpinBox* editor = new QDoubleSpinBox(parent); - rl::math::Vector maximum(MainWindow::instance()->model->getDof()); - MainWindow::instance()->model->getMaximum(maximum); - rl::math::Vector minimum(MainWindow::instance()->model->getDof()); - MainWindow::instance()->model->getMinimum(minimum); - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->model->getDof()); - MainWindow::instance()->model->getPositionUnits(qUnits); + rl::math::Vector maximum = MainWindow::instance()->model->getMaximum(); + rl::math::Vector minimum = MainWindow::instance()->model->getMinimum(); + Eigen::Matrix qUnits = MainWindow::instance()->model->getPositionUnits(); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { + editor->setDecimals(2); editor->setMinimum(minimum(index.row()) * rl::math::RAD2DEG); editor->setMaximum(maximum(index.row()) * rl::math::RAD2DEG); editor->setSingleStep(1.0f); } else { + editor->setDecimals(4); editor->setMinimum(minimum(index.row())); editor->setMaximum(maximum(index.row())); - editor->setSingleStep(0.1f); + editor->setSingleStep(0.01f); } QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); @@ -72,14 +71,14 @@ ConfigurationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& void ConfigurationDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); - doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::EditRole).toDouble()); } void ConfigurationDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const { - QDoubleSpinBox* doubleSpinBox = static_cast< QDoubleSpinBox* >(editor); + QDoubleSpinBox* doubleSpinBox = static_cast(editor); doubleSpinBox->interpretText(); model->setData(index, doubleSpinBox->value(), Qt::EditRole); } @@ -93,5 +92,5 @@ ConfigurationDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionV void ConfigurationDelegate::valueChanged(double d) { - emit commitData(static_cast< QWidget* >(QObject::sender())); + emit commitData(static_cast(QObject::sender())); } diff --git a/demos/rlPlanDemo/ConfigurationDelegate.h b/demos/rlPlanDemo/ConfigurationDelegate.h index bf656041..6f57063c 100644 --- a/demos/rlPlanDemo/ConfigurationDelegate.h +++ b/demos/rlPlanDemo/ConfigurationDelegate.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONDELEGATE_H_ -#define _CONFIGURATIONDELEGATE_H_ +#ifndef CONFIGURATIONDELEGATE_H +#define CONFIGURATIONDELEGATE_H #include @@ -34,16 +34,16 @@ class ConfigurationDelegate : public QItemDelegate Q_OBJECT public: - ConfigurationDelegate(QObject* parent = NULL); + ConfigurationDelegate(QObject* parent = nullptr); virtual ~ConfigurationDelegate(); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; - + void setEditorData(QWidget* editor, const QModelIndex& index) const; - + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; - + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; public slots: @@ -55,4 +55,4 @@ public slots: }; -#endif // _CONFIGURATIONDELEGATE_H_ +#endif // CONFIGURATIONDELEGATE_H diff --git a/demos/rlPlanDemo/ConfigurationModel.cpp b/demos/rlPlanDemo/ConfigurationModel.cpp index dcb661a6..f67f0216 100644 --- a/demos/rlPlanDemo/ConfigurationModel.cpp +++ b/demos/rlPlanDemo/ConfigurationModel.cpp @@ -47,7 +47,7 @@ ConfigurationModel::columnCount(const QModelIndex& parent) const QVariant ConfigurationModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->model) + if (nullptr == MainWindow::instance()->model) { return QVariant(); } @@ -62,8 +62,7 @@ ConfigurationModel::data(const QModelIndex& index, int role) const case Qt::DisplayRole: case Qt::EditRole: { - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->model->getDof()); - MainWindow::instance()->model->getPositionUnits(qUnits); + Eigen::Matrix qUnits = MainWindow::instance()->model->getPositionUnits(); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { @@ -75,7 +74,7 @@ ConfigurationModel::data(const QModelIndex& index, int role) const } } case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -109,24 +108,25 @@ ConfigurationModel::headerData(int section, Qt::Orientation orientation, int rol void ConfigurationModel::invalidate() { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } int ConfigurationModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->model) + if (nullptr == MainWindow::instance()->model) { return 0; } - return MainWindow::instance()->model->getDof(); + return MainWindow::instance()->model->getDofPosition(); } bool ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->model) + if (nullptr == MainWindow::instance()->model) { return false; } @@ -138,16 +138,15 @@ ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int if (index.isValid() && Qt::EditRole == role) { - Eigen::Matrix< rl::math::Unit, Eigen::Dynamic, 1 > qUnits(MainWindow::instance()->model->getDof()); - MainWindow::instance()->model->getPositionUnits(qUnits); + Eigen::Matrix qUnits = MainWindow::instance()->model->getPositionUnits(); if (rl::math::UNIT_RADIAN == qUnits(index.row())) { - (*MainWindow::instance()->q)(index.row()) = value.value< ::rl::math::Real >() * rl::math::DEG2RAD; + (*MainWindow::instance()->q)(index.row()) = value.value() * rl::math::DEG2RAD; } else { - (*MainWindow::instance()->q)(index.row()) = value.value< ::rl::math::Real >(); + (*MainWindow::instance()->q)(index.row()) = value.value(); } MainWindow::instance()->viewer->drawConfiguration(*MainWindow::instance()->q); diff --git a/demos/rlPlanDemo/ConfigurationModel.h b/demos/rlPlanDemo/ConfigurationModel.h index 49651d92..cba8a4e4 100644 --- a/demos/rlPlanDemo/ConfigurationModel.h +++ b/demos/rlPlanDemo/ConfigurationModel.h @@ -24,15 +24,15 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONMODEL_H_ -#define _CONFIGURATIONMODEL_H_ +#ifndef CONFIGURATIONMODEL_H +#define CONFIGURATIONMODEL_H #include class ConfigurationModel : public QAbstractTableModel { public: - ConfigurationModel(QObject* parent = NULL); + ConfigurationModel(QObject* parent = nullptr); virtual ~ConfigurationModel(); @@ -56,4 +56,4 @@ class ConfigurationModel : public QAbstractTableModel }; -#endif // _CONFIGURATIONMODEL_H_ +#endif // CONFIGURATIONMODEL_H diff --git a/demos/rlPlanDemo/ConfigurationSpaceModel.cpp b/demos/rlPlanDemo/ConfigurationSpaceModel.cpp new file mode 100644 index 00000000..e33ff5a8 --- /dev/null +++ b/demos/rlPlanDemo/ConfigurationSpaceModel.cpp @@ -0,0 +1,245 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "ConfigurationSpaceModel.h" +#include "ConfigurationSpaceScene.h" +#include "MainWindow.h" +#include "Thread.h" +#include "Viewer.h" + +ConfigurationSpaceModel::ConfigurationSpaceModel(QObject* parent) : + QAbstractTableModel(parent), + configurationSpaceScene(nullptr) +{ +} + +ConfigurationSpaceModel::~ConfigurationSpaceModel() +{ +} + +int +ConfigurationSpaceModel::columnCount(const QModelIndex& parent) const +{ + return 1; +} + +QVariant +ConfigurationSpaceModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == this->configurationSpaceScene) + { + return QVariant(); + } + + if (nullptr == this->configurationSpaceScene->model) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + switch (index.row()) + { + case 0: + return static_cast(this->configurationSpaceScene->axis0); + break; + case 1: + return static_cast(this->configurationSpaceScene->axis1); + break; + case 2: + return this->configurationSpaceScene->delta0; + break; + case 3: + return this->configurationSpaceScene->delta1; + break; + default: + break; + } + + break; + case Qt::TextAlignmentRole: + return QVariant(Qt::AlignRight | Qt::AlignVCenter); + break; + default: + break; + } + + return QVariant(); +} + +Qt::ItemFlags +ConfigurationSpaceModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + { + return Qt::NoItemFlags; + } + + return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; +} + +QVariant +ConfigurationSpaceModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (nullptr == this->configurationSpaceScene) + { + return QVariant(); + } + + if (nullptr == this->configurationSpaceScene->model) + { + return QVariant(); + } + + if (Qt::DisplayRole == role && Qt::Vertical == orientation) + { + switch (section) + { + case 0: + return "axis0"; + break; + case 1: + return "axis1"; + break; + case 2: + return "delta0"; + break; + case 3: + return "delta1"; + break; + default: + break; + } + } + + return QVariant(); +} + +void +ConfigurationSpaceModel::invalidate() +{ + this->beginResetModel(); + this->endResetModel(); +} + +int +ConfigurationSpaceModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == this->configurationSpaceScene) + { + return 0; + } + + + if (nullptr == this->configurationSpaceScene->model) + { + return 0; + } + return 4; +} + +bool +ConfigurationSpaceModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + if (nullptr == this->configurationSpaceScene) + { + return false; + } + + if (nullptr == this->configurationSpaceScene->model) + { + return false; + } + + if (MainWindow::instance()->thread->isRunning()) + { + return false; + } + + if (index.isValid() && Qt::EditRole == role) + { + switch (index.row()) + { + case 0: + if (value.value() < this->configurationSpaceScene->model->getDofPosition()) + { + this->configurationSpaceScene->axis0 = value.value(); + } + else + { + return false; + } + break; + case 1: + if (value.value() < this->configurationSpaceScene->model->getDofPosition()) + { + this->configurationSpaceScene->axis1 = value.value(); + } + else + { + return false; + } + break; + case 2: + if (value.value() > 0) + { + this->configurationSpaceScene->delta0 = value.value(); + } + else + { + return false; + } + break; + case 3: + if (value.value() > 0) + { + this->configurationSpaceScene->delta1 = value.value(); + } + else + { + return false; + } + break; + default: + break; + } + + this->configurationSpaceScene->init(); + + emit dataChanged(index, index); + + return true; + } + + return false; +} diff --git a/demos/rlPlanDemo/ConfigurationSpaceModel.h b/demos/rlPlanDemo/ConfigurationSpaceModel.h new file mode 100644 index 00000000..9cae8ce3 --- /dev/null +++ b/demos/rlPlanDemo/ConfigurationSpaceModel.h @@ -0,0 +1,63 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef CONFIGURATIONSPACEMODEL_H +#define CONFIGURATIONSPACEMODEL_H + +#include + +class ConfigurationSpaceScene; + +class ConfigurationSpaceModel : public QAbstractTableModel +{ +public: + ConfigurationSpaceModel(QObject* parent = nullptr); + + virtual ~ConfigurationSpaceModel(); + + int columnCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + + void invalidate(); + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + + ConfigurationSpaceScene* configurationSpaceScene; + +protected: + +private: + +}; + +#endif // CONFIGURATIONSPACEMODEL_H diff --git a/demos/rlPlanDemo/ConfigurationSpaceScene.cpp b/demos/rlPlanDemo/ConfigurationSpaceScene.cpp index 064c56e1..1b1fe279 100644 --- a/demos/rlPlanDemo/ConfigurationSpaceScene.cpp +++ b/demos/rlPlanDemo/ConfigurationSpaceScene.cpp @@ -36,12 +36,14 @@ ConfigurationSpaceScene::ConfigurationSpaceScene(QObject* parent) : QGraphicsScene(parent), - delta(1.0f), - model(NULL), - x(0), - y(1), + axis0(0), + axis1(1), + delta0(1.0f), + delta1(1.0f), + model(nullptr), edges(), path(), + scene(nullptr), thread(new ConfigurationSpaceThread(this)) { QObject::connect( @@ -50,6 +52,8 @@ ConfigurationSpaceScene::ConfigurationSpaceScene(QObject* parent) : this, SLOT(addCollision(const qreal&, const qreal&, const qreal&, const qreal&, const int&)) ); + + QObject::connect(this->thread, SIGNAL(finished()), this, SIGNAL(evalFinished())); } ConfigurationSpaceScene::~ConfigurationSpaceScene() @@ -69,6 +73,7 @@ ConfigurationSpaceScene::addCollision(const qreal& x, const qreal& y, const qrea QBrush(QColor(rgb, rgb, rgb)) ); + rect->setParentItem(this->scene); rect->setZValue(1); } @@ -95,13 +100,14 @@ void ConfigurationSpaceScene::drawConfigurationEdge(const rl::math::Vector& u, const rl::math::Vector& v, const bool& free) { QGraphicsLineItem* line = this->addLine( - u(this->x), - -u(this->y), - v(this->x), - -v(this->y), + u(this->axis0), + -u(this->axis1), + v(this->axis0), + -v(this->axis1), free ? QPen(QBrush(QColor(0, 128, 0)), 0.0f) : QPen(QBrush(QColor(128, 0, 0)), 0.0f) ); + line->setParentItem(this->scene); line->setZValue(2); this->edges.push_back(line); @@ -123,13 +129,14 @@ ConfigurationSpaceScene::drawConfigurationPath(const rl::plan::VectorList& path) while (i != path.end() && j != path.end()) { QGraphicsLineItem* line = this->addLine( - (*i)(this->x), - -(*i)(this->y), - (*j)(this->x), - -(*j)(this->y), + (*i)(this->axis0), + -(*i)(this->axis1), + (*j)(this->axis0), + -(*j)(this->axis1), QPen(QBrush(QColor(0, 255, 0)), 0.0f) ); + line->setParentItem(this->scene); line->setZValue(3); this->path.push_back(line); @@ -182,32 +189,56 @@ ConfigurationSpaceScene::drawWorkVertex(const rl::math::Vector& q) void ConfigurationSpaceScene::eval() { - this->thread->stop(); + if (nullptr == this->model) + { + return; + } + + if (this->model->getDofPosition() < 2) + { + return; + } + + this->thread->axis0 = this->axis0; + this->thread->axis1 = this->axis1; + this->thread->delta0 = this->delta0; + this->thread->delta1 = this->delta1; + this->thread->model = this->model; + this->thread->start(); +} + +void +ConfigurationSpaceScene::init() +{ this->clear(); - rl::math::Vector maximum(this->model->getDof()); - this->model->getMaximum(maximum); - rl::math::Vector minimum(this->model->getDof()); - this->model->getMinimum(minimum); + if (nullptr == this->model) + { + return; + } - QGraphicsRectItem* rect = this->addRect( - minimum(this->x), - -maximum(this->y), - std::abs(maximum(this->x) - minimum(this->x)), - std::abs(maximum(this->y) - minimum(this->y)), + if (this->model->getDofPosition() < 2) + { + return; + } + + rl::math::Vector maximum = this->model->getMaximum(); + rl::math::Vector minimum = this->model->getMinimum(); + + this->scene = this->addRect( + minimum(this->axis0), + -maximum(this->axis1), + std::abs(maximum(this->axis0) - minimum(this->axis0)), + std::abs(maximum(this->axis1) - minimum(this->axis1)), QPen(Qt::NoPen), QBrush(Qt::white) ); - rect->setZValue(0); - - this->thread->delta = this->delta; - this->thread->model = this->model; - this->thread->x = this->x; - this->thread->y = this->y; + this->scene->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); + this->scene->setZValue(0); - this->thread->start(); + this->setSceneRect(this->scene->boundingRect()); } void @@ -219,25 +250,33 @@ ConfigurationSpaceScene::mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) void ConfigurationSpaceScene::mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent) { + if (nullptr == this->model) + { + return; + } + + if (this->model->getDofPosition() < 2) + { + return; + } + if (Qt::LeftButton == mouseEvent->buttons()) { if (!MainWindow::instance()->thread->isRunning()) { - rl::math::Vector maximum(this->model->getDof()); - this->model->getMaximum(maximum); - rl::math::Vector minimum(this->model->getDof()); - this->model->getMinimum(minimum); + rl::math::Vector maximum = this->model->getMaximum(); + rl::math::Vector minimum = this->model->getMinimum(); - if (mouseEvent->scenePos().x() > minimum(this->x) && - mouseEvent->scenePos().x() < maximum(this->x)) + if (mouseEvent->scenePos().x() > minimum(this->axis0) && + mouseEvent->scenePos().x() < maximum(this->axis0)) { - (*MainWindow::instance()->q)(this->x) = mouseEvent->scenePos().x(); + (*MainWindow::instance()->q)(this->axis0) = mouseEvent->scenePos().x(); } - if (mouseEvent->scenePos().y() > minimum(this->y) && - mouseEvent->scenePos().y() < maximum(this->y)) + if (-mouseEvent->scenePos().y() > minimum(this->axis1) && + -mouseEvent->scenePos().y() < maximum(this->axis1)) { - (*MainWindow::instance()->q)(this->y) = -mouseEvent->scenePos().y(); + (*MainWindow::instance()->q)(this->axis1) = -mouseEvent->scenePos().y(); } MainWindow::instance()->configurationModel->invalidate(); @@ -249,6 +288,7 @@ ConfigurationSpaceScene::mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent) void ConfigurationSpaceScene::reset() { + this->thread->stop(); this->resetEdges(); this->resetLines(); this->resetPath(); @@ -291,3 +331,8 @@ void ConfigurationSpaceScene::resetVertices() { } + +void +ConfigurationSpaceScene::showMessage(const std::string& message) +{ +} diff --git a/demos/rlPlanDemo/ConfigurationSpaceScene.h b/demos/rlPlanDemo/ConfigurationSpaceScene.h index 3d99e996..4a0a50a0 100644 --- a/demos/rlPlanDemo/ConfigurationSpaceScene.h +++ b/demos/rlPlanDemo/ConfigurationSpaceScene.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONSPACESCENE_H_ -#define _CONFIGURATIONSPACESCENE_H_ +#ifndef CONFIGURATIONSPACESCENE_H +#define CONFIGURATIONSPACESCENE_H #include #include @@ -40,17 +40,19 @@ class ConfigurationSpaceScene : public QGraphicsScene, public rl::plan::Viewer Q_OBJECT public: - ConfigurationSpaceScene(QObject* parent = NULL); + ConfigurationSpaceScene(QObject* parent = nullptr); virtual ~ConfigurationSpaceScene(); - rl::math::Real delta; + std::size_t axis0; - rl::plan::Model* model; + std::size_t axis1; + + rl::math::Real delta0; - std::size_t x; + rl::math::Real delta1; - std::size_t y; + rl::plan::Model* model; public slots: void addCollision(const qreal& x, const qreal& y, const qreal& w, const qreal& h, const int& rgb); @@ -83,6 +85,8 @@ public slots: void eval(); + void init(); + void reset(); void resetEdges(); @@ -97,6 +101,8 @@ public slots: void resetVertices(); + void showMessage(const std::string& message); + protected: void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent); @@ -106,8 +112,13 @@ public slots: QLinkedList edges; QLinkedList path; + + QGraphicsRectItem* scene; ConfigurationSpaceThread* thread; + +signals: + void evalFinished(); }; -#endif // _CONFIGURATIONSPACESCENE_H_ +#endif // CONFIGURATIONSPACESCENE_H diff --git a/demos/rlPlanDemo/ConfigurationSpaceThread.cpp b/demos/rlPlanDemo/ConfigurationSpaceThread.cpp index 69f36f2b..f52ef0b2 100644 --- a/demos/rlPlanDemo/ConfigurationSpaceThread.cpp +++ b/demos/rlPlanDemo/ConfigurationSpaceThread.cpp @@ -32,10 +32,11 @@ ConfigurationSpaceThread::ConfigurationSpaceThread(QObject* parent) : QThread(parent), - delta(1.0f), - model(NULL), - x(0), - y(1), + axis0(0), + axis1(1), + delta0(1.0f), + delta1(1.0f), + model(nullptr), running(false) { } @@ -51,31 +52,29 @@ ConfigurationSpaceThread::run() this->running = true; - if (rl::plan::SimpleModel* model = dynamic_cast< rl::plan::SimpleModel* >(this->model)) + if (rl::plan::SimpleModel* model = dynamic_cast(this->model)) { - rl::math::Vector maximum(model->getDof()); - model->getMaximum(maximum); - rl::math::Vector minimum(model->getDof()); - model->getMinimum(minimum); + rl::math::Vector maximum = model->getMaximum(); + rl::math::Vector minimum = model->getMinimum(); - rl::math::Real range0 = std::abs(maximum(this->x) - minimum(this->x)); - rl::math::Real range1 = std::abs(maximum(this->y) - minimum(this->y)); + rl::math::Real range0 = std::abs(maximum(this->axis0) - minimum(this->axis0)); + rl::math::Real range1 = std::abs(maximum(this->axis1) - minimum(this->axis1)); - rl::math::Real delta0 = range0 / std::ceil(range0 / this->delta); - rl::math::Real delta1 = range1 / std::ceil(range1 / this->delta); + rl::math::Real delta0 = range0 / std::ceil(range0 / this->delta0); + rl::math::Real delta1 = range1 / std::ceil(range1 / this->delta1); - std::size_t steps0 = static_cast< std::size_t >(std::ceil(range0 / delta0)); - std::size_t steps1 = static_cast< std::size_t >(std::ceil(range1 / delta1)); + std::size_t steps0 = static_cast(std::ceil(range0 / delta0)); + std::size_t steps1 = static_cast(std::ceil(range1 / delta1)); - rl::math::Vector q(*MainWindow::instance()->start); + rl::math::Vector q(*MainWindow::instance()->q); for (std::size_t i = 0; i < steps1 + 1 && this->running; ++i) { - q(this->y) = maximum(this->y) - i * delta1; + q(this->axis1) = maximum(this->axis1) - i * delta1; for (std::size_t j = 0; j < steps0 + 1 && this->running; ++j) { - q(this->x) = minimum(this->x) + j * delta0; + q(this->axis0) = minimum(this->axis0) + j * delta0; model->setPosition(q); model->updateFrames(); @@ -83,8 +82,8 @@ ConfigurationSpaceThread::run() if (model->isColliding()) { emit addCollision( - q(this->x), - q(this->y), + q(this->axis0), + q(this->axis1), delta0, delta1, 0 diff --git a/demos/rlPlanDemo/ConfigurationSpaceThread.h b/demos/rlPlanDemo/ConfigurationSpaceThread.h index 8900072b..f28d14d7 100644 --- a/demos/rlPlanDemo/ConfigurationSpaceThread.h +++ b/demos/rlPlanDemo/ConfigurationSpaceThread.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _CONFIGURATIONSPACETHREAD_H_ -#define _CONFIGURATIONSPACETHREAD_H_ +#ifndef CONFIGURATIONSPACETHREAD_H +#define CONFIGURATIONSPACETHREAD_H #include #include @@ -35,7 +35,7 @@ class ConfigurationSpaceThread : public QThread Q_OBJECT public: - ConfigurationSpaceThread(QObject* parent = NULL); + ConfigurationSpaceThread(QObject* parent = nullptr); virtual ~ConfigurationSpaceThread(); @@ -43,13 +43,15 @@ class ConfigurationSpaceThread : public QThread void stop(); - rl::math::Real delta; + std::size_t axis0; - rl::plan::Model* model; + std::size_t axis1; + + rl::math::Real delta0; - std::size_t x; + rl::math::Real delta1; - std::size_t y; + rl::plan::Model* model; protected: @@ -60,4 +62,4 @@ class ConfigurationSpaceThread : public QThread void addCollision(const qreal& x, const qreal& y, const qreal& w, const qreal& h, const int& rgb); }; -#endif // _CONFIGURATIONSPACETHREAD_H_ +#endif // CONFIGURATIONSPACETHREAD_H diff --git a/demos/rlPlanDemo/GraphicsView.cpp b/demos/rlPlanDemo/GraphicsView.cpp new file mode 100644 index 00000000..5f406f66 --- /dev/null +++ b/demos/rlPlanDemo/GraphicsView.cpp @@ -0,0 +1,54 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "GraphicsView.h" + +GraphicsView::GraphicsView(QWidget* parent) : + QGraphicsView(parent) +{ +} + +GraphicsView::~GraphicsView() +{ +} + +void +GraphicsView::adjust() +{ + this->fitInView(this->scene()->sceneRect(), Qt::KeepAspectRatio); +} + +void +GraphicsView::adjust(const QModelIndex&, const QModelIndex&) +{ + this->adjust(); +} + +void +GraphicsView::resizeEvent(QResizeEvent* event) +{ + this->adjust(); +} diff --git a/demos/rlCollisionDemo/TestWidget.h b/demos/rlPlanDemo/GraphicsView.h similarity index 78% rename from demos/rlCollisionDemo/TestWidget.h rename to demos/rlPlanDemo/GraphicsView.h index 96057c71..2ba127e6 100644 --- a/demos/rlCollisionDemo/TestWidget.h +++ b/demos/rlPlanDemo/GraphicsView.h @@ -24,36 +24,31 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _TESTWIDGET_H_ -#define _TESTWIDGET_H_ +#ifndef GRAPHICSVIEW_H +#define GRAPHICSVIEW_H -#include -#include +#include +#include -class MainWindow; - -class TestWidget : public QWidget +class GraphicsView : public QGraphicsView { Q_OBJECT public: - TestWidget(rl::sg::Body* body0, rl::sg::Body* body1, QWidget* parent = NULL, Qt::WFlags f = 0); - - virtual ~TestWidget(); + GraphicsView(QWidget* parent = nullptr); -protected: + virtual ~GraphicsView(); -private: - rl::sg::Body* body0; +public slots: + void adjust(); - rl::sg::Body* body1; + void adjust(const QModelIndex&, const QModelIndex&); -public slots: - void setX(double); +protected: + virtual void resizeEvent(QResizeEvent* event); - void setY(double); +private: - void setZ(double); }; -#endif // _TESTWIDGET_H_ +#endif // GRAPHICSVIEW_H diff --git a/demos/rlPlanDemo/MainWindow.cpp b/demos/rlPlanDemo/MainWindow.cpp index 2b741155..71057251 100644 --- a/demos/rlPlanDemo/MainWindow.cpp +++ b/demos/rlPlanDemo/MainWindow.cpp @@ -24,6 +24,7 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include #include #include #include @@ -33,11 +34,12 @@ #include #include #include +#include #include #include #include #include -#include +#include #include #include #include @@ -51,6 +53,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -73,31 +79,40 @@ #include #include #include +#include -#ifdef RL_SG_HAVE_BULLET +#ifdef RL_SG_BULLET #include -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_ODE +#endif // RL_SG_BULLET +#ifdef RL_SG_FCL +#include +#endif // RL_SG_FCL +#ifdef RL_SG_ODE #include -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP #include -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_PQP +#ifdef RL_SG_SOLID #include -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID #include "ConfigurationDelegate.h" #include "ConfigurationModel.h" +#include "ConfigurationSpaceModel.h" #include "ConfigurationSpaceScene.h" +#include "GraphicsView.h" #include "MainWindow.h" #include "PlannerModel.h" +#include "SoGradientBackground.h" #include "Thread.h" #include "Viewer.h" -MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : +MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags f) : QMainWindow(parent, f), configurationModel(new ConfigurationModel(this)), + configurationSpaceModel(new ConfigurationSpaceModel(this)), + engine(), explorerGoals(), explorers(), explorerStarts(), @@ -109,6 +124,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : model(), model2(), mutex(), + nearestNeighbors(), planner(), plannerModel(new PlannerModel(this)), q(), @@ -117,20 +133,21 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : sigma(), scene(), scene2(), - sceneModel(NULL), - sceneModel2(NULL), + sceneModel(nullptr), + sceneModel2(nullptr), start(), thread(new Thread(this)), verifier(), verifier2(), - viewer(NULL), + viewer(nullptr), configurationDelegate(new ConfigurationDelegate(this)), configurationDockWidget(new QDockWidget(this)), configurationSpaceDockWidget(new QDockWidget(this)), configurationSpaceScene(new ConfigurationSpaceScene(this)), - configurationSpaceView(new QGraphicsView(this)), + configurationSpaceSceneDockWidget(new QDockWidget(this)), + configurationSpaceSceneView(new GraphicsView(this)), + configurationSpaceView(new QTableView(this)), configurationView(new QTableView(this)), - engine(), evalAction(new QAction(this)), exitAction(new QAction(this)), filename(), @@ -142,22 +159,29 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : plannerDockWidget(new QDockWidget(this)), plannerView(new QTableView(this)), resetAction(new QAction(this)), - saveImageAction(new QAction(this)), + saveImageWithAlphaAction(new QAction(this)), + saveImageWithoutAlphaAction(new QAction(this)), savePdfAction(new QAction(this)), saveSceneAction(new QAction(this)), + seed(), setGoalConfigurationAction(new QAction(this)), setStartConfigurationAction(new QAction(this)), startThreadAction(new QAction(this)), + toggleAnimationAction(new QAction(this)), toggleCameraAction(new QAction(this)), toggleConfigurationAction(new QAction(this)), toggleConfigurationEdgesAction(new QAction(this)), toggleConfigurationSpaceAction(new QAction(this)), + toggleConfigurationSpaceActiveAction(new QAction(this)), + toggleConfigurationSpaceSceneAction(new QAction(this)), toggleConfigurationVerticesAction(new QAction(this)), toggleLinesAction(new QAction(this)), + togglePathAction(new QAction(this)), togglePlannerAction(new QAction(this)), togglePointsAction(new QAction(this)), toggleSpheresAction(new QAction(this)), - toggleViewAction(new QAction(this)), + toggleSweptVolumeAction(new QAction(this)), + toggleViewActiveAction(new QAction(this)), toggleWorkFramesAction(new QAction(this)), wait(true) { @@ -165,98 +189,147 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : SoQt::init(this); SoDB::init(); + SoGradientBackground::initClass(); + + QGLFormat format; + format.setAlpha(true); + format.setSampleBuffers(true); + QGLFormat::setDefaultFormat(format); this->viewer = new Viewer(this); this->setCentralWidget(this->viewer); - this->configurationSpaceView->setEnabled(false); - this->configurationSpaceView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - this->configurationSpaceView->setScene(this->configurationSpaceScene); - this->configurationSpaceView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - this->configurationSpaceView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + this->configurationSpaceModel->configurationSpaceScene = this->configurationSpaceScene; +#if QT_VERSION >= 0x050000 + this->configurationSpaceView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->configurationSpaceView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->configurationSpaceView->horizontalHeader()->hide(); + this->configurationSpaceView->setAlternatingRowColors(true); + this->configurationSpaceView->setModel(this->configurationSpaceModel); + + this->configurationSpaceSceneView->setBackgroundBrush(QBrush(QWidget::palette().color(QWidget::backgroundRole()))); + this->configurationSpaceSceneView->setScene(this->configurationSpaceScene); + +#if QT_VERSION >= 0x050000 + this->configurationView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION this->configurationView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION this->configurationView->horizontalHeader()->hide(); this->configurationView->setAlternatingRowColors(true); this->configurationView->setItemDelegate(this->configurationDelegate); this->configurationView->setModel(this->configurationModel); - this->configurationView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); - this->configurationDockWidget->hide(); +#if QT_VERSION >= 0x050000 + this->plannerView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->plannerView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->plannerView->horizontalHeader()->hide(); + this->plannerView->setAlternatingRowColors(true); + this->plannerView->setModel(this->plannerModel); + this->plannerView->setWordWrap(false); + this->configurationDockWidget->resize(160, 320); - this->configurationDockWidget->setFloating(true); this->configurationDockWidget->setWidget(this->configurationView); this->configurationDockWidget->setWindowTitle("Configuration"); - this->configurationSpaceDockWidget->hide(); - this->configurationSpaceDockWidget->setFloating(true); - this->configurationSpaceDockWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + this->configurationSpaceDockWidget->resize(160, 320); this->configurationSpaceDockWidget->setWidget(this->configurationSpaceView); - this->configurationSpaceDockWidget->setWindowTitle("C-Space"); + this->configurationSpaceDockWidget->setWindowTitle("Configuration Space"); - this->plannerView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - this->plannerView->setAlternatingRowColors(true); - this->plannerView->setModel(this->plannerModel); - this->plannerView->setWordWrap(false); - this->plannerView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + this->configurationSpaceSceneDockWidget->resize(320, 320); + this->configurationSpaceSceneDockWidget->setWidget(this->configurationSpaceSceneView); + this->configurationSpaceSceneDockWidget->setWindowTitle("Configuration Space"); - this->plannerDockWidget->hide(); this->plannerDockWidget->resize(160, 320); - this->plannerDockWidget->setFloating(true); this->plannerDockWidget->setWidget(this->plannerView); this->plannerDockWidget->setWindowTitle("Planner"); + this->addDockWidget(Qt::LeftDockWidgetArea, this->configurationSpaceDockWidget); + this->tabifyDockWidget(this->configurationSpaceDockWidget, this->configurationSpaceSceneDockWidget); + this->addDockWidget(Qt::LeftDockWidgetArea, this->configurationDockWidget); + this->addDockWidget(Qt::LeftDockWidgetArea, this->plannerDockWidget); + + QObject::connect(this->configurationSpaceModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this->configurationSpaceSceneView, SLOT(adjust(const QModelIndex&, const QModelIndex&))); + QObject::connect(this->configurationSpaceScene, SIGNAL(evalFinished()), this, SLOT(evalDone())); + this->init(); QStringList engines; -#ifdef RL_SG_HAVE_ODE +#ifdef RL_SG_FCL + engines.push_back("fcl"); + this->engine = "fcl"; +#endif // RL_SG_FCL +#ifdef RL_SG_ODE engines.push_back("ode"); this->engine = "ode"; -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP engines.push_back("pqp"); this->engine = "pqp"; -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_BULLET +#endif // RL_SG_PQP +#ifdef RL_SG_BULLET engines.push_back("bullet"); this->engine = "bullet"; -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_BULLET +#ifdef RL_SG_SOLID engines.push_back("solid"); this->engine = "solid"; -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID engines.sort(); + QRegExp backgroundRegExp("--background=(\\S*)"); QRegExp engineRegExp("--engine=(" + engines.join("|") + ")"); QRegExp helpRegExp("--help"); QRegExp heightRegExp("--height=(\\d*)"); + QRegExp quitRegExp("--enable-quit"); + QRegExp seedRegExp("--seed=(\\d*)"); QRegExp viewerRegExp("--disable-viewer"); QRegExp waitRegExp("--disable-wait"); QRegExp widthRegExp("--width=(\\d*)"); - QRegExp quitRegExp("--enable-quit"); int width = 1024; int height = 768; + bool doSetMinimumSize = false; + for (int i = 1; i < QApplication::arguments().size(); ++i) { - if (-1 != engineRegExp.indexIn(QApplication::arguments()[i])) + if (-1 != backgroundRegExp.indexIn(QApplication::arguments()[i])) + { + this->viewer->setBackgroundColor(backgroundRegExp.cap(1)); + } + else if (-1 != engineRegExp.indexIn(QApplication::arguments()[i])) { this->engine = engineRegExp.cap(1); } else if (-1 != helpRegExp.indexIn(QApplication::arguments()[i])) { - std::cout << "Usage: rlPlanDemo [PLANFILE] [--engine=" << engines.join("|").toStdString() << "] [--help] [--disable-viewer] [--disable-wait] [--enable-quit] [--width=WIDTH] [--height=HEIGHT]" << std::endl; + QMessageBox::information(this, "Usage", "rlPlanDemo [PLANFILE] [--background=COLOR] [--engine=" + engines.join("|") + "] [--help] [--disable-viewer] [--disable-wait] [--enable-quit] [--seed=SEED] [--width=WIDTH] [--height=HEIGHT]"); + exit(EXIT_SUCCESS); } else if (-1 != heightRegExp.indexIn(QApplication::arguments()[i])) { height = heightRegExp.cap(1).toInt(); + doSetMinimumSize = true; + } + else if (-1 != quitRegExp.indexIn(QApplication::arguments()[i])) + { + this->thread->quit = true; + } + else if (-1 != seedRegExp.indexIn(QApplication::arguments()[i])) + { + this->seed = seedRegExp.cap(1).toUInt(); } else if (-1 != viewerRegExp.indexIn(QApplication::arguments()[i])) { - QObject::disconnect(this->toggleViewAction, SIGNAL(toggled(bool)), this, SLOT(toggleView(bool))); - this->toggleViewAction->setChecked(false); - QObject::connect(this->toggleViewAction, SIGNAL(toggled(bool)), this, SLOT(toggleView(bool))); + QObject::disconnect(this->toggleViewActiveAction, SIGNAL(toggled(bool)), this, SLOT(toggleViewActive(bool))); + this->toggleViewActiveAction->setChecked(false); + QObject::connect(this->toggleViewActiveAction, SIGNAL(toggled(bool)), this, SLOT(toggleViewActive(bool))); } else if (-1 != waitRegExp.indexIn(QApplication::arguments()[i])) { @@ -265,10 +338,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : else if (-1 != widthRegExp.indexIn(QApplication::arguments()[i])) { width = widthRegExp.cap(1).toInt(); - } - else if (-1 != quitRegExp.indexIn(QApplication::arguments()[i])) - { - this->thread->quit = true; + doSetMinimumSize = true; } else { @@ -277,7 +347,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : } this->resize(width, height); - this->viewer->setMinimumSize(width, height); + + if (doSetMinimumSize) + { + this->viewer->setMinimumSize(width, height); + } if (this->filename.isEmpty()) { @@ -291,14 +365,15 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags f) : MainWindow::~MainWindow() { - this->thread->stop(); + this->reset(); - MainWindow::singleton = NULL; + MainWindow::singleton = nullptr; } void MainWindow::clear() { + this->configurationSpaceScene->clear(); this->explorerGoals.clear(); this->explorers.clear(); this->explorerStarts.clear(); @@ -309,6 +384,7 @@ MainWindow::clear() this->mdl2.reset(); this->model.reset(); this->model2.reset(); + this->nearestNeighbors.clear(); this->optimizer.reset(); this->planner.reset(); this->q.reset(); @@ -317,8 +393,8 @@ MainWindow::clear() this->sigma.reset(); this->scene.reset(); this->scene2.reset(); - this->sceneModel = NULL; - this->sceneModel2 = NULL; + this->sceneModel = nullptr; + this->sceneModel2 = nullptr; this->start.reset(); this->verifier.reset(); this->verifier2.reset(); @@ -376,6 +452,13 @@ MainWindow::connect(const QObject* sender, const QObject* receiver) SLOT(resetLines()) ); + QObject::connect( + sender, + SIGNAL(messageRequested(const std::string&)), + receiver, + SLOT(showMessage(const std::string&)) + ); + QObject::connect( sender, SIGNAL(pointRequested(const rl::math::Vector&)), @@ -450,37 +533,84 @@ MainWindow::connect(const QObject* sender, const QObject* receiver) void MainWindow::disconnect(const QObject* sender, const QObject* receiver) { - QObject::disconnect(sender, NULL, receiver, NULL); + QObject::disconnect(sender, nullptr, receiver, nullptr); } void MainWindow::eval() { + this->configurationView->setEnabled(false); + this->configurationSpaceSceneView->setEnabled(false); + this->configurationSpaceView->setEnabled(false); + this->evalAction->setEnabled(false); + this->getGoalConfigurationAction->setEnabled(false); + this->getRandomConfigurationAction->setEnabled(false); + this->getRandomFreeConfigurationAction->setEnabled(false); + this->getStartConfigurationAction->setEnabled(false); + this->openAction->setEnabled(false); + this->plannerView->setEnabled(false); + this->setGoalConfigurationAction->setEnabled(false); + this->setStartConfigurationAction->setEnabled(false); + this->startThreadAction->setEnabled(false); + this->toggleConfigurationSpaceActiveAction->setEnabled(false); + this->toggleViewActiveAction->setEnabled(false); + + this->model->reset(); + + MainWindow::instance()->statusBar()->showMessage("Calculating configuration space..."); + this->configurationSpaceScene->eval(); } +void +MainWindow::evalDone() +{ + this->configurationView->setEnabled(true); + this->configurationSpaceSceneView->setEnabled(true); + this->configurationSpaceView->setEnabled(true); + this->evalAction->setEnabled(true); + this->getGoalConfigurationAction->setEnabled(true); + this->getRandomConfigurationAction->setEnabled(true); + this->getRandomFreeConfigurationAction->setEnabled(true); + this->getStartConfigurationAction->setEnabled(true); + this->openAction->setEnabled(true); + this->plannerView->setEnabled(true); + this->setGoalConfigurationAction->setEnabled(true); + this->setStartConfigurationAction->setEnabled(true); + this->startThreadAction->setEnabled(true); + this->toggleAnimationAction->setEnabled(true); + this->toggleConfigurationSpaceActiveAction->setEnabled(true); + this->toggleSweptVolumeAction->setEnabled(true); + this->toggleViewActiveAction->setEnabled(true); + + this->statusBar()->showMessage("Finished calculating configuration space.", 1000); +} + void MainWindow::getGoalConfiguration() { *this->q = *this->goal; this->configurationModel->invalidate(); this->viewer->drawConfiguration(*this->q); + this->statusBar()->showMessage("Showing goal configuration.", 1000); } void MainWindow::getRandomConfiguration() { - this->sampler2->generate(*this->q); + *this->q = this->sampler2->generate(); this->configurationModel->invalidate(); this->viewer->drawConfiguration(*this->q); + this->statusBar()->showMessage("Showing random configuration.", 1000); } void MainWindow::getRandomFreeConfiguration() { - this->sampler2->generateCollisionFree(*this->q); + *this->q = this->sampler2->generateCollisionFree(); this->configurationModel->invalidate(); this->viewer->drawConfiguration(*this->q); + this->statusBar()->showMessage("Showing random collision-free configuration.", 1000); } void @@ -489,11 +619,14 @@ MainWindow::getStartConfiguration() *this->q = *this->start; this->configurationModel->invalidate(); this->viewer->drawConfiguration(*this->q); + this->statusBar()->showMessage("Showing start configuration.", 1000); } void MainWindow::init() { + this->statusBar(); + QMenu* fileMenu = this->menuBar()->addMenu("File"); this->openAction->setText("Open..."); @@ -504,11 +637,17 @@ MainWindow::init() fileMenu->addSeparator(); - this->saveImageAction->setText("Save as PNG"); - this->saveImageAction->setShortcut(QKeySequence("Return")); - QObject::connect(this->saveImageAction, SIGNAL(triggered()), this, SLOT(saveImage())); - this->addAction(this->saveImageAction); - fileMenu->addAction(this->saveImageAction); + this->saveImageWithoutAlphaAction->setText("Save as PNG w/o Alpha"); + this->saveImageWithoutAlphaAction->setShortcut(QKeySequence("Return")); + QObject::connect(this->saveImageWithoutAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithoutAlpha())); + this->addAction(this->saveImageWithoutAlphaAction); + fileMenu->addAction(this->saveImageWithoutAlphaAction); + + this->saveImageWithAlphaAction->setText("Save as PNG w/ Alpha"); + this->saveImageWithAlphaAction->setShortcut(QKeySequence("Shift+Return")); + QObject::connect(this->saveImageWithAlphaAction, SIGNAL(triggered()), this, SLOT(saveImageWithAlpha())); + this->addAction(this->saveImageWithAlphaAction); + fileMenu->addAction(this->saveImageWithAlphaAction); this->saveSceneAction->setText("Save as VRML"); this->saveSceneAction->setShortcut(QKeySequence("Ctrl+Return")); @@ -531,7 +670,7 @@ MainWindow::init() QMenu* configurationMenu = this->menuBar()->addMenu("Configuration"); - this->toggleConfigurationAction->setText("Show/Hide"); + this->toggleConfigurationAction->setText("Parameters"); this->toggleConfigurationAction->setShortcut(QKeySequence("F5")); QObject::connect(this->toggleConfigurationAction, SIGNAL(triggered()), this, SLOT(toggleConfiguration())); this->addAction(this->toggleConfigurationAction); @@ -551,25 +690,40 @@ MainWindow::init() this->addAction(this->getRandomFreeConfigurationAction); configurationMenu->addAction(this->getRandomFreeConfigurationAction); - QMenu* cSpaceMenu = this->menuBar()->addMenu("C-Space"); + QMenu* configurationSpaceMenu = this->menuBar()->addMenu("Configuration Space"); - this->toggleConfigurationSpaceAction->setText("Show/Hide"); + this->toggleConfigurationSpaceAction->setText("Parameters"); this->toggleConfigurationSpaceAction->setShortcut(QKeySequence("F6")); QObject::connect(this->toggleConfigurationSpaceAction, SIGNAL(triggered()), this, SLOT(toggleConfigurationSpace())); this->addAction(this->toggleConfigurationSpaceAction); - cSpaceMenu->addAction(this->toggleConfigurationSpaceAction); + configurationSpaceMenu->addAction(this->toggleConfigurationSpaceAction); - cSpaceMenu->addSeparator(); + this->toggleConfigurationSpaceSceneAction->setText("Visualization"); + this->toggleConfigurationSpaceSceneAction->setShortcut(QKeySequence("F10")); + QObject::connect(this->toggleConfigurationSpaceSceneAction, SIGNAL(triggered()), this, SLOT(toggleConfigurationSpaceScene())); + this->addAction(this->toggleConfigurationSpaceSceneAction); + configurationSpaceMenu->addAction(this->toggleConfigurationSpaceSceneAction); + + configurationSpaceMenu->addSeparator(); + + this->toggleConfigurationSpaceActiveAction->setCheckable(true); + this->toggleConfigurationSpaceActiveAction->setChecked(false); + this->toggleConfigurationSpaceActiveAction->setText("Active"); + QObject::connect(this->toggleConfigurationSpaceActiveAction, SIGNAL(toggled(bool)), this, SLOT(toggleConfigurationSpaceActive(bool))); + this->addAction(this->toggleConfigurationSpaceActiveAction); + configurationSpaceMenu->addAction(this->toggleConfigurationSpaceActiveAction); + + configurationSpaceMenu->addSeparator(); this->evalAction->setText("Evaluate"); this->evalAction->setShortcut(QKeySequence("F11")); QObject::connect(this->evalAction, SIGNAL(triggered()), this, SLOT(eval())); this->addAction(this->evalAction); - cSpaceMenu->addAction(this->evalAction); + configurationSpaceMenu->addAction(this->evalAction); QMenu* plannerMenu = this->menuBar()->addMenu("Planner"); - this->togglePlannerAction->setText("Show/Hide"); + this->togglePlannerAction->setText("Parameters"); this->togglePlannerAction->setShortcut(QKeySequence("F7")); QObject::connect(this->togglePlannerAction, SIGNAL(triggered()), this, SLOT(togglePlanner())); this->addAction(this->togglePlannerAction); @@ -619,12 +773,36 @@ MainWindow::init() QMenu* viewMenu = this->menuBar()->addMenu("View"); - this->toggleViewAction->setCheckable(true); - this->toggleViewAction->setChecked(true); - this->toggleViewAction->setText("Active"); - QObject::connect(this->toggleViewAction, SIGNAL(toggled(bool)), this, SLOT(toggleView(bool))); - this->addAction(this->toggleViewAction); - viewMenu->addAction(this->toggleViewAction); + this->toggleViewActiveAction->setCheckable(true); + this->toggleViewActiveAction->setChecked(true); + this->toggleViewActiveAction->setText("Active"); + QObject::connect(this->toggleViewActiveAction, SIGNAL(toggled(bool)), this, SLOT(toggleViewActive(bool))); + this->addAction(this->toggleViewActiveAction); + viewMenu->addAction(this->toggleViewActiveAction); + + viewMenu->addSeparator(); + + this->togglePathAction->setCheckable(true); + this->togglePathAction->setChecked(true); + this->togglePathAction->setText("Path"); + QObject::connect(this->togglePathAction, SIGNAL(toggled(bool)), this->viewer, SLOT(togglePath(bool))); + this->addAction(this->togglePathAction); + viewMenu->addAction(this->togglePathAction); + + this->toggleAnimationAction->setCheckable(true); + this->toggleAnimationAction->setChecked(true); + this->toggleAnimationAction->setText("Animation"); + QObject::connect(this->toggleAnimationAction, SIGNAL(toggled(bool)), this, SLOT(toggleAnimation(bool))); + this->addAction(this->toggleAnimationAction); + viewMenu->addAction(this->toggleAnimationAction); + + this->toggleSweptVolumeAction->setCheckable(true); + this->toggleSweptVolumeAction->setChecked(false); + this->toggleSweptVolumeAction->setText("Swept Volume"); + QObject::connect(this->toggleSweptVolumeAction, SIGNAL(toggled(bool)), this, SLOT(toggleSweptVolume(bool))); + QObject::connect(this->toggleSweptVolumeAction, SIGNAL(toggled(bool)), this->viewer, SLOT(toggleSweptVolume(bool))); + this->addAction(this->toggleSweptVolumeAction); + viewMenu->addAction(this->toggleSweptVolumeAction); viewMenu->addSeparator(); @@ -686,7 +864,7 @@ MainWindow::init() MainWindow* MainWindow::instance() { - if (NULL == MainWindow::singleton) + if (nullptr == MainWindow::singleton) { new MainWindow(); } @@ -697,112 +875,141 @@ MainWindow::instance() void MainWindow::load(const QString& filename) { + this->statusBar()->showMessage("Loading '" + filename + "'..."); + QMutexLocker lock(&this->mutex); this->clear(); rl::xml::DomParser parser; - rl::xml::Document doc = parser.readFile(filename.toStdString(), "", XML_PARSE_NOENT | XML_PARSE_XINCLUDE); + rl::xml::Document document = parser.readFile(filename.toStdString(), "", XML_PARSE_NOENT | XML_PARSE_XINCLUDE); + document.substitute(XML_PARSE_NOENT | XML_PARSE_XINCLUDE); - this->filename = filename; - this->setWindowTitle(filename + " - " + this->engine + " - rlPlanDemo"); + if ("stylesheet" == document.getRootElement().getName() || "transform" == document.getRootElement().getName()) + { + if ("1.0" == document.getRootElement().getProperty("version")) + { + if (document.getRootElement().hasNamespace() && "http://www.w3.org/1999/XSL/Transform" == document.getRootElement().getNamespace().getHref()) + { + rl::xml::Stylesheet stylesheet(document); + document = stylesheet.apply(); + } + } + } - doc.substitute(XML_PARSE_NOENT | XML_PARSE_XINCLUDE); + this->filename = filename; + this->setWindowTitle(filename + " - " + this->engine.toUpper() + " - rlPlanDemo"); - rl::xml::Path path(doc); + rl::xml::Path path(document); -#ifdef RL_SG_HAVE_BULLET +#ifdef RL_SG_BULLET if ("bullet" == this->engine) { - this->scene = boost::make_shared< rl::sg::bullet::Scene >(); + this->scene = std::make_shared(); } -#endif // RL_SG_HAVE_BULLET -#ifdef RL_SG_HAVE_ODE +#endif // RL_SG_BULLET +#ifdef RL_SG_FCL + if ("fcl" == this->engine) + { + this->scene = std::make_shared(); + } +#endif // RL_SG_FCL +#ifdef RL_SG_ODE if ("ode" == this->engine) { - this->scene = boost::make_shared< rl::sg::ode::Scene >(); + this->scene = std::make_shared(); } -#endif // RL_SG_HAVE_ODE -#ifdef RL_SG_HAVE_PQP +#endif // RL_SG_ODE +#ifdef RL_SG_PQP if ("pqp" == this->engine) { - this->scene = boost::make_shared< rl::sg::pqp::Scene >(); + this->scene = std::make_shared(); } -#endif // RL_SG_HAVE_PQP -#ifdef RL_SG_HAVE_SOLID +#endif // RL_SG_PQP +#ifdef RL_SG_SOLID if ("solid" == this->engine) { - this->scene = boost::make_shared< rl::sg::solid::Scene >(); + this->scene = std::make_shared(); } -#endif // RL_SG_HAVE_SOLID +#endif // RL_SG_SOLID - rl::xml::Object modelScene = path.eval("//model/scene"); - this->scene->load(modelScene.getNodeTab(0).getUri(modelScene.getNodeTab(0).getAttribute("href").getValue())); + rl::xml::NodeSet modelScene = path.eval("(/rl/plan|/rlplan)//model/scene").getValue(); + this->scene->load(modelScene[0].getUri(modelScene[0].getProperty("href"))); this->sceneModel = this->scene->getModel( - static_cast< int >(path.eval("number(//model/model)").getFloatval()) + path.eval("number((/rl/plan|/rlplan)//model/model)").getValue() ); - if (path.eval("count(//model/kinematics) > 0").getBoolval()) + if ("mdl" == path.eval("string((/rl/plan|/rlplan)//model/kinematics/@type)").getValue()) { - rl::xml::Object kin = path.eval("//model/kinematics"); - this->kin.reset(rl::kin::Kinematics::create( - kin.getNodeTab(0).getUri(kin.getNodeTab(0).getAttribute("href").getValue()) - )); + rl::xml::NodeSet mdl = path.eval("(/rl/plan|/rlplan)//model/kinematics").getValue(); + rl::mdl::XmlFactory factory; + this->mdl.reset(dynamic_cast(factory.create( + mdl[0].getUri(mdl[0].getProperty("href")) + ))); - if (path.eval("count(//model/kinematics/world) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//model/kinematics/world) > 0").getValue()) { - this->kin->world() = ::rl::math::AngleAxis( - path.eval("number(//model/kinematics/world/rotation/z)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitZ() - ) * ::rl::math::AngleAxis( - path.eval("number(//model/kinematics/world/rotation/y)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitY() - ) * ::rl::math::AngleAxis( - path.eval("number(//model/kinematics/world/rotation/x)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitX() + this->mdl->world() = rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/z)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitZ() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/y)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitY() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/x)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitX() ); - this->kin->world().translation().x() = path.eval("number(//model/kinematics/world/translation/x)").getFloatval(0); - this->kin->world().translation().y() = path.eval("number(//model/kinematics/world/translation/y)").getFloatval(0); - this->kin->world().translation().z() = path.eval("number(//model/kinematics/world/translation/z)").getFloatval(0); + this->mdl->world().translation().x() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/x)").getValue(0); + this->mdl->world().translation().y() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/y)").getValue(0); + this->mdl->world().translation().z() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/z)").getValue(0); } } - - if (path.eval("count(//model/mdl) > 0").getBoolval()) + else { - rl::xml::Object mdl = path.eval("//model/mdl"); - rl::mdl::XmlFactory factory; - this->mdl.reset(dynamic_cast< rl::mdl::Dynamic* >(factory.create( - mdl.getNodeTab(0).getUri(mdl.getNodeTab(0).getAttribute("href").getValue()) - ))); + rl::xml::NodeSet kin = path.eval("(/rl/plan|/rlplan)//model/kinematics").getValue(); + this->kin.reset(rl::kin::Kinematics::create( + kin[0].getUri(kin[0].getProperty("href")) + )); - if (path.eval("count(//model/mdl/world) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//model/kinematics/world) > 0").getValue()) { - this->mdl->world() = ::rl::math::AngleAxis( - path.eval("number(//model/mdl/world/rotation/z)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitZ() - ) * ::rl::math::AngleAxis( - path.eval("number(//model/mdl/world/rotation/y)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitY() - ) * ::rl::math::AngleAxis( - path.eval("number(//model/mdl/world/rotation/x)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitX() + this->kin->world() = rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/z)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitZ() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/y)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitY() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/rotation/x)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitX() ); - this->mdl->world().translation().x() = path.eval("number(//model/mdl/world/translation/x)").getFloatval(0); - this->mdl->world().translation().y() = path.eval("number(//model/mdl/world/translation/y)").getFloatval(0); - this->mdl->world().translation().z() = path.eval("number(//model/mdl/world/translation/z)").getFloatval(0); + this->kin->world().translation().x() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/x)").getValue(0); + this->kin->world().translation().y() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/y)").getValue(0); + this->kin->world().translation().z() = path.eval("number((/rl/plan|/rlplan)//model/kinematics/world/translation/z)").getValue(0); } } - this->model = boost::make_shared< rl::plan::DistanceModel >(); + if (rl::sg::DistanceScene* scene = dynamic_cast(this->scene.get())) + { + this->model = std::make_shared(); + } + else if (rl::sg::SimpleScene* scene = dynamic_cast(this->scene.get())) + { + this->model = std::make_shared(); + } + else + { + throw std::runtime_error("selected engine does not support collision queries"); + } - if (NULL != this->kin) + if (nullptr != this->kin) { this->model->kin = this->kin.get(); } - else if (NULL != this->mdl) + else if (nullptr != this->mdl) { this->model->mdl = this->mdl.get(); } @@ -810,81 +1017,80 @@ MainWindow::load(const QString& filename) this->model->model = this->sceneModel; this->model->scene = this->scene.get(); - this->q = boost::make_shared< rl::math::Vector >(this->model->getDof()); + this->q = std::make_shared(this->model->getDofPosition()); - if (NULL != this->scene2) + if (nullptr != this->scene2) { this->viewer->sceneGroup->removeChild(this->scene2->root); } - this->scene2 = boost::make_shared< rl::sg::so::Scene >(); + this->scene2 = std::make_shared(); - rl::xml::Object viewerScene = path.eval("//viewer/model/scene"); - this->scene2->load(viewerScene.getNodeTab(0).getUri(viewerScene.getNodeTab(0).getAttribute("href").getValue())); - this->sceneModel2 = static_cast< rl::sg::so::Model* >(this->scene2->getModel( - static_cast< int >(path.eval("number(//viewer/model/model)").getFloatval()) + rl::xml::NodeSet viewerScene = path.eval("(/rl/plan|/rlplan)//viewer/model/scene").getValue(); + this->scene2->load(viewerScene[0].getUri(viewerScene[0].getProperty("href"))); + this->sceneModel2 = static_cast(this->scene2->getModel( + path.eval("number((/rl/plan|/rlplan)//viewer/model/model)").getValue() )); - if (path.eval("count(//viewer/model/kinematics) > 0").getBoolval()) + if ("mdl" == path.eval("string((/rl/plan|/rlplan)//viewer/model/kinematics/@type)").getValue()) { - rl::xml::Object kin2 = path.eval("//viewer/model/kinematics"); - this->kin2.reset(rl::kin::Kinematics::create( - kin2.getNodeTab(0).getUri(kin2.getNodeTab(0).getAttribute("href").getValue()) - )); + rl::xml::NodeSet mdl2 = path.eval("(/rl/plan|/rlplan)//viewer/model/kinematics").getValue(); + rl::mdl::XmlFactory factory; + this->mdl2.reset(dynamic_cast(factory.create( + mdl2[0].getUri(mdl2[0].getProperty("href")) + ))); - if (path.eval("count(//viewer/model/kinematics/world) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//viewer/model/kinematics/world) > 0").getValue()) { - this->kin2->world() = ::rl::math::AngleAxis( - path.eval("number(//viewer/model/kinematics/world/rotation/z)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitZ() - ) * ::rl::math::AngleAxis( - path.eval("number(//viewer/model/kinematics/world/rotation/y)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitY() - ) * ::rl::math::AngleAxis( - path.eval("number(//viewer/model/kinematics/world/rotation/x)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitX() + this->mdl2->world() = rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/z)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitZ() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/y)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitY() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/x)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitX() ); - this->kin2->world().translation().x() = path.eval("number(//viewer/model/kinematics/world/translation/x)").getFloatval(0); - this->kin2->world().translation().y() = path.eval("number(//viewer/model/kinematics/world/translation/y)").getFloatval(0); - this->kin2->world().translation().z() = path.eval("number(//viewer/model/kinematics/world/translation/z)").getFloatval(0); + this->mdl2->world().translation().x() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/x)").getValue(0); + this->mdl2->world().translation().y() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/y)").getValue(0); + this->mdl2->world().translation().z() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/z)").getValue(0); } } - - if (path.eval("count(//viewer/model/mdl) > 0").getBoolval()) + else { - rl::xml::Object mdl2 = path.eval("//viewer/model/mdl"); - rl::mdl::XmlFactory factory; - this->mdl2.reset(dynamic_cast< rl::mdl::Dynamic* >(factory.create( - mdl2.getNodeTab(0).getUri(mdl2.getNodeTab(0).getAttribute("href").getValue()) - ))); + rl::xml::NodeSet kin2 = path.eval("(/rl/plan|/rlplan)//viewer/model/kinematics").getValue(); + this->kin2.reset(rl::kin::Kinematics::create( + kin2[0].getUri(kin2[0].getProperty("href")) + )); - if (path.eval("count(//viewer/model/mdl/world) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//viewer/model/kinematics/world) > 0").getValue()) { - this->mdl2->world() = ::rl::math::AngleAxis( - path.eval("number(//viewer/model/mdl/world/rotation/z)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitZ() - ) * ::rl::math::AngleAxis( - path.eval("number(//viewer/model/mdl/world/rotation/y)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitY() - ) * ::rl::math::AngleAxis( - path.eval("number(//viewer/model/mdl/world/rotation/x)").getFloatval(0) * rl::math::DEG2RAD, - ::rl::math::Vector3::UnitX() + this->kin2->world() = rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/z)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitZ() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/y)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitY() + ) * rl::math::AngleAxis( + path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/rotation/x)").getValue(0) * rl::math::DEG2RAD, + rl::math::Vector3::UnitX() ); - this->mdl2->world().translation().x() = path.eval("number(//viewer/model/mdl/world/translation/x)").getFloatval(0); - this->mdl2->world().translation().y() = path.eval("number(//viewer/model/mdl/world/translation/y)").getFloatval(0); - this->mdl2->world().translation().z() = path.eval("number(//viewer/model/mdl/world/translation/z)").getFloatval(0); + this->kin2->world().translation().x() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/x)").getValue(0); + this->kin2->world().translation().y() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/y)").getValue(0); + this->kin2->world().translation().z() = path.eval("number((/rl/plan|/rlplan)//viewer/model/kinematics/world/translation/z)").getValue(0); } } - this->model2 = boost::make_shared< rl::plan::Model >(); + this->model2 = std::make_shared(); - if (NULL != this->kin2) + if (nullptr != this->kin2) { this->model2->kin = this->kin2.get(); } - else if (NULL != this->mdl2) + else if (nullptr != this->mdl2) { this->model2->mdl = this->mdl2.get(); } @@ -892,612 +1098,774 @@ MainWindow::load(const QString& filename) this->model2->model = this->sceneModel2; this->model2->scene = this->scene2.get(); - rl::xml::Object start = path.eval("//start//q"); - this->start = boost::make_shared< rl::math::Vector >(start.getNodeNr()); + rl::xml::NodeSet start = path.eval("(/rl/plan|/rlplan)//start/q").getValue(); + this->start = std::make_shared(start.size()); - for (int i = 0; i < start.getNodeNr(); ++i) + for (int i = 0; i < start.size(); ++i) { - (*this->start)(i) = std::atof(start.getNodeTab(i).getContent().c_str()); + (*this->start)(i) = std::atof(start[i].getContent().c_str()); - if (start.getNodeTab(i).hasAttribute("unit")) + if ("deg" == start[i].getProperty("unit")) { - if ("deg" == start.getNodeTab(i).getAttribute("unit").getValue()) - { - (*this->start)(i) *= rl::math::DEG2RAD; - } + (*this->start)(i) *= rl::math::DEG2RAD; } } *this->q = *this->start; - rl::xml::Object goal = path.eval("//goal//q"); - this->goal = boost::make_shared< rl::math::Vector >(goal.getNodeNr()); + rl::xml::NodeSet goal = path.eval("(/rl/plan|/rlplan)//goal/q").getValue(); + this->goal = std::make_shared(goal.size()); - for (int i = 0; i < goal.getNodeNr(); ++i) + for (int i = 0; i < goal.size(); ++i) { - (*this->goal)(i) = std::atof(goal.getNodeTab(i).getContent().c_str()); + (*this->goal)(i) = std::atof(goal[i].getContent().c_str()); - if (goal.getNodeTab(i).hasAttribute("unit")) + if ("deg" == goal[i].getProperty("unit")) { - if ("deg" == goal.getNodeTab(i).getAttribute("unit").getValue()) - { - (*this->goal)(i) *= rl::math::DEG2RAD; - } + (*this->goal)(i) *= rl::math::DEG2RAD; } } - rl::xml::Object sigma = path.eval("//sigma//q"); - this->sigma = boost::make_shared< rl::math::Vector >(sigma.getNodeNr()); - - for (int i = 0; i < sigma.getNodeNr(); ++i) + if (path.eval("count((/rl/plan|/rlplan)//sigma) > 0").getValue()) { - (*this->sigma)(i) = std::atof(sigma.getNodeTab(i).getContent().c_str()); + rl::xml::NodeSet sigma = path.eval("(/rl/plan|/rlplan)//sigma/q").getValue(); + this->sigma = std::make_shared(sigma.size()); - if (sigma.getNodeTab(i).hasAttribute("unit")) + for (int i = 0; i < sigma.size(); ++i) { - if ("deg" == sigma.getNodeTab(i).getAttribute("unit").getValue()) + (*this->sigma)(i) = std::atof(sigma[i].getContent().c_str()); + + if ("deg" == sigma[i].getProperty("unit")) { (*this->sigma)(i) *= rl::math::DEG2RAD; } } } - if (path.eval("count(//uniformSampler) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//uniformSampler) > 0").getValue()) { - this->sampler = boost::make_shared< rl::plan::UniformSampler >(); - rl::plan::UniformSampler* uniformSampler = static_cast< rl::plan::UniformSampler* >(this->sampler.get()); + this->sampler = std::make_shared(); + rl::plan::UniformSampler* uniformSampler = static_cast(this->sampler.get()); - if (path.eval("count(//uniformSampler/seed) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//uniformSampler/seed) > 0").getValue()) { uniformSampler->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(//uniformSampler/seed)").getFloatval(rl::util::Timer::now() * 1000000.0f)) + path.eval("number((/rl/plan|/rlplan)//uniformSampler/seed)").getValue(std::random_device()()) ); } + else if (this->seed) + { + uniformSampler->seed(*this->seed); + } } - else if (path.eval("count(//gaussianSampler) > 0").getBoolval()) + else if (path.eval("count((/rl/plan|/rlplan)//gaussianSampler) > 0").getValue()) { - this->sampler = boost::make_shared< rl::plan::GaussianSampler >(); - rl::plan::GaussianSampler* gaussianSampler = static_cast< rl::plan::GaussianSampler* >(this->sampler.get()); + this->sampler = std::make_shared(); + rl::plan::GaussianSampler* gaussianSampler = static_cast(this->sampler.get()); - if (path.eval("count(//gaussianSampler/seed) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//gaussianSampler/seed) > 0").getValue()) { gaussianSampler->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(//gaussianSampler/seed)").getFloatval(rl::util::Timer::now() * 1000000.0f)) + path.eval("number((/rl/plan|/rlplan)//gaussianSampler/seed)").getValue(std::random_device()()) ); } + else if (this->seed) + { + gaussianSampler->seed(*this->seed); + } gaussianSampler->sigma = this->sigma.get(); } - else if (path.eval("count(//bridgeSampler) > 0").getBoolval()) + else if (path.eval("count((/rl/plan|/rlplan)//bridgeSampler) > 0").getValue()) { - this->sampler = boost::make_shared< rl::plan::BridgeSampler >(); - rl::plan::BridgeSampler* bridgeSampler = static_cast< rl::plan::BridgeSampler* >(this->sampler.get()); - bridgeSampler->ratio = path.eval("number(//bridgeSampler/ratio)").getFloatval(5.0f / 6.0f); + this->sampler = std::make_shared(); + rl::plan::BridgeSampler* bridgeSampler = static_cast(this->sampler.get()); + bridgeSampler->ratio = path.eval("number((/rl/plan|/rlplan)//bridgeSampler/ratio)").getValue(5.0f / 6.0f); - if (path.eval("count(//bridgeSampler/seed) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//bridgeSampler/seed) > 0").getValue()) { bridgeSampler->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(//bridgeSampler/seed)").getFloatval(rl::util::Timer::now() * 1000000.0f)) + path.eval("number((/rl/plan|/rlplan)//bridgeSampler/seed)").getValue(std::random_device()()) ); } + else if (this->seed) + { + bridgeSampler->seed(*this->seed); + } bridgeSampler->sigma = this->sigma.get(); } - if (NULL != this->sampler) + if (nullptr != this->sampler) { this->sampler->model = this->model.get(); } - this->sampler2 = boost::make_shared< rl::plan::UniformSampler >(); + this->sampler2 = std::make_shared(); this->sampler2->model = this->model.get(); - if (path.eval("count(//recursiveVerifier) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//recursiveVerifier) > 0").getValue()) { - this->verifier = boost::make_shared< rl::plan::RecursiveVerifier >(); - this->verifier->delta = path.eval("number(//recursiveVerifier/delta)").getFloatval(1.0f); + this->verifier = std::make_shared(); + this->verifier->delta = path.eval("number((/rl/plan|/rlplan)//recursiveVerifier/delta)").getValue(1); - if ("deg" == path.eval("string(//recursiveVerifier/delta/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//recursiveVerifier/delta/@unit)").getValue()) { this->verifier->delta *= rl::math::DEG2RAD; } } - else if (path.eval("count(//sequentialVerifier) > 0").getBoolval()) + else if (path.eval("count((/rl/plan|/rlplan)//sequentialVerifier) > 0").getValue()) { - this->verifier = boost::make_shared< rl::plan::SequentialVerifier >(); - this->verifier->delta = path.eval("number(//sequentialVerifier/delta)").getFloatval(1.0f); + this->verifier = std::make_shared(); + this->verifier->delta = path.eval("number((/rl/plan|/rlplan)//sequentialVerifier/delta)").getValue(1); - if ("deg" == path.eval("string(//sequentialVerifier/delta/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//sequentialVerifier/delta/@unit)").getValue()) { this->verifier->delta *= rl::math::DEG2RAD; } } - if (NULL != this->verifier) + if (nullptr != this->verifier) { this->verifier->model = this->model.get(); } - if (path.eval("count(//simpleOptimizer/recursiveVerifier) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//simpleOptimizer/recursiveVerifier) > 0").getValue()) { - this->verifier2 = boost::make_shared< rl::plan::RecursiveVerifier >(); - this->verifier2->delta = path.eval("number(//simpleOptimizer/recursiveVerifier/delta)").getFloatval(1.0f); + this->verifier2 = std::make_shared(); + this->verifier2->delta = path.eval("number((/rl/plan|/rlplan)//simpleOptimizer/recursiveVerifier/delta)").getValue(1); - if ("deg" == path.eval("string(//simpleOptimizer/recursiveVerifier/delta/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//simpleOptimizer/recursiveVerifier/delta/@unit)").getValue()) { this->verifier2->delta *= rl::math::DEG2RAD; } } - else if (path.eval("count(//advancedOptimizer/recursiveVerifier) > 0").getBoolval()) + else if (path.eval("count((/rl/plan|/rlplan)//advancedOptimizer/recursiveVerifier) > 0").getValue()) { - this->verifier2 = boost::make_shared< rl::plan::RecursiveVerifier >(); - this->verifier2->delta = path.eval("number(//advancedOptimizer/recursiveVerifier/delta)").getFloatval(1.0f); + this->verifier2 = std::make_shared(); + this->verifier2->delta = path.eval("number((/rl/plan|/rlplan)//advancedOptimizer/recursiveVerifier/delta)").getValue(1); - if ("deg" == path.eval("string(//advancedOptimizer/recursiveVerifier/delta/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//advancedOptimizer/recursiveVerifier/delta/@unit)").getValue()) { this->verifier2->delta *= rl::math::DEG2RAD; } } - if (NULL != this->verifier2) + if (nullptr != this->verifier2) { this->verifier2->model = this->model.get(); } this->optimizer.reset(); - if (path.eval("count(//simpleOptimizer) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//simpleOptimizer) > 0").getValue()) { - this->optimizer = boost::make_shared< rl::plan::SimpleOptimizer >(); + this->optimizer = std::make_shared(); } - else if (path.eval("count(//advancedOptimizer) > 0").getBoolval()) + else if (path.eval("count((/rl/plan|/rlplan)//advancedOptimizer) > 0").getValue()) { - this->optimizer = boost::make_shared< rl::plan::AdvancedOptimizer >(); - rl::plan::AdvancedOptimizer* advancedOptimizer = static_cast< rl::plan::AdvancedOptimizer* >(this->optimizer.get()); - advancedOptimizer->length = path.eval("number(//advancedOptimizer/length)").getFloatval(1.0f); + this->optimizer = std::make_shared(); + rl::plan::AdvancedOptimizer* advancedOptimizer = static_cast(this->optimizer.get()); + advancedOptimizer->length = path.eval("number((/rl/plan|/rlplan)//advancedOptimizer/length)").getValue(1); - if ("deg" == path.eval("string(//advancedOptimizer/length/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//advancedOptimizer/length/@unit)").getValue()) { advancedOptimizer->length *= rl::math::DEG2RAD; } - advancedOptimizer->ratio = path.eval("number(//advancedOptimizer/ratio)").getFloatval(0.1f); + advancedOptimizer->ratio = path.eval("number((/rl/plan|/rlplan)//advancedOptimizer/ratio)").getValue(0.1f); } - if (NULL != this->optimizer) + if (nullptr != this->optimizer) { this->optimizer->model = this->model.get(); this->optimizer->verifier = this->verifier2.get(); } - rl::xml::Object planner = path.eval("//addRrtConCon|//eet|//prm|//prmUtilityGuided|//rrt|//rrtCon|//rrtConCon|//rrtConExt|//rrtDual|//rrtGoalBias|//rrtExtCon|//rrtExtExt"); + rl::xml::NodeSet planners = path.eval("(/rl/plan|/rlplan)//addRrtConCon|(/rl/plan|/rlplan)//eet|(/rl/plan|/rlplan)//prm|(/rl/plan|/rlplan)//prmUtilityGuided|(/rl/plan|/rlplan)//rrt|(/rl/plan|/rlplan)//rrtCon|(/rl/plan|/rlplan)//rrtConCon|(/rl/plan|/rlplan)//rrtConExt|(/rl/plan|/rlplan)//rrtDual|(/rl/plan|/rlplan)//rrtGoalBias|(/rl/plan|/rlplan)//rrtExtCon|(/rl/plan|/rlplan)//rrtExtExt").getValue(); - if ("addRrtConCon" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::AddRrtConCon >(); - rl::plan::AddRrtConCon* addRrtConCon = static_cast< rl::plan::AddRrtConCon* >(this->planner.get()); - addRrtConCon->alpha = path.eval("number(alpha)", planner.getNodeTab(0)).getFloatval(0.05f); - addRrtConCon->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) - { - addRrtConCon->delta *= rl::math::DEG2RAD; - } - - addRrtConCon->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) - { - addRrtConCon->epsilon *= rl::math::DEG2RAD; - } - - addRrtConCon->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - addRrtConCon->lower = path.eval("number(lower)", planner.getNodeTab(0)).getFloatval(2.0f); - - if ("deg" == path.eval("string(lower/@unit)", planner.getNodeTab(0)).getStringval()) - { - addRrtConCon->lower *= rl::math::DEG2RAD; - } - - addRrtConCon->radius = path.eval("number(radius)", planner.getNodeTab(0)).getFloatval(20.0f); - - if ("deg" == path.eval("string(radius/@unit)", planner.getNodeTab(0)).getStringval()) - { - addRrtConCon->radius *= rl::math::DEG2RAD; - } - - addRrtConCon->sampler = this->sampler.get(); - } - else if ("eet" == planner.getNodeTab(0).getName()) + for (int i = 0; i < std::min(1, planners.size()); ++i) { - this->planner = boost::make_shared< rl::plan::Eet >(); - rl::plan::Eet* eet = static_cast< rl::plan::Eet* >(this->planner.get()); - eet->alpha = path.eval("number(alpha)", planner.getNodeTab(0)).getFloatval(0.01f); - eet->alternativeDistanceComputation = path.eval("count(alternativeDistanceComputation) > 0", planner.getNodeTab(0)).getBoolval() ? true : false; - eet->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); + rl::xml::Path path(document, planners[i]); - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + if ("addRrtConCon" == planners[i].getName()) { - eet->delta *= rl::math::DEG2RAD; - } - - eet->distanceWeight = path.eval("number(distanceWeight)", planner.getNodeTab(0)).getFloatval(0.1f); - eet->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) - { - eet->epsilon *= rl::math::DEG2RAD; - } - - eet->gamma = path.eval("number(gamma)", planner.getNodeTab(0)).getFloatval(1.f/3.f); - eet->goalEpsilon = path.eval("number(goalEpsilon)", planner.getNodeTab(0)).getFloatval(0.1f); - - if (path.eval("translate(string(goalEpsilon/@orientation), 'TRUE', 'true') = 'true' or string(goalEpsilon/@orientation) = '1'", planner.getNodeTab(0)).getBoolval()) - { - eet->goalEpsilonUseOrientation = true; - } - else - { - eet->goalEpsilonUseOrientation = false; - } - - eet->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - eet->max.x() = path.eval("number(max/x)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->max.y() = path.eval("number(max/y)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->max.z() = path.eval("number(max/z)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->min.x() = path.eval("number(min/x)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->min.y() = path.eval("number(min/y)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->min.z() = path.eval("number(min/z)", planner.getNodeTab(0)).getFloatval(0.0f); - eet->sampler = this->sampler.get(); - - if (path.eval("count(seed) > 0", planner.getNodeTab(0)).getBoolval()) - { - eet->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(seed)", planner.getNodeTab(0)).getFloatval(rl::util::Timer::now() * 1000000.0f)) - ); - } - - rl::xml::Object explorers = path.eval("explorer", planner.getNodeTab(0)); - - for (int i = 0; i < explorers.getNodeNr(); ++i) - { - boost::shared_ptr< rl::plan::WorkspaceSphereExplorer > explorer = boost::make_shared< rl::plan::WorkspaceSphereExplorer >(); - this->explorers.push_back(explorer); - eet->explorers.push_back(explorer.get()); - - rl::plan::Eet::ExplorerSetup explorerSetup; - - boost::shared_ptr< rl::math::Vector3 > explorerStart = boost::make_shared< rl::math::Vector3 >(); - this->explorerStarts.push_back(explorerStart); - explorer->start = explorerStart.get(); - - (*explorerStart).x() = path.eval("number(start/x)", explorers.getNodeTab(i)).getFloatval(0.0f); - (*explorerStart).y() = path.eval("number(start/y)", explorers.getNodeTab(i)).getFloatval(0.0f); - (*explorerStart).z() = path.eval("number(start/z)", explorers.getNodeTab(i)).getFloatval(0.0f); + this->planner = std::make_shared(); + rl::plan::AddRrtConCon* addRrtConCon = static_cast(this->planner.get()); + addRrtConCon->alpha = path.eval("number(alpha)").getValue(0.05f); + addRrtConCon->delta = path.eval("number(delta)").getValue(1); - if (path.eval("count(start/goal) > 0", explorers.getNodeTab(i)).getBoolval()) + if ("deg" == path.eval("string(delta/@unit)").getValue()) { - explorerSetup.startConfiguration = this->goal.get(); + addRrtConCon->delta *= rl::math::DEG2RAD; } - else if (path.eval("count(start/start) > 0", explorers.getNodeTab(i)).getBoolval()) + + addRrtConCon->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) { - explorerSetup.startConfiguration = this->start.get(); + addRrtConCon->epsilon *= rl::math::DEG2RAD; } - else + + addRrtConCon->lower = path.eval("number(lower)").getValue(2); + + if ("deg" == path.eval("string(lower/@unit)").getValue()) { - explorerSetup.startConfiguration = NULL; + addRrtConCon->lower *= rl::math::DEG2RAD; } - if (path.eval("count(start//frame) > 0", explorers.getNodeTab(i)).getBoolval()) + addRrtConCon->radius = path.eval("number(radius)").getValue(20); + + if ("deg" == path.eval("string(radius/@unit)").getValue()) { - explorerSetup.startFrame = static_cast< int >(path.eval("number(start//frame)", explorers.getNodeTab(i)).getFloatval()); + addRrtConCon->radius *= rl::math::DEG2RAD; } - else if (path.eval("count(start//tcp) > 0", explorers.getNodeTab(i)).getBoolval()) + + addRrtConCon->sampler = this->sampler.get(); + } + else if ("eet" == planners[i].getName()) + { + this->planner = std::make_shared(); + rl::plan::Eet* eet = static_cast(this->planner.get()); + eet->alpha = path.eval("number(alpha)").getValue(0.01f); + eet->alternativeDistanceComputation = path.eval("count(alternativeDistanceComputation) > 0").getValue() ? true : false; + eet->beta = path.eval("number(beta)").getValue(0); + eet->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) { - explorerSetup.startFrame = -1; + eet->delta *= rl::math::DEG2RAD; } - boost::shared_ptr< rl::math::Vector3 > explorerGoal = boost::make_shared< rl::math::Vector3 >(); - this->explorerGoals.push_back(explorerGoal); - explorer->goal = explorerGoal.get(); - - (*explorerGoal).x() = path.eval("number(goal/x)", explorers.getNodeTab(i)).getFloatval(0.0f); - (*explorerGoal).y() = path.eval("number(goal/y)", explorers.getNodeTab(i)).getFloatval(0.0f); - (*explorerGoal).z() = path.eval("number(goal/z)", explorers.getNodeTab(i)).getFloatval(0.0f); + eet->distanceWeight = path.eval("number(distanceWeight)").getValue(0.1f); + eet->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); - if (path.eval("count(goal/goal) > 0", explorers.getNodeTab(i)).getBoolval()) + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) { - explorerSetup.goalConfiguration = this->goal.get(); + eet->epsilon *= rl::math::DEG2RAD; } - else if (path.eval("count(goal/start) > 0", explorers.getNodeTab(i)).getBoolval()) + + eet->gamma = path.eval("number(gamma)").getValue(1.0f / 3.0f); + eet->goalEpsilon = path.eval("number(goalEpsilon)").getValue(0.1f); + + if (path.eval("translate(string(goalEpsilon/@orientation), 'TRUE', 'true') = 'true' or string(goalEpsilon/@orientation) = '1'").getValue()) { - explorerSetup.goalConfiguration = this->start.get(); + eet->goalEpsilonUseOrientation = true; } else { - explorerSetup.goalConfiguration = NULL; + eet->goalEpsilonUseOrientation = false; } - if (path.eval("count(goal//frame) > 0", explorers.getNodeTab(i)).getBoolval()) + eet->max.x() = path.eval("number(max/x)").getValue(0); + eet->max.y() = path.eval("number(max/y)").getValue(0); + eet->max.z() = path.eval("number(max/z)").getValue(0); + eet->min.x() = path.eval("number(min/x)").getValue(0); + eet->min.y() = path.eval("number(min/y)").getValue(0); + eet->min.z() = path.eval("number(min/z)").getValue(0); + eet->sampler = this->sampler.get(); + + if (path.eval("count(seed) > 0").getValue()) { - explorerSetup.goalFrame = static_cast< int >(path.eval("number(goal//frame)", explorers.getNodeTab(i)).getFloatval()); + eet->seed( + path.eval("number(seed)").getValue(std::random_device()()) + ); } - else if (path.eval("count(goal//tcp) > 0", explorers.getNodeTab(i)).getBoolval()) + else if (this->seed) { - explorerSetup.goalFrame = -1; + eet->seed(*this->seed); } - if (path.eval("count(distance) > 0", explorers.getNodeTab(i)).getBoolval()) + rl::xml::NodeSet explorers = path.eval("explorer").getValue(); + + for (int i = 0; i < explorers.size(); ++i) { - explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_DISTANCE; + rl::xml::Path path(document, explorers[i]); + + std::shared_ptr explorer = std::make_shared(); + this->explorers.push_back(explorer); + eet->explorers.push_back(explorer.get()); + + rl::plan::Eet::ExplorerSetup explorerSetup; + + std::shared_ptr explorerStart = std::make_shared(); + this->explorerStarts.push_back(explorerStart); + explorer->start = explorerStart.get(); + + (*explorerStart).x() = path.eval("number(start/x)").getValue(0); + (*explorerStart).y() = path.eval("number(start/y)").getValue(0); + (*explorerStart).z() = path.eval("number(start/z)").getValue(0); + + if (path.eval("count(start/goal) > 0").getValue()) + { + explorerSetup.startConfiguration = this->goal.get(); + } + else if (path.eval("count(start/start) > 0").getValue()) + { + explorerSetup.startConfiguration = this->start.get(); + } + else + { + explorerSetup.startConfiguration = nullptr; + } + + if (path.eval("count(start//frame) > 0").getValue()) + { + explorerSetup.startFrame = path.eval("number(start//frame)").getValue(); + } + else if (path.eval("count(start//tcp) > 0").getValue()) + { + explorerSetup.startFrame = -1; + } + + std::shared_ptr explorerGoal = std::make_shared(); + this->explorerGoals.push_back(explorerGoal); + explorer->goal = explorerGoal.get(); + + (*explorerGoal).x() = path.eval("number(goal/x)").getValue(0); + (*explorerGoal).y() = path.eval("number(goal/y)").getValue(0); + (*explorerGoal).z() = path.eval("number(goal/z)").getValue(0); + + if (path.eval("count(goal/goal) > 0").getValue()) + { + explorerSetup.goalConfiguration = this->goal.get(); + } + else if (path.eval("count(goal/start) > 0").getValue()) + { + explorerSetup.goalConfiguration = this->start.get(); + } + else + { + explorerSetup.goalConfiguration = nullptr; + } + + if (path.eval("count(goal//frame) > 0").getValue()) + { + explorerSetup.goalFrame = path.eval("number(goal//frame)").getValue(); + } + else if (path.eval("count(goal//tcp) > 0").getValue()) + { + explorerSetup.goalFrame = -1; + } + + if (path.eval("count(distance) > 0").getValue()) + { + explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_DISTANCE; + } + else if (path.eval("count(sourceDistance) > 0").getValue()) + { + explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_SOURCE_DISTANCE; + } + else if (path.eval("count(space) > 0").getValue()) + { + explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_SPACE; + } + + if (rl::plan::DistanceModel* model = dynamic_cast(this->model.get())) + { + explorer->model = model; + } + else + { + throw std::runtime_error("selected engine does not support distance queries"); + } + + explorer->radius = path.eval("number(radius)").getValue(0); + explorer->range = path.eval("number(range)").getValue(std::numeric_limits::max()); + explorer->samples = path.eval("number(samples)").getValue(10); + + if (path.eval("count(seed) > 0").getValue()) + { + explorer->seed( + path.eval("number(seed)").getValue(std::random_device()()) + ); + } + else if (this->seed) + { + explorer->seed(*this->seed); + } + + eet->explorersSetup.push_back(explorerSetup); } - else if (path.eval("count(sourcedistance) > 0", explorers.getNodeTab(i)).getBoolval()) + } + else if ("prm" == planners[i].getName()) + { + this->planner = std::make_shared(); + rl::plan::Prm* prm = static_cast(this->planner.get()); + prm->degree = path.eval("number(degree)").getValue(std::numeric_limits::max()); + prm->k = path.eval("number(k)").getValue(30); + prm->radius = path.eval("number(radius)").getValue(std::numeric_limits::max()); + + if ("deg" == path.eval("string(radius/@unit)").getValue()) { - explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_SOURCE_DISTANCE; + prm->radius *= rl::math::DEG2RAD; } - else if (path.eval("count(space) > 0", explorers.getNodeTab(i)).getBoolval()) + + prm->sampler = this->sampler.get(); + prm->verifier = this->verifier.get(); + } + else if ("prmUtilityGuided" == planners[i].getName()) + { + this->planner = std::make_shared(); + rl::plan::PrmUtilityGuided* prmUtilityGuided = static_cast(this->planner.get()); + prmUtilityGuided->degree = path.eval("number(degree)").getValue(std::numeric_limits::max()); + prmUtilityGuided->k = path.eval("number(k)").getValue(30); + prmUtilityGuided->radius = path.eval("number(radius)").getValue(std::numeric_limits::max()); + + if ("deg" == path.eval("string(radius/@unit)").getValue()) { - explorer->greedy = rl::plan::WorkspaceSphereExplorer::GREEDY_SPACE; + prmUtilityGuided->radius *= rl::math::DEG2RAD; } - explorer->model = this->model.get(); - explorer->radius = path.eval("number(radius)", explorers.getNodeTab(i)).getFloatval(0.0f); - explorer->range = path.eval("number(range)", explorers.getNodeTab(i)).getFloatval(std::numeric_limits< rl::math::Real >::max()); - explorer->samples = static_cast< int >(path.eval("number(samples)", explorers.getNodeTab(i)).getFloatval(10.0f)); - - if (path.eval("count(seed) > 0", explorers.getNodeTab(i)).getBoolval()) + if (path.eval("count(seed) > 0").getValue()) { - explorer->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(seed)", explorers.getNodeTab(i)).getFloatval(rl::util::Timer::now() * 1000000.0f)) + prmUtilityGuided->seed( + path.eval("number(seed)").getValue(std::random_device()()) ); } + else if (this->seed) + { + prmUtilityGuided->seed(*this->seed); + } - eet->explorersSetup.push_back(explorerSetup); + prmUtilityGuided->sampler = this->sampler.get(); + prmUtilityGuided->verifier = this->verifier.get(); } - } - else if ("prm" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::Prm >(); - rl::plan::Prm* prm = static_cast< rl::plan::Prm* >(this->planner.get()); - prm->degree = static_cast< int >(path.eval("number(degree)", planner.getNodeTab(0)).getFloatval(std::numeric_limits< std::size_t >::max())); - prm->k = static_cast< int >(path.eval("number(k)", planner.getNodeTab(0)).getFloatval(30.0f)); - prm->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - prm->radius = path.eval("number(radius)", planner.getNodeTab(0)).getFloatval(std::numeric_limits< rl::math::Real >::max()); - - if ("deg" == path.eval("string(radius/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrt" == planners[i].getName()) { - prm->radius *= rl::math::DEG2RAD; - } - - prm->sampler = this->sampler.get(); - prm->verifier = this->verifier.get(); - } - else if ("prmUtilityGuided" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::PrmUtilityGuided >(); - rl::plan::PrmUtilityGuided* prmUtilityGuided = static_cast< rl::plan::PrmUtilityGuided* >(this->planner.get()); - prmUtilityGuided->degree = static_cast< int >(path.eval("number(degree)", planner.getNodeTab(0)).getFloatval(std::numeric_limits< std::size_t >::max())); - prmUtilityGuided->k = static_cast< int >(path.eval("number(k)", planner.getNodeTab(0)).getFloatval(30.0f)); - prmUtilityGuided->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - prmUtilityGuided->radius = path.eval("number(radius)", planner.getNodeTab(0)).getFloatval(std::numeric_limits< rl::math::Real >::max()); - - if ("deg" == path.eval("string(radius/@unit)", planner.getNodeTab(0)).getStringval()) - { - prmUtilityGuided->radius *= rl::math::DEG2RAD; - } - - if (path.eval("count(seed) > 0", planner.getNodeTab(0)).getBoolval()) - { - prmUtilityGuided->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(seed)", planner.getNodeTab(0)).getFloatval(rl::util::Timer::now() * 1000000.0f)) - ); - } - - prmUtilityGuided->sampler = this->sampler.get(); - prmUtilityGuided->verifier = this->verifier.get(); - } - else if ("rrt" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::Rrt >(); - rl::plan::Rrt* rrt = static_cast< rl::plan::Rrt* >(this->planner.get()); - rrt->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) - { - rrt->delta *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::Rrt* rrt = static_cast(this->planner.get()); + rrt->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrt->delta *= rl::math::DEG2RAD; + } + + rrt->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrt->epsilon *= rl::math::DEG2RAD; + } + + rrt->sampler = this->sampler.get(); } - - rrt->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrtCon" == planners[i].getName()) { - rrt->epsilon *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::RrtCon* rrtCon = static_cast(this->planner.get()); + rrtCon->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtCon->delta *= rl::math::DEG2RAD; + } + + rrtCon->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtCon->epsilon *= rl::math::DEG2RAD; + } + + rrtCon->probability = path.eval("number(probability)").getValue(0.05f); + rrtCon->sampler = this->sampler.get(); + + if (path.eval("count(seed) > 0").getValue()) + { + rrtCon->seed( + path.eval("number(seed)").getValue(std::random_device()()) + ); + } + else if (this->seed) + { + rrtCon->seed(*this->seed); + } } - - rrt->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrt->sampler = this->sampler.get(); - } - else if ("rrtCon" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::RrtCon >(); - rl::plan::RrtCon* rrtCon = static_cast< rl::plan::RrtCon* >(this->planner.get()); - rrtCon->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrtConCon" == planners[i].getName()) { - rrtCon->delta *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::RrtConCon* rrtConCon = static_cast(this->planner.get()); + rrtConCon->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtConCon->delta *= rl::math::DEG2RAD; + } + + rrtConCon->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtConCon->epsilon *= rl::math::DEG2RAD; + } + + rrtConCon->sampler = this->sampler.get(); } - - rrtCon->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrtDual" == planners[i].getName()) { - rrtCon->epsilon *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::RrtDual* rrtDual = static_cast(this->planner.get()); + rrtDual->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtDual->delta *= rl::math::DEG2RAD; + } + + rrtDual->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtDual->epsilon *= rl::math::DEG2RAD; + } + + rrtDual->sampler = this->sampler.get(); } - - rrtCon->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtCon->probability = path.eval("number(probability)", planner.getNodeTab(0)).getFloatval(0.05f); - rrtCon->sampler = this->sampler.get(); - - if (path.eval("count(seed) > 0", planner.getNodeTab(0)).getBoolval()) + else if ("rrtExtCon" == planners[i].getName()) { - rrtCon->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(seed)", planner.getNodeTab(0)).getFloatval(rl::util::Timer::now() * 1000000.0f)) - ); + this->planner = std::make_shared(); + rl::plan::RrtExtCon* rrtExtCon = static_cast(this->planner.get()); + rrtExtCon->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtExtCon->delta *= rl::math::DEG2RAD; + } + + rrtExtCon->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtExtCon->epsilon *= rl::math::DEG2RAD; + } + + rrtExtCon->sampler = this->sampler.get(); } - } - else if ("rrtConCon" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::RrtConCon >(); - rl::plan::RrtConCon* rrtConCon = static_cast< rl::plan::RrtConCon* >(this->planner.get()); - rrtConCon->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrtExtExt" == planners[i].getName()) { - rrtConCon->delta *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::RrtExtExt* rrtExtExt = static_cast(this->planner.get()); + rrtExtExt->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtExtExt->delta *= rl::math::DEG2RAD; + } + + rrtExtExt->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtExtExt->epsilon *= rl::math::DEG2RAD; + } + + rrtExtExt->sampler = this->sampler.get(); } - - rrtConCon->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) + else if ("rrtGoalBias" == planners[i].getName()) { - rrtConCon->epsilon *= rl::math::DEG2RAD; + this->planner = std::make_shared(); + rl::plan::RrtGoalBias* rrtGoalBias = static_cast(this->planner.get()); + rrtGoalBias->delta = path.eval("number(delta)").getValue(1); + + if ("deg" == path.eval("string(delta/@unit)").getValue()) + { + rrtGoalBias->delta *= rl::math::DEG2RAD; + } + + rrtGoalBias->epsilon = path.eval("number(epsilon)").getValue(1.0e-3f); + + if ("deg" == path.eval("string(epsilon/@unit)").getValue()) + { + rrtGoalBias->epsilon *= rl::math::DEG2RAD; + } + + rrtGoalBias->probability = path.eval("number(probability)").getValue(0.05f); + rrtGoalBias->sampler = this->sampler.get(); + + if (path.eval("count(seed) > 0").getValue()) + { + rrtGoalBias->seed( + path.eval("number(seed)").getValue(std::random_device()()) + ); + } + else if (this->seed) + { + rrtGoalBias->seed(*this->seed); + } } - - rrtConCon->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtConCon->sampler = this->sampler.get(); } - else if ("rrtDual" == planner.getNodeTab(0).getName()) + + std::size_t nearestNeighborsSize = 1; + + if (rl::plan::RrtDual* rrtDual = dynamic_cast(this->planner.get())) { - this->planner = boost::make_shared< rl::plan::RrtDual >(); - rl::plan::RrtDual* rrtDual = static_cast< rl::plan::RrtDual* >(this->planner.get()); - rrtDual->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) - { - rrtDual->delta *= rl::math::DEG2RAD; - } - - rrtDual->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) - { - rrtDual->epsilon *= rl::math::DEG2RAD; - } - - rrtDual->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtDual->sampler = this->sampler.get(); + nearestNeighborsSize = 2; } - else if ("rrtExtCon" == planner.getNodeTab(0).getName()) + + for (::std::size_t i = 0; i < nearestNeighborsSize; ++i) { - this->planner = boost::make_shared< rl::plan::RrtExtCon >(); - rl::plan::RrtExtCon* rrtExtCon = static_cast< rl::plan::RrtExtCon* >(this->planner.get()); - rrtExtCon->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); + std::shared_ptr nearestNeighbors; - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors) > 0").getValue()) { - rrtExtCon->delta *= rl::math::DEG2RAD; + std::shared_ptr gnatNearestNeighbors = std::make_shared(this->model.get()); + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/checks) > 0").getValue()) + { + gnatNearestNeighbors->setChecks( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/checks)").getValue(0) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/node/data/@max) > 0").getValue()) + { + gnatNearestNeighbors->setNodeDataMax( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/node/data/@max)").getValue(50) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree) > 0").getValue()) + { + gnatNearestNeighbors->setNodeDegree( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree)").getValue(8) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree/@max) > 0").getValue()) + { + gnatNearestNeighbors->setNodeDegreeMax( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree/@max)").getValue(12) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree/@min) > 0").getValue()) + { + gnatNearestNeighbors->setNodeDegreeMin( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/node/degree/@min)").getValue(4) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//gnatNearestNeighbors/seed) > 0").getValue()) + { + gnatNearestNeighbors->seed( + path.eval("number((/rl/plan|/rlplan)//gnatNearestNeighbors/seed)").getValue(std::random_device()()) + ); + } + else if (this->seed) + { + gnatNearestNeighbors->seed(*this->seed); + } + + nearestNeighbors = gnatNearestNeighbors; } - - rrtExtCon->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) + else if (path.eval("count((/rl/plan|/rlplan)//kdtreeBoundingBoxNearestNeighbors) > 0").getValue()) { - rrtExtCon->epsilon *= rl::math::DEG2RAD; + std::shared_ptr kdtreeBoundingBoxNearestNeighbors = std::make_shared(this->model.get()); + + if (path.eval("count((/rl/plan|/rlplan)//kdtreeBoundingBoxNearestNeighbors/checks) > 0").getValue()) + { + kdtreeBoundingBoxNearestNeighbors->setChecks( + path.eval("number((/rl/plan|/rlplan)//kdtreeBoundingBoxNearestNeighbors/checks)").getValue(0) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//kdtreeBoundingBoxNearestNeighbors/node/data/@max) > 0").getValue()) + { + kdtreeBoundingBoxNearestNeighbors->setNodeDataMax( + path.eval("number((/rl/plan|/rlplan)//kdtreeBoundingBoxNearestNeighbors/node/data/@max)").getValue(10) + ); + } + + nearestNeighbors = kdtreeBoundingBoxNearestNeighbors; } - - rrtExtCon->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtExtCon->sampler = this->sampler.get(); - } - else if ("rrtExtExt" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::RrtExtExt >(); - rl::plan::RrtExtExt* rrtExtExt = static_cast< rl::plan::RrtExtExt* >(this->planner.get()); - rrtExtExt->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + else if (path.eval("count((/rl/plan|/rlplan)//kdtreeNearestNeighbors) > 0").getValue()) { - rrtExtExt->delta *= rl::math::DEG2RAD; - } - - rrtExtExt->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); - - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) - { - rrtExtExt->epsilon *= rl::math::DEG2RAD; + std::shared_ptr kdtreeNearestNeighbors = std::make_shared(this->model.get()); + + if (path.eval("count((/rl/plan|/rlplan)//kdtreeNearestNeighbors/checks) > 0").getValue()) + { + kdtreeNearestNeighbors->setChecks( + path.eval("number((/rl/plan|/rlplan)//kdtreeNearestNeighbors/checks)").getValue(0) + ); + } + + if (path.eval("count((/rl/plan|/rlplan)//kdtreeNearestNeighbors/samples) > 0").getValue()) + { + kdtreeNearestNeighbors->setSamples( + path.eval("number((/rl/plan|/rlplan)//kdtreeNearestNeighbors/samples)").getValue(100) + ); + } + + nearestNeighbors = kdtreeNearestNeighbors; } - - rrtExtExt->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtExtExt->sampler = this->sampler.get(); - } - else if ("rrtGoalBias" == planner.getNodeTab(0).getName()) - { - this->planner = boost::make_shared< rl::plan::RrtGoalBias >(); - rl::plan::RrtGoalBias* rrtGoalBias = static_cast< rl::plan::RrtGoalBias* >(this->planner.get()); - rrtGoalBias->delta = path.eval("number(delta)", planner.getNodeTab(0)).getFloatval(1.0f); - - if ("deg" == path.eval("string(delta/@unit)", planner.getNodeTab(0)).getStringval()) + else { - rrtGoalBias->delta *= rl::math::DEG2RAD; + std::shared_ptr linearNearestNeighbors = std::make_shared(this->model.get()); + nearestNeighbors = linearNearestNeighbors; } - rrtGoalBias->epsilon = path.eval("number(epsilon)", planner.getNodeTab(0)).getFloatval(1.0e-3f); + this->nearestNeighbors.push_back(nearestNeighbors); - if ("deg" == path.eval("string(epsilon/@unit)", planner.getNodeTab(0)).getStringval()) + if (rl::plan::Prm* prm = dynamic_cast(this->planner.get())) { - rrtGoalBias->epsilon *= rl::math::DEG2RAD; + prm->setNearestNeighbors(nearestNeighbors.get()); } - - rrtGoalBias->kd = path.eval("count(bruteForce) > 0", planner.getNodeTab(0)).getBoolval() ? false : true; - rrtGoalBias->probability = path.eval("number(probability)", planner.getNodeTab(0)).getFloatval(0.05f); - rrtGoalBias->sampler = this->sampler.get(); - - if (path.eval("count(seed) > 0", planner.getNodeTab(0)).getBoolval()) + if (rl::plan::Rrt* rrt = dynamic_cast(this->planner.get())) { - rrtGoalBias->seed( - static_cast< boost::mt19937::result_type >(path.eval("number(seed)", planner.getNodeTab(0)).getFloatval(rl::util::Timer::now() * 1000000.0f)) - ); + rrt->setNearestNeighbors(nearestNeighbors.get(), i); } } - this->planner->duration = path.eval("number(//duration)").getFloatval(std::numeric_limits< rl::math::Real >::max()); + this->planner->duration = std::chrono::duration_cast( + std::chrono::duration( + path.eval("number((/rl/plan|/rlplan)//duration)").getValue(std::numeric_limits::max()) + ) + ); + this->planner->goal = this->goal.get(); this->planner->model = this->model.get(); this->planner->start = this->start.get(); - this->viewer->delta = path.eval("number(//viewer/delta)").getFloatval(); + this->viewer->delta = path.eval("number((/rl/plan|/rlplan)//viewer/delta)").getValue(); - if ("deg" == path.eval("string(//viewer/delta/@unit)").getStringval()) + if ("deg" == path.eval("string((/rl/plan|/rlplan)//viewer/delta/@unit)").getValue()) { this->viewer->delta *= rl::math::DEG2RAD; } + this->viewer->deltaSwept = path.eval("number((/rl/plan|/rlplan)//viewer/swept)").getValue(this->viewer->delta * 100); + + if ("deg" == path.eval("string((/rl/plan|/rlplan)//viewer/swept/@unit)").getValue()) + { + this->viewer->deltaSwept *= rl::math::DEG2RAD; + } + this->viewer->sceneGroup->addChild(this->scene2->root); this->viewer->model = this->model2.get(); this->configurationSpaceScene->model = this->model.get(); - if (this->toggleViewAction->isChecked()) + if (this->toggleViewActiveAction->isChecked()) { - this->toggleView(true); + this->toggleViewActive(true); } else { - this->toggleView(false); + this->toggleViewActive(false); } - if (path.eval("count(//viewer/swept) > 0").getBoolval()) + if (this->toggleConfigurationSpaceActiveAction->isChecked()) { - this->thread->swept = true; + this->toggleConfigurationSpaceActive(true); + } + else + { + this->toggleConfigurationSpaceActive(false); } - this->viewer->viewer->setBackgroundColor(SbColor( - path.eval("number(//viewer/background/r)").getFloatval(0.0f), - path.eval("number(//viewer/background/g)").getFloatval(0.0f), - path.eval("number(//viewer/background/b)").getFloatval(0.0f) - )); - - if (path.eval("count(//viewer/camera/orthographic) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//viewer/camera/orthographic) > 0").getValue()) { this->viewer->viewer->setCameraType(SoOrthographicCamera::getClassTypeId()); } @@ -1511,93 +1879,44 @@ MainWindow::load(const QString& filename) this->viewer->viewer->viewAll(); this->viewer->viewer->getCamera()->position.setValue( - path.eval("number(//viewer/camera/position/x)").getFloatval(this->viewer->viewer->getCamera()->position.getValue()[0]), - path.eval("number(//viewer/camera/position/y)").getFloatval(this->viewer->viewer->getCamera()->position.getValue()[1]), - path.eval("number(//viewer/camera/position/z)").getFloatval(this->viewer->viewer->getCamera()->position.getValue()[2]) + path.eval("number((/rl/plan|/rlplan)//viewer/camera/position/x)").getValue(this->viewer->viewer->getCamera()->position.getValue()[0]), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/position/y)").getValue(this->viewer->viewer->getCamera()->position.getValue()[1]), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/position/z)").getValue(this->viewer->viewer->getCamera()->position.getValue()[2]) ); - if (path.eval("count(//viewer/camera/target) > 0").getBoolval()) + if (path.eval("count((/rl/plan|/rlplan)//viewer/camera/target) > 0").getValue()) { this->viewer->viewer->getCamera()->pointAt( SbVec3f( - path.eval("number(//viewer/camera/target/x)").getFloatval(0), - path.eval("number(//viewer/camera/target/y)").getFloatval(0), - path.eval("number(//viewer/camera/target/z)").getFloatval(0) + path.eval("number((/rl/plan|/rlplan)//viewer/camera/target/x)").getValue(0), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/target/y)").getValue(0), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/target/z)").getValue(0) ), SbVec3f( - path.eval("number(//viewer/camera/up/x)").getFloatval(0), - path.eval("number(//viewer/camera/up/y)").getFloatval(0), - path.eval("number(//viewer/camera/up/z)").getFloatval(1) + path.eval("number((/rl/plan|/rlplan)//viewer/camera/up/x)").getValue(0), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/up/y)").getValue(0), + path.eval("number((/rl/plan|/rlplan)//viewer/camera/up/z)").getValue(1) ) ); } this->viewer->viewer->getCamera()->scaleHeight( - path.eval("number(//viewer/camera/scale)").getFloatval(1.0f) + path.eval("number((/rl/plan|/rlplan)//viewer/camera/scale)").getValue(1.0f) ); - if (path.eval("count(//viewer/cspace) > 0").getBoolval()) - { - this->evalAction->setEnabled(true); - this->savePdfAction->setEnabled(true); - this->toggleConfigurationSpaceAction->setEnabled(true); - - this->configurationSpaceScene->delta = path.eval("number(//viewer/cspace/delta)").getFloatval(1.0f); - - if ("deg" == path.eval("string(//viewer/cspace/delta/@unit)").getStringval()) - { - this->configurationSpaceScene->delta *= rl::math::DEG2RAD; - } - - this->configurationSpaceScene->x = static_cast< std::size_t >(path.eval("number(//viewer/cspace/x)").getFloatval(0)); - this->configurationSpaceScene->y = static_cast< std::size_t >(path.eval("number(//viewer/cspace/y)").getFloatval(1)); - - this->configurationSpaceScene->eval(); - - qreal scale = static_cast< std::size_t >(path.eval("number(//viewer/cspace/scale)").getFloatval(1.0f)); - - this->configurationSpaceView->setEnabled(true); - - rl::math::Vector maximum(this->planner->model->getDof()); - this->planner->model->getMaximum(maximum); - rl::math::Vector minimum(this->planner->model->getDof()); - this->planner->model->getMinimum(minimum); - - this->configurationSpaceView->setSceneRect( - minimum(this->configurationSpaceScene->x), - -maximum(this->configurationSpaceScene->y), - std::abs(maximum(this->configurationSpaceScene->x) - minimum(this->configurationSpaceScene->x)), - std::abs(maximum(this->configurationSpaceScene->y) - minimum(this->configurationSpaceScene->y)) - ); - - this->configurationSpaceView->resetMatrix(); - this->configurationSpaceView->scale(scale, scale); - - this->configurationSpaceView->adjustSize(); - this->configurationSpaceDockWidget->adjustSize(); - - this->configurationSpaceDockWidget->setUpdatesEnabled(false); - this->configurationSpaceDockWidget->setFloating(!this->configurationSpaceDockWidget->isFloating()); - this->configurationSpaceDockWidget->setFloating(!this->configurationSpaceDockWidget->isFloating()); - this->configurationSpaceDockWidget->setUpdatesEnabled(true); - } - else - { - this->evalAction->setEnabled(false); - this->savePdfAction->setEnabled(false); - this->toggleConfigurationSpaceAction->setEnabled(false); - - this->configurationSpaceScene->clear(); - this->configurationSpaceDockWidget->hide(); - this->configurationSpaceView->setEnabled(false); - this->disconnect(this->thread, this->configurationSpaceScene); - } - this->viewer->drawConfiguration(*this->start); this->configurationModel->invalidate(); + this->configurationSpaceModel->invalidate(); this->plannerModel->invalidate(); + this->configurationSpaceScene->init(); + this->configurationSpaceSceneView->adjust(); + + this->plannerDockWidget->setWindowTitle(QString::fromStdString(this->planner->getName())); + + this->statusBar()->showMessage("Finished loading '" + filename + "'.", 1000); + if (!this->wait) { this->startThread(); @@ -1607,7 +1926,7 @@ MainWindow::load(const QString& filename) void MainWindow::open() { - if (NULL != this->planner) + if (nullptr != this->planner) { this->reset(); } @@ -1623,11 +1942,11 @@ MainWindow::open() void MainWindow::reset() { - rl::math::Real duration = this->planner->duration; + std::chrono::steady_clock::duration duration = this->planner->duration; this->thread->blockSignals(true); QCoreApplication::processEvents(); - this->planner->duration = 0; + this->planner->duration = std::chrono::steady_clock::duration::zero(); this->thread->stop(); this->planner->duration = duration; this->thread->blockSignals(false); @@ -1637,7 +1956,11 @@ MainWindow::reset() this->viewer->reset(); this->configurationSpaceScene->reset(); + this->statusBar()->showMessage("Successfully reset.", 1000); + this->configurationView->setEnabled(true); + this->configurationSpaceSceneView->setEnabled(true); + this->configurationSpaceView->setEnabled(true); this->evalAction->setEnabled(true); this->getGoalConfigurationAction->setEnabled(true); this->getRandomConfigurationAction->setEnabled(true); @@ -1648,50 +1971,68 @@ MainWindow::reset() this->setGoalConfigurationAction->setEnabled(true); this->setStartConfigurationAction->setEnabled(true); this->startThreadAction->setEnabled(true); - this->toggleViewAction->setEnabled(true); + this->toggleAnimationAction->setEnabled(true); + this->toggleConfigurationSpaceActiveAction->setEnabled(true); + this->toggleSweptVolumeAction->setEnabled(true); + this->toggleViewActiveAction->setEnabled(true); +} + +void +MainWindow::saveImageWithAlpha() +{ + this->viewer->saveImage(true); } void -MainWindow::saveImage() +MainWindow::saveImageWithoutAlpha() { - this->viewer->saveImage("planDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png"); + this->viewer->saveImage(false); } void MainWindow::savePdf() { + QString filename = "rlPlanDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".pdf"; + QPrinter printer; - printer.setOutputFileName("planDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".pdf"); + printer.setOutputFileName(filename); printer.setOutputFormat(QPrinter::PdfFormat); - printer.setPageSize(QPrinter::A4); + printer.setPageMargins(0, 0, 0, 0, QPrinter::Millimeter); + printer.setPaperSize(this->configurationSpaceScene->sceneRect().size(), QPrinter::Millimeter); QPainter painter(&printer); this->configurationSpaceScene->render(&painter); + + this->statusBar()->showMessage("Successfully saved PDF in '" + filename + "'.", 1000); } void MainWindow::saveScene() { - this->viewer->saveScene("planDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".wrl"); + this->viewer->saveScene(); } void MainWindow::setGoalConfiguration() { *this->goal = *this->q; + this->statusBar()->showMessage("Successfully set goal configuration.", 1000); } void MainWindow::setStartConfiguration() { *this->start = *this->q; + this->statusBar()->showMessage("Successfully set start configuration.", 1000); } void MainWindow::startThread() { this->configurationView->setEnabled(false); + this->configurationSpaceSceneView->setEnabled(false); + this->configurationSpaceView->setEnabled(false); this->evalAction->setEnabled(false); this->getGoalConfigurationAction->setEnabled(false); this->getRandomConfigurationAction->setEnabled(false); @@ -1702,12 +2043,28 @@ MainWindow::startThread() this->setGoalConfigurationAction->setEnabled(false); this->setStartConfigurationAction->setEnabled(false); this->startThreadAction->setEnabled(false); - this->toggleViewAction->setEnabled(false); + this->toggleAnimationAction->setEnabled(false); + this->toggleConfigurationSpaceActiveAction->setEnabled(false); + this->toggleSweptVolumeAction->setEnabled(false); + this->toggleViewActiveAction->setEnabled(false); this->model->reset(); this->thread->start(); } +void +MainWindow::toggleAnimation(const bool& doOn) +{ + if (doOn) + { + this->thread->animate = true; + } + else + { + this->thread->animate = false; + } +} + void MainWindow::toggleCamera() { @@ -1744,16 +2101,39 @@ MainWindow::toggleConfiguration() void MainWindow::toggleConfigurationSpace() { - if (this->configurationSpaceView->isEnabled()) + if (this->configurationSpaceDockWidget->isVisible()) { - if (this->configurationSpaceDockWidget->isVisible()) - { - this->configurationSpaceDockWidget->hide(); - } - else - { - this->configurationSpaceDockWidget->show(); - } + this->configurationSpaceDockWidget->hide(); + } + else + { + this->configurationSpaceDockWidget->show(); + } +} + +void +MainWindow::toggleConfigurationSpaceActive(const bool& doOn) +{ + if (doOn) + { + this->connect(this->thread, this->configurationSpaceScene); + } + else + { + this->disconnect(this->thread, this->configurationSpaceScene); + } +} + +void +MainWindow::toggleConfigurationSpaceScene() +{ + if (this->configurationSpaceSceneDockWidget->isVisible()) + { + this->configurationSpaceSceneDockWidget->hide(); + } + else + { + this->configurationSpaceSceneDockWidget->show(); } } @@ -1771,40 +2151,51 @@ MainWindow::togglePlanner() } void -MainWindow::toggleView(const bool& doOn) +MainWindow::toggleSweptVolume(const bool& doOn) +{ + if (doOn) + { + this->thread->swept = true; + } + else + { + this->thread->swept = false; + } +} + +void +MainWindow::toggleViewActive(const bool& doOn) { if (doOn) { this->planner->viewer = this->thread; - if (NULL != this->optimizer) + if (nullptr != this->optimizer) { this->optimizer->viewer = this->thread; } - for (std::vector< boost::shared_ptr< rl::plan::WorkspaceSphereExplorer > >::iterator i = this->explorers.begin(); i != this->explorers.end(); ++i) + for (std::vector>::iterator i = this->explorers.begin(); i != this->explorers.end(); ++i) { (*i)->viewer = this->thread; } - this->connect(this->thread, this->configurationSpaceScene); this->connect(this->thread, this->viewer); } else { - this->disconnect(this->thread, this->configurationSpaceScene); this->disconnect(this->thread, this->viewer); - this->planner->viewer = NULL; + this->planner->viewer = nullptr; - if (NULL != this->optimizer) + if (nullptr != this->optimizer) { - this->optimizer->viewer = NULL; + this->optimizer->viewer = nullptr; } - for (std::vector< boost::shared_ptr< rl::plan::WorkspaceSphereExplorer > >::iterator i = this->explorers.begin(); i != this->explorers.end(); ++i) + for (std::vector>::iterator i = this->explorers.begin(); i != this->explorers.end(); ++i) { - (*i)->viewer = NULL; + (*i)->viewer = nullptr; } } } diff --git a/demos/rlPlanDemo/MainWindow.h b/demos/rlPlanDemo/MainWindow.h index bfb03c7e..335e6047 100644 --- a/demos/rlPlanDemo/MainWindow.h +++ b/demos/rlPlanDemo/MainWindow.h @@ -24,22 +24,23 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _MAINWINDOW_H_ -#define _MAINWINDOW_H_ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H +#include #include #include -#include #include #include #include -#include +#include #include #include -#include +#include #include #include #include +#include #include #include #include @@ -49,7 +50,9 @@ class ConfigurationDelegate; class ConfigurationModel; +class ConfigurationSpaceModel; class ConfigurationSpaceScene; +class GraphicsView; class PlannerModel; class Thread; class Viewer; @@ -65,63 +68,71 @@ class MainWindow : public QMainWindow ConfigurationModel* configurationModel; - std::vector< boost::shared_ptr< rl::math::Vector3 > > explorerGoals; + ConfigurationSpaceModel* configurationSpaceModel; - std::vector< boost::shared_ptr< rl::plan::WorkspaceSphereExplorer > > explorers; + QString engine; + + std::vector> explorerGoals; + + std::vector> explorers; - std::vector< boost::shared_ptr< rl::math::Vector3 > > explorerStarts; + std::vector> explorerStarts; - boost::shared_ptr< rl::math::Vector > goal; + std::shared_ptr goal; - boost::shared_ptr< rl::kin::Kinematics > kin; + std::shared_ptr kin; - boost::shared_ptr< rl::kin::Kinematics > kin2; + std::shared_ptr kin2; - boost::shared_ptr< rl::mdl::Dynamic > mdl; + std::shared_ptr mdl; - boost::shared_ptr< rl::mdl::Dynamic > mdl2; + std::shared_ptr mdl2; - boost::shared_ptr< rl::plan::DistanceModel > model; + std::shared_ptr model; - boost::shared_ptr< rl::plan::Model > model2; + std::shared_ptr model2; QMutex mutex; - boost::shared_ptr< rl::plan::Optimizer > optimizer; + std::vector> nearestNeighbors; - boost::shared_ptr< rl::plan::Planner > planner; + std::shared_ptr optimizer; + + std::shared_ptr planner; PlannerModel* plannerModel; - boost::shared_ptr< rl::math::Vector > q; + std::shared_ptr q; - boost::shared_ptr< rl::plan::Sampler > sampler; + std::shared_ptr sampler; - boost::shared_ptr< rl::plan::Sampler > sampler2; + std::shared_ptr sampler2; - boost::shared_ptr< rl::math::Vector > sigma; + std::shared_ptr sigma; - boost::shared_ptr< rl::sg::Scene > scene; + std::shared_ptr scene; - boost::shared_ptr< rl::sg::so::Scene > scene2; + std::shared_ptr scene2; rl::sg::Model* sceneModel; rl::sg::so::Model* sceneModel2; - boost::shared_ptr< rl::math::Vector > start; + std::shared_ptr start; Thread* thread; - boost::shared_ptr< rl::plan::Verifier > verifier; + std::shared_ptr verifier; - boost::shared_ptr< rl::plan::Verifier > verifier2; + std::shared_ptr verifier2; Viewer* viewer; public slots: void eval(); + void evalDone(); + void getGoalConfiguration(); void getRandomConfiguration(); @@ -134,7 +145,9 @@ public slots: void reset(); - void saveImage(); + void saveImageWithAlpha(); + + void saveImageWithoutAlpha(); void savePdf(); @@ -146,18 +159,26 @@ public slots: void startThread(); + void toggleAnimation(const bool& doOn); + void toggleCamera(); void toggleConfiguration(); void toggleConfigurationSpace(); + void toggleConfigurationSpaceActive(const bool& doOn); + + void toggleConfigurationSpaceScene(); + void togglePlanner(); - void toggleView(const bool& doOn); + void toggleSweptVolume(const bool& doOn); + + void toggleViewActive(const bool& doOn); protected: - MainWindow(QWidget* parent = NULL, Qt::WindowFlags f = 0); + MainWindow(QWidget* parent = nullptr, Qt::WindowFlags f = 0); private: void clear(); @@ -178,11 +199,13 @@ public slots: ConfigurationSpaceScene* configurationSpaceScene; - QGraphicsView* configurationSpaceView; + QDockWidget* configurationSpaceSceneDockWidget; - QTableView* configurationView; + GraphicsView* configurationSpaceSceneView; - QString engine; + QTableView* configurationSpaceView; + + QTableView* configurationView; QAction* evalAction; @@ -206,12 +229,16 @@ public slots: QAction* resetAction; - QAction* saveImageAction; + QAction* saveImageWithAlphaAction; + + QAction* saveImageWithoutAlphaAction; QAction* savePdfAction; QAction* saveSceneAction; + boost::optional seed; + QAction* setGoalConfigurationAction; QAction* setStartConfigurationAction; @@ -220,6 +247,8 @@ public slots: QAction* startThreadAction; + QAction* toggleAnimationAction; + QAction* toggleCameraAction; QAction* toggleConfigurationAction; @@ -228,21 +257,29 @@ public slots: QAction* toggleConfigurationSpaceAction; + QAction* toggleConfigurationSpaceActiveAction; + + QAction* toggleConfigurationSpaceSceneAction; + QAction* toggleConfigurationVerticesAction; QAction* toggleLinesAction; + QAction* togglePathAction; + QAction* togglePlannerAction; QAction* togglePointsAction; QAction* toggleSpheresAction; - QAction* toggleViewAction; + QAction* toggleSweptVolumeAction; + + QAction* toggleViewActiveAction; QAction* toggleWorkFramesAction; bool wait; }; -#endif // _MAINWINDOW_H_ +#endif // MAINWINDOW_H diff --git a/demos/rlPlanDemo/PlannerModel.cpp b/demos/rlPlanDemo/PlannerModel.cpp index 9f8804d9..5b9a0455 100644 --- a/demos/rlPlanDemo/PlannerModel.cpp +++ b/demos/rlPlanDemo/PlannerModel.cpp @@ -53,7 +53,7 @@ PlannerModel::columnCount(const QModelIndex& parent) const QVariant PlannerModel::data(const QModelIndex& index, int role) const { - if (NULL == MainWindow::instance()->planner) + if (nullptr == MainWindow::instance()->planner) { return QVariant(); } @@ -70,13 +70,15 @@ PlannerModel::data(const QModelIndex& index, int role) const switch (index.row()) { case 0: - return MainWindow::instance()->planner->duration; + return std::chrono::duration_cast>( + MainWindow::instance()->planner->duration + ).count(); break; default: break; } - if (rl::plan::Eet* eet = dynamic_cast< rl::plan::Eet* >(MainWindow::instance()->planner.get())) + if (rl::plan::Eet* eet = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { @@ -84,27 +86,30 @@ PlannerModel::data(const QModelIndex& index, int role) const return eet->alpha; break; case 5: - return eet->distanceWeight; + return eet->beta; break; case 6: - return eet->gamma; + return eet->distanceWeight; break; case 7: - return eet->max.x(); + return eet->gamma; break; case 8: - return eet->max.y(); + return eet->max.x(); break; case 9: - return eet->max.z(); + return eet->max.y(); break; case 10: - return eet->min.x(); + return eet->max.z(); break; case 11: - return eet->min.y(); + return eet->min.x(); break; case 12: + return eet->min.y(); + break; + case 13: return eet->min.z(); break; default: @@ -112,18 +117,18 @@ PlannerModel::data(const QModelIndex& index, int role) const } } - if (rl::plan::Prm* prm = dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (rl::plan::Prm* prm = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { case 1: - return static_cast< unsigned int >(prm->degree); + return static_cast(prm->degree); break; case 2: return prm->verifier->delta; break; case 3: - return static_cast< unsigned int >(prm->k); + return static_cast(prm->k); break; case 4: return prm->radius; @@ -133,7 +138,7 @@ PlannerModel::data(const QModelIndex& index, int role) const } } - if (rl::plan::Rrt* rrt = dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + if (rl::plan::Rrt* rrt = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { @@ -148,7 +153,7 @@ PlannerModel::data(const QModelIndex& index, int role) const } } - if (rl::plan::RrtGoalBias* rrtGoalBias = dynamic_cast< rl::plan::RrtGoalBias* >(MainWindow::instance()->planner.get())) + if (rl::plan::RrtGoalBias* rrtGoalBias = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { @@ -159,8 +164,10 @@ PlannerModel::data(const QModelIndex& index, int role) const break; } } + + break; case Qt::TextAlignmentRole: - return Qt::AlignRight; + return QVariant(Qt::AlignRight | Qt::AlignVCenter); break; default: break; @@ -183,19 +190,11 @@ PlannerModel::flags(const QModelIndex &index) const QVariant PlannerModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (NULL == MainWindow::instance()->planner) + if (nullptr == MainWindow::instance()->planner) { return QVariant(); } - if (Qt::DisplayRole == role && Qt::Horizontal == orientation) - { - if (0 == section) - { - return MainWindow::instance()->planner->getName().c_str(); - } - } - if (Qt::DisplayRole == role && Qt::Vertical == orientation) { switch (section) @@ -207,7 +206,7 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con break; } - if (dynamic_cast< rl::plan::Eet* >(MainWindow::instance()->planner.get())) + if (dynamic_cast(MainWindow::instance()->planner.get())) { switch (section) { @@ -215,27 +214,30 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con return "alpha"; break; case 5: - return "distanceWeight"; + return "beta"; break; case 6: - return "gamma"; + return "distanceWeight"; break; case 7: - return "max.x"; + return "gamma"; break; case 8: - return "max.y"; + return "max.x"; break; case 9: - return "max.z"; + return "max.y"; break; case 10: - return "min.x"; + return "max.z"; break; case 11: - return "min.y"; + return "min.x"; break; case 12: + return "min.y"; + break; + case 13: return "min.z"; break; default: @@ -243,7 +245,7 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con } } - if (dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (dynamic_cast(MainWindow::instance()->planner.get())) { switch (section) { @@ -264,7 +266,7 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con } } - if (dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + if (dynamic_cast(MainWindow::instance()->planner.get())) { switch (section) { @@ -279,7 +281,7 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con } } - if (dynamic_cast< rl::plan::RrtGoalBias* >(MainWindow::instance()->planner.get())) + if (dynamic_cast(MainWindow::instance()->planner.get())) { switch (section) { @@ -298,30 +300,31 @@ PlannerModel::headerData(int section, Qt::Orientation orientation, int role) con void PlannerModel::invalidate() { - this->reset(); + this->beginResetModel(); + this->endResetModel(); } int PlannerModel::rowCount(const QModelIndex& parent) const { - if (NULL == MainWindow::instance()->planner) + if (nullptr == MainWindow::instance()->planner) { return 0; } - if (dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (dynamic_cast(MainWindow::instance()->planner.get())) { return 5; } - else if (dynamic_cast< rl::plan::Eet* >(MainWindow::instance()->planner.get())) + else if (dynamic_cast(MainWindow::instance()->planner.get())) { - return 13; + return 14; } - else if (dynamic_cast< rl::plan::RrtGoalBias* >(MainWindow::instance()->planner.get())) + else if (dynamic_cast(MainWindow::instance()->planner.get())) { return 4; } - else if (dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + else if (dynamic_cast(MainWindow::instance()->planner.get())) { return 3; } @@ -332,7 +335,7 @@ PlannerModel::rowCount(const QModelIndex& parent) const bool PlannerModel::setData(const QModelIndex& index, const QVariant& value, int role) { - if (NULL == MainWindow::instance()->planner) + if (nullptr == MainWindow::instance()->planner) { return false; } @@ -347,90 +350,95 @@ PlannerModel::setData(const QModelIndex& index, const QVariant& value, int role) switch (index.row()) { case 0: - MainWindow::instance()->planner->duration = value.value< ::rl::math::Real >(); + MainWindow::instance()->planner->duration = std::chrono::duration_cast( + std::chrono::duration(value.value()) + ); break; default: break; } - if (rl::plan::Eet* eet = dynamic_cast< rl::plan::Eet* >(MainWindow::instance()->planner.get())) + if (rl::plan::Eet* eet = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { case 4: - eet->alpha = value.value< ::rl::math::Real >(); + eet->alpha = value.value(); break; case 5: - eet->distanceWeight = value.value< ::rl::math::Real >(); + eet->beta = value.value(); break; case 6: - eet->gamma = value.value< ::rl::math::Real >(); + eet->distanceWeight = value.value(); break; case 7: - eet->max.x() = value.value< ::rl::math::Real >(); + eet->gamma = value.value(); break; case 8: - eet->max.y() = value.value< ::rl::math::Real >(); + eet->max.x() = value.value(); break; case 9: - eet->max.z() = value.value< ::rl::math::Real >(); + eet->max.y() = value.value(); break; case 10: - eet->min.x() = value.value< ::rl::math::Real >(); + eet->max.z() = value.value(); break; case 11: - eet->min.y() = value.value< ::rl::math::Real >(); + eet->min.x() = value.value(); break; case 12: - eet->min.z() = value.value< ::rl::math::Real >(); + eet->min.y() = value.value(); + break; + case 13: + eet->min.z() = value.value(); break; default: break; } } - if (rl::plan::Prm* prm = dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (rl::plan::Prm* prm = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { case 1: - prm->degree = value.value< ::std::size_t >(); + prm->degree = value.value(); break; case 2: - prm->verifier->delta = value.value< ::rl::math::Real >(); + prm->verifier->delta = value.value(); break; case 3: - prm->k = value.value< ::std::size_t >(); + prm->k = value.value(); break; case 4: - prm->radius = value.value< ::rl::math::Real >(); + prm->radius = value.value(); break; default: break; } } - if (rl::plan::Rrt* rrt = dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + if (rl::plan::Rrt* rrt = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { case 1: - rrt->delta = value.value< ::rl::math::Real >(); + rrt->delta = value.value(); break; case 2: - rrt->epsilon = value.value< ::rl::math::Real >(); + rrt->epsilon = value.value(); break; default: break; } } - if (rl::plan::RrtGoalBias* rrtGoalBias = dynamic_cast< rl::plan::RrtGoalBias* >(MainWindow::instance()->planner.get())) + if (rl::plan::RrtGoalBias* rrtGoalBias = dynamic_cast(MainWindow::instance()->planner.get())) { switch (index.row()) { case 3: - rrtGoalBias->probability = value.value< ::rl::math::Real >(); + rrtGoalBias->probability = value.value(); break; default: break; diff --git a/demos/rlPlanDemo/PlannerModel.h b/demos/rlPlanDemo/PlannerModel.h index d36b7f50..e713ac57 100644 --- a/demos/rlPlanDemo/PlannerModel.h +++ b/demos/rlPlanDemo/PlannerModel.h @@ -24,15 +24,15 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _PLANNERMODEL_H_ -#define _PLANNERMODEL_H_ +#ifndef PLANNERMODEL_H +#define PLANNERMODEL_H #include class PlannerModel : public QAbstractTableModel { public: - PlannerModel(QObject* parent = NULL); + PlannerModel(QObject* parent = nullptr); virtual ~PlannerModel(); @@ -56,4 +56,4 @@ class PlannerModel : public QAbstractTableModel }; -#endif // _PLANNERMODEL_H_ +#endif // PLANNERMODEL_H diff --git a/demos/rlPlanDemo/SoGradientBackground.cpp b/demos/rlPlanDemo/SoGradientBackground.cpp new file mode 100644 index 00000000..bd1d852f --- /dev/null +++ b/demos/rlPlanDemo/SoGradientBackground.cpp @@ -0,0 +1,109 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifdef WIN32 +#include +#endif // WIN32 + +#ifdef __APPLE__ +#include +#else // __APPLE__ +#include +#endif // __APPLE__ + +#include + +#include "SoGradientBackground.h" + +SO_NODE_SOURCE(SoGradientBackground); + +SoGradientBackground::SoGradientBackground() : + SoNode(), + color0(), + color1() +{ + SO_NODE_CONSTRUCTOR(SoGradientBackground); + + SO_NODE_ADD_FIELD(color0, (1.0f, 1.0f, 1.0f)); + SO_NODE_ADD_FIELD(color1, (0.0f, 0.0f, 0.0f)); +} + +SoGradientBackground::~SoGradientBackground() +{ +} + +SbBool +SoGradientBackground::affectsState() const +{ + return false; +} + +void +SoGradientBackground::exitClass() +{ +} + +void +SoGradientBackground::GLRender(SoGLRenderAction* action) +{ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glBegin(GL_QUADS); + + glColor3f(this->color0.getValue()[0], this->color0.getValue()[1], this->color0.getValue()[2]); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glColor3f(this->color1.getValue()[0], this->color1.getValue()[1], this->color1.getValue()[2]); + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + + glEnd(); + + glPopAttrib(); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void +SoGradientBackground::initClass() +{ + SO_NODE_INIT_CLASS(SoGradientBackground, SoNode, "Node"); +} diff --git a/demos/rlPlanDemo/SoGradientBackground.h b/demos/rlPlanDemo/SoGradientBackground.h new file mode 100644 index 00000000..5fc080f5 --- /dev/null +++ b/demos/rlPlanDemo/SoGradientBackground.h @@ -0,0 +1,59 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOGRADIENTBACKGROUND_H +#define SOGRADIENTBACKGROUND_H + +#include +#include + +class SoGradientBackground : public SoNode +{ + SO_NODE_HEADER(SoGradientBackground); + +public: + SoGradientBackground(); + + virtual SbBool affectsState() const; + + static void exitClass(); + + virtual void GLRender(SoGLRenderAction* action); + + static void initClass(); + + SoSFColor color0; + + SoSFColor color1; + +protected: + virtual ~SoGradientBackground(); + +private: + +}; + +#endif // SOGRADIENTBACKGROUND_H diff --git a/demos/rlPlanDemo/Thread.cpp b/demos/rlPlanDemo/Thread.cpp index 8561e21d..bca574d0 100644 --- a/demos/rlPlanDemo/Thread.cpp +++ b/demos/rlPlanDemo/Thread.cpp @@ -31,9 +31,12 @@ #include #include #include +#include +#include +#include +#include #include #include -#include #include "MainWindow.h" #include "Thread.h" @@ -41,6 +44,7 @@ Thread::Thread(QObject* parent) : QThread(parent), + animate(true), quit(false), swept(false), running(false) @@ -166,37 +170,41 @@ Thread::run() this->running = true; - rl::util::Timer timer; - + this->showMessage("Showing start configuration."); this->drawConfiguration(*MainWindow::instance()->planner->start); - if (NULL != MainWindow::instance()->planner->viewer) + if (nullptr != MainWindow::instance()->planner->viewer) { - usleep(static_cast< std::size_t >(2.0f * 1000.0f * 1000.0f)); + usleep(static_cast(2.0f * 1000.0f * 1000.0f)); } if (!this->running) return; + this->showMessage("Showing goal configuration."); this->drawConfiguration(*MainWindow::instance()->planner->goal); - if (NULL != MainWindow::instance()->planner->viewer) + if (nullptr != MainWindow::instance()->planner->viewer) { - usleep(static_cast< std::size_t >(2.0f * 1000.0f * 1000.0f)); + usleep(static_cast(2.0f * 1000.0f * 1000.0f)); } if (!this->running) return; if (!MainWindow::instance()->planner->verify()) { - std::cout << "start or goal invalid" << std::endl; + this->showMessage("Invalid start or goal configuration."); return; } - std::cout << "solve() ... " << std::endl;; - timer.start(); + this->showMessage("Solving..."); + + std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); bool solved = MainWindow::instance()->planner->solve(); - timer.stop(); - std::cout << "solve() " << (solved ? "true" : "false") << " " << timer.elapsed() * 1000.0f << " ms" << std::endl; + std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now(); + + double plannerDuration = std::chrono::duration_cast>(stop - start).count() * 1000; + + this->showMessage("Planner " + std::string(solved ? "succeeded" : "failed") + " in " + QString::number(plannerDuration).toStdString() + " ms."); std::fstream benchmark; benchmark.open("benchmark.csv", std::ios::app | std::ios::in | std::ios::out); @@ -205,7 +213,7 @@ Thread::run() if (std::ifstream::traits_type::eof() == peek) { benchmark.clear(); - benchmark << "Date,Time,Solved,Planner,Robot,Vertices,Edges,Total CD,Free CD,Exploration Duration (s),Duration (s), Path Length" << std::endl; + benchmark << "Date,Time,Solved,Engine,Planner,Robot,Nearest Neighbors,Vertices,Edges,Total CD,Free CD,Exploration Duration (s),Duration (s), Path Length" << std::endl; } else { @@ -216,6 +224,8 @@ Thread::run() benchmark << ","; benchmark << (solved ? "true" : "false"); benchmark << ","; + benchmark << MainWindow::instance()->engine.toUpper().toStdString(); + benchmark << ","; benchmark << MainWindow::instance()->planner->getName(); benchmark << ","; benchmark << MainWindow::instance()->model->getManufacturer(); @@ -223,22 +233,65 @@ Thread::run() benchmark << MainWindow::instance()->model->getName(); benchmark << ","; - if (rl::plan::Prm* prm = dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (!MainWindow::instance()->nearestNeighbors.empty()) + { + if (rl::plan::GnatNearestNeighbors* gnatNearestNeighbors = dynamic_cast(MainWindow::instance()->nearestNeighbors.front().get())) + { + benchmark << "GNAT"; + + boost::optional checks = gnatNearestNeighbors->getChecks(); + + if (checks) + { + benchmark << " (" << checks.get() << " Checks)"; + } + } + else if (rl::plan::KdtreeBoundingBoxNearestNeighbors* kdtreeBoundingBoxNearestNeighbors = dynamic_cast(MainWindow::instance()->nearestNeighbors.front().get())) + { + benchmark << "k-d Tree Bounding Box"; + + boost::optional checks = kdtreeBoundingBoxNearestNeighbors->getChecks(); + + if (checks) + { + benchmark << " (" << checks.get() << " Checks)"; + } + } + else if (rl::plan::KdtreeNearestNeighbors* kdtreeNearestNeighbors = dynamic_cast(MainWindow::instance()->nearestNeighbors.front().get())) + { + benchmark << "k-d Tree"; + + boost::optional checks = kdtreeNearestNeighbors->getChecks(); + + if (checks) + { + benchmark << " (" << checks.get() << " Checks)"; + } + } + else if (rl::plan::LinearNearestNeighbors* linearNearestNeighbors = dynamic_cast(MainWindow::instance()->nearestNeighbors.front().get())) + { + benchmark << "Linear"; + } + } + + benchmark << ","; + + if (rl::plan::Prm* prm = dynamic_cast(MainWindow::instance()->planner.get())) { benchmark << prm->getNumVertices(); } - else if (rl::plan::Rrt* rrt = dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + else if (rl::plan::Rrt* rrt = dynamic_cast(MainWindow::instance()->planner.get())) { benchmark << rrt->getNumVertices(); } benchmark << ","; - if (rl::plan::Prm* prm = dynamic_cast< rl::plan::Prm* >(MainWindow::instance()->planner.get())) + if (rl::plan::Prm* prm = dynamic_cast(MainWindow::instance()->planner.get())) { benchmark << prm->getNumEdges(); } - else if (rl::plan::Rrt* rrt = dynamic_cast< rl::plan::Rrt* >(MainWindow::instance()->planner.get())) + else if (rl::plan::Rrt* rrt = dynamic_cast(MainWindow::instance()->planner.get())) { benchmark << rrt->getNumEdges(); } @@ -249,9 +302,9 @@ Thread::run() benchmark << MainWindow::instance()->model->getFreeQueries(); benchmark << ","; - if (rl::plan::Eet* eet = dynamic_cast< rl::plan::Eet* >(MainWindow::instance()->planner.get())) + if (rl::plan::Eet* eet = dynamic_cast(MainWindow::instance()->planner.get())) { - benchmark << eet->getExplorationTime(); + benchmark << std::chrono::duration_cast>(eet->getExplorationDuration()).count(); } else { @@ -259,13 +312,13 @@ Thread::run() } benchmark << ","; - benchmark << timer.elapsed(); + benchmark << plannerDuration; rl::plan::VectorList path; if (solved) { - MainWindow::instance()->planner->getPath(path); + path = MainWindow::instance()->planner->getPath(); rl::plan::VectorList::iterator i = path.begin(); rl::plan::VectorList::iterator j = ++path.begin(); @@ -294,33 +347,36 @@ Thread::run() if (solved) { - if (this->swept) - { - this->drawSweptVolume(path); - return; - } - this->drawConfigurationPath(path); if (!this->running) return; - if (NULL != MainWindow::instance()->optimizer) + if (nullptr != MainWindow::instance()->optimizer) { - usleep(static_cast< std::size_t >(2.0f * 1000.0f * 1000.0f)); + usleep(static_cast(2.0f * 1000.0f * 1000.0f)); + + this->showMessage("Planner " + std::string(solved ? "succeeded" : "failed") + " in " + QString::number(plannerDuration).toStdString() + " ms. Optimizing..."); - std::cout << "optimize() ... " << std::endl;; - timer.start(); + start = std::chrono::steady_clock::now(); MainWindow::instance()->optimizer->process(path); - timer.stop(); - std::cout << "optimize() " << timer.elapsed() * 1000.0f << " ms" << std::endl; + stop = std::chrono::steady_clock::now(); + + double optimizerDuration = std::chrono::duration_cast>(stop - start).count() * 1000; + + this->showMessage("Planner " + std::string(solved ? "succeeded" : "failed") + " in " + QString::number(plannerDuration).toStdString() + " ms. Optimizer finished in " + QString::number(optimizerDuration).toStdString() + " ms."); this->drawConfigurationPath(path); } - rl::math::Vector diff(MainWindow::instance()->model->getDof()); - rl::math::Vector inter(MainWindow::instance()->model->getDof()); + if (this->swept) + { + this->drawSweptVolume(path); + } - while (true) + rl::math::Vector diff(MainWindow::instance()->model->getDofPosition()); + rl::math::Vector inter(MainWindow::instance()->model->getDofPosition()); + + while (this->animate) { if (!this->running) break; @@ -330,7 +386,7 @@ Thread::run() if (i != path.end() && j != path.end()) { this->drawConfiguration(*i); - usleep(static_cast< std::size_t >(0.01f * 1000.0f * 1000.0f)); + usleep(static_cast(0.01f * 1000.0f * 1000.0f)); } rl::math::Real delta = MainWindow::instance()->viewer->delta; @@ -347,7 +403,7 @@ Thread::run() MainWindow::instance()->model->interpolate(*i, *j, k / steps, inter); this->drawConfiguration(inter); - usleep(static_cast< std::size_t >(0.01f * 1000.0f * 1000.0f)); + usleep(static_cast(0.01f * 1000.0f * 1000.0f)); } } @@ -359,7 +415,7 @@ Thread::run() if (ri != path.rend() && rj != path.rend()) { this->drawConfiguration(*ri); - usleep(static_cast< std::size_t >(0.01f * 1000.0f * 1000.0f)); + usleep(static_cast(0.01f * 1000.0f * 1000.0f)); } for (; ri != path.rend() && rj != path.rend(); ++ri, ++rj) @@ -374,13 +430,19 @@ Thread::run() MainWindow::instance()->model->interpolate(*ri, *rj, k / steps, inter); this->drawConfiguration(inter); - usleep(static_cast< std::size_t >(0.01f * 1000.0f * 1000.0f)); + usleep(static_cast(0.01f * 1000.0f * 1000.0f)); } } } } } +void +Thread::showMessage(const std::string& message) +{ + emit messageRequested(message); +} + void Thread::stop() { diff --git a/demos/rlPlanDemo/Thread.h b/demos/rlPlanDemo/Thread.h index 72d19c62..24dce565 100644 --- a/demos/rlPlanDemo/Thread.h +++ b/demos/rlPlanDemo/Thread.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _THREAD_H_ -#define _THREAD_H_ +#ifndef THREAD_H +#define THREAD_H #include #include @@ -35,7 +35,7 @@ class Thread : public QThread, public rl::plan::Viewer Q_OBJECT public: - Thread(QObject* parent = NULL); + Thread(QObject* parent = nullptr); virtual ~Thread(); @@ -77,8 +77,12 @@ class Thread : public QThread, public rl::plan::Viewer void run(); + void showMessage(const std::string& message); + void stop(); + bool animate; + bool quit; bool swept; @@ -103,6 +107,8 @@ class Thread : public QThread, public rl::plan::Viewer void lineResetRequested(); + void messageRequested(const std::string& message); + void pointRequested(const rl::math::Vector& xyz); void pointResetRequested(); @@ -126,4 +132,4 @@ class Thread : public QThread, public rl::plan::Viewer void workVertexRequested(const rl::math::Vector& q); }; -#endif // _THREAD_H_ +#endif // THREAD_H diff --git a/demos/rlPlanDemo/Viewer.cpp b/demos/rlPlanDemo/Viewer.cpp index 15ba179d..76351827 100644 --- a/demos/rlPlanDemo/Viewer.cpp +++ b/demos/rlPlanDemo/Viewer.cpp @@ -24,8 +24,10 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include #include #include +#include #include #include #include @@ -35,15 +37,19 @@ #include #include +#include "SoGradientBackground.h" #include "MainWindow.h" #include "Viewer.h" Viewer::Viewer(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f), delta(1.0f), - model(NULL), + deltaSwept(100.0f), + model(nullptr), sceneGroup(new SoVRMLGroup()), - viewer(new SoQtExaminerViewer(this, NULL, true, SoQtFullViewer::BUILD_POPUP)), + viewer(new SoQtExaminerViewer(this, nullptr, true, SoQtFullViewer::BUILD_POPUP)), + background(new SoVRMLSwitch()), + backgroundGradientBackground(new SoGradientBackground()), edges(new SoVRMLSwitch()), edgesColliding(new SoVRMLSwitch()), edgesCollidingAppearance(new SoVRMLAppearance()), @@ -131,6 +137,17 @@ Viewer::Viewer(QWidget* parent, Qt::WindowFlags f) : this->viewer->setSceneGraph(this->root); this->viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); + // background + + this->background->setName("background"); + this->background->whichChoice = SO_SWITCH_ALL; + + this->backgroundGradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->backgroundGradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); + this->background->addChild(backgroundGradientBackground); + + this->root->addChild(this->background); + // edgesColliding this->edgesColliding->setName("edgesColliding"); @@ -428,8 +445,8 @@ Viewer::drawConfiguration(const rl::math::Vector& q) void Viewer::drawConfigurationEdge(const rl::math::Vector& u, const rl::math::Vector& v, const bool& free) { - SoVRMLCoordinate* coordinate = NULL; - SoVRMLIndexedLineSet* indexedLineSet = NULL; + SoVRMLCoordinate* coordinate = nullptr; + SoVRMLIndexedLineSet* indexedLineSet = nullptr; if (free) { @@ -444,7 +461,7 @@ Viewer::drawConfigurationEdge(const rl::math::Vector& u, const rl::math::Vector& this->edges->enableNotify(false); - rl::math::Vector inter(this->model->getDof()); + rl::math::Vector inter(this->model->getDofPosition()); rl::math::Real steps = std::ceil(this->model->distance(u, v) / this->delta); @@ -492,7 +509,7 @@ Viewer::drawConfigurationPath(const rl::plan::VectorList& path) this->pathCoordinate->point.setNum(0); this->pathIndexedLineSet->coordIndex.setNum(0); - rl::math::Vector inter(this->model->getDof()); + rl::math::Vector inter(this->model->getDofPosition()); for (std::size_t l = 0; l < this->model->getOperationalDof(); ++l) { @@ -556,7 +573,7 @@ Viewer::drawConfigurationPath(const rl::plan::VectorList& path) void Viewer::drawConfigurationVertex(const rl::math::Vector& q, const bool& free) { - SoVRMLCoordinate* coordinate = NULL; + SoVRMLCoordinate* coordinate = nullptr; if (free) { @@ -658,60 +675,80 @@ Viewer::drawSweptVolume(const rl::plan::VectorList& path) this->sweptGroup->removeAllChildren(); - rl::math::Vector inter(this->model->getDof()); + rl::math::Real length = 0; rl::plan::VectorList::const_iterator i = path.begin(); rl::plan::VectorList::const_iterator j = ++path.begin(); - if (i != path.end() && j != path.end()) + for (; i != path.end() && j != path.end(); ++i, ++j) { - this->model->setPosition(*i); - this->model->updateFrames(); - - SoVRMLGroup* model = new SoVRMLGroup(); + length += this->model->distance(*i, *j); + } + + rl::math::Real delta = length / static_cast(std::ceil(length / this->deltaSwept)); + + rl::math::Vector inter(this->model->getDofPosition()); + + rl::math::Real x0 = 0; + rl::math::Real x1 = x0; + rl::math::Real x = 0; + + i = path.begin(); + j = ++path.begin(); + + for (; i != path.end() && j != path.end(); ++i, ++j) + { + x1 += this->model->distance(*i, *j); - for (std::size_t i = 0; i < this->model->model->getNumBodies(); ++i) + for (; x < x1; x += delta) { - SoVRMLTransform* frame = new SoVRMLTransform(); - frame->copyFieldValues(static_cast< rl::sg::so::Body* >(this->model->model->getBody(i))->root); + this->model->interpolate(*i, *j, (x - x0) / (x1 - x0), inter); + + this->model->setPosition(inter); + this->model->updateFrames(); + + SoVRMLGroup* model = new SoVRMLGroup(); - for (std::size_t j = 0; j < this->model->model->getBody(i)->getNumShapes(); ++j) + for (std::size_t k = 0; k < this->model->model->getNumBodies(); ++k) { - SoVRMLTransform* transform = new SoVRMLTransform(); - transform->copyFieldValues(static_cast< rl::sg::so::Shape* >(this->model->model->getBody(i)->getShape(j))->root); - transform->addChild(static_cast< rl::sg::so::Shape* >(this->model->model->getBody(i)->getShape(j))->shape); - frame->addChild(transform); + SoVRMLTransform* frame = new SoVRMLTransform(); + frame->copyFieldValues(static_cast(this->model->model->getBody(k))->root); + + for (std::size_t l = 0; l < this->model->model->getBody(k)->getNumShapes(); ++l) + { + SoVRMLTransform* transform = new SoVRMLTransform(); + transform->copyFieldValues(static_cast(this->model->model->getBody(k)->getShape(l))->root); + transform->addChild(static_cast(this->model->model->getBody(k)->getShape(l))->shape); + frame->addChild(transform); + } + + model->addChild(frame); } - model->addChild(frame); + this->sweptGroup->addChild(model); } - this->sweptGroup->addChild(model); - } - - for (; i != path.end() && j != path.end(); ++i, ++j) - { - rl::math::Real steps = std::ceil(this->model->distance(*i, *j) / this->delta); + x0 = x1; - for (std::size_t k = 1; k < steps + 1; ++k) + if (j == --path.end()) { - this->model->interpolate(*i, *j, k / steps, inter); + this->model->interpolate(*i, *j, 1, inter); this->model->setPosition(inter); this->model->updateFrames(); SoVRMLGroup* model = new SoVRMLGroup(); - for (std::size_t i = 0; i < this->model->model->getNumBodies(); ++i) + for (std::size_t k = 0; k < this->model->model->getNumBodies(); ++k) { SoVRMLTransform* frame = new SoVRMLTransform(); - frame->copyFieldValues(static_cast< rl::sg::so::Body* >(this->model->model->getBody(i))->root); + frame->copyFieldValues(static_cast(this->model->model->getBody(k))->root); - for (std::size_t j = 0; j < this->model->model->getBody(i)->getNumShapes(); ++j) + for (std::size_t l = 0; l < this->model->model->getBody(k)->getNumShapes(); ++l) { SoVRMLTransform* transform = new SoVRMLTransform(); - transform->copyFieldValues(static_cast< rl::sg::so::Shape* >(this->model->model->getBody(i)->getShape(j))->root); - transform->addChild(static_cast< rl::sg::so::Shape* >(this->model->model->getBody(i)->getShape(j))->shape); + transform->copyFieldValues(static_cast(this->model->model->getBody(k)->getShape(l))->root); + transform->addChild(static_cast(this->model->model->getBody(k)->getShape(l))->shape); frame->addChild(transform); } @@ -736,7 +773,7 @@ Viewer::drawWork(const rl::math::Transform& t) { for (int j = 0; j < 4; ++j) { - matrix[i][j] = static_cast< float >(t(j, i)); + matrix[i][j] = static_cast(t(j, i)); } } @@ -868,10 +905,26 @@ Viewer::resetVertices() } void -Viewer::saveImage(const QString& filename) +Viewer::saveImage(bool withAlpha) { + QString filename = "rlPlanDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png"; + + SoSFInt32 whichChoice = this->background->whichChoice; + + if (withAlpha) + { + this->background->whichChoice = SO_SWITCH_NONE; + this->viewer->render(); + } + glReadBuffer(GL_FRONT); - QImage image = static_cast< QGLWidget* >(this->viewer->getGLWidget())->grabFrameBuffer(false); + QImage image = static_cast(this->viewer->getGLWidget())->grabFrameBuffer(withAlpha); + + if (withAlpha) + { + this->background->whichChoice = whichChoice; + this->viewer->render(); + } QString format = filename.right(filename.length() - filename.lastIndexOf('.') - 1).toUpper(); @@ -882,13 +935,17 @@ Viewer::saveImage(const QString& filename) if (!image.save(filename, format.toStdString().c_str())) { - QMessageBox::critical(this, this->windowTitle(), "Error writing " + filename + "."); + QMessageBox::critical(this, "Error", "Error writing " + filename + "."); } + + MainWindow::instance()->statusBar()->showMessage("Successfully saved image in '" + filename + "'.", 1000); } void -Viewer::saveScene(const QString& filename) +Viewer::saveScene() { + QString filename = "rlPlanDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".wrl"; + SoOutput output; if (!output.openFile(filename.toStdString().c_str())) @@ -902,6 +959,21 @@ Viewer::saveScene(const QString& filename) writeAction.apply(this->root); output.closeFile(); + + MainWindow::instance()->statusBar()->showMessage("Successfully saved scene in '" + filename + "'.", 1000); +} + +void +Viewer::setBackgroundColor(const QColor& color) +{ + this->background->whichChoice = SO_SWITCH_NONE; + this->viewer->setBackgroundColor(SbColor(color.redF(), color.greenF(), color.blueF())); +} + +void +Viewer::showMessage(const std::string& message) +{ + MainWindow::instance()->statusBar()->showMessage(QString::fromStdString(message)); } void @@ -943,6 +1015,19 @@ Viewer::toggleLines(const bool& doOn) } } +void +Viewer::togglePath(const bool& doOn) +{ + if (doOn) + { + this->path->whichChoice = SO_SWITCH_ALL; + } + else + { + this->path->whichChoice = SO_SWITCH_NONE; + } +} + void Viewer::togglePoints(const bool& doOn) { @@ -969,6 +1054,19 @@ Viewer::toggleSpheres(const bool& doOn) } } +void +Viewer::toggleSweptVolume(const bool& doOn) +{ + if (doOn) + { + this->swept->whichChoice = SO_SWITCH_ALL; + } + else + { + this->swept->whichChoice = SO_SWITCH_NONE; + } +} + void Viewer::toggleWorkFrames(const bool& doOn) { diff --git a/demos/rlPlanDemo/Viewer.h b/demos/rlPlanDemo/Viewer.h index 8bc6608b..82f381d5 100644 --- a/demos/rlPlanDemo/Viewer.h +++ b/demos/rlPlanDemo/Viewer.h @@ -24,8 +24,8 @@ // POSSIBILITY OF SUCH DAMAGE. // -#ifndef _VIEWER_H_ -#define _VIEWER_H_ +#ifndef VIEWER_H +#define VIEWER_H #include #include @@ -44,17 +44,23 @@ #include #include +class SoGradientBackground; + class Viewer : public QWidget, public rl::plan::Viewer { Q_OBJECT public: - Viewer(QWidget* parent = NULL, Qt::WindowFlags f = 0); + Viewer(QWidget* parent = nullptr, Qt::WindowFlags f = 0); virtual ~Viewer(); + void setBackgroundColor(const QColor& color); + rl::math::Real delta; + rl::math::Real deltaSwept; + rl::plan::Model* model; SoVRMLGroup* sceneGroup; @@ -98,9 +104,11 @@ public slots: void resetVertices(); - void saveImage(const QString& filename); + void saveImage(bool withAlpha); + + void saveScene(); - void saveScene(const QString& filename); + void showMessage(const std::string& message); void toggleConfigurationEdges(const bool& doOn); @@ -108,15 +116,23 @@ public slots: void toggleLines(const bool& doOn); + void togglePath(const bool& doOn); + void togglePoints(const bool& doOn); void toggleSpheres(const bool& doOn); + void toggleSweptVolume(const bool& doOn); + void toggleWorkFrames(const bool& doOn); protected: private: + SoVRMLSwitch* background; + + SoGradientBackground* backgroundGradientBackground; + SoVRMLSwitch* edges; SoVRMLSwitch* edgesColliding; @@ -280,4 +296,4 @@ public slots: SoVRMLTransform* workTransform; }; -#endif // _VIEWER_H_ +#endif // VIEWER_H diff --git a/demos/rlPlanDemo/rlPlanDemo.cpp b/demos/rlPlanDemo/rlPlanDemo.cpp index 670a7a30..f41e91f1 100644 --- a/demos/rlPlanDemo/rlPlanDemo.cpp +++ b/demos/rlPlanDemo/rlPlanDemo.cpp @@ -26,14 +26,16 @@ #include #include +#include #include +#include #include #include #include #include "MainWindow.h" -MainWindow* MainWindow::singleton = NULL; +MainWindow* MainWindow::singleton = nullptr; int main(int argc, char** argv) @@ -42,10 +44,11 @@ main(int argc, char** argv) { QApplication application(argc, argv); - qRegisterMetaType< rl::math::Real >("rl::math::Real"); - qRegisterMetaType< rl::math::Transform >("rl::math::Transform"); - qRegisterMetaType< rl::math::Vector >("rl::math::Vector"); - qRegisterMetaType< rl::plan::VectorList >("rl::plan::VectorList"); + qRegisterMetaType("rl::math::Real"); + qRegisterMetaType("rl::math::Transform"); + qRegisterMetaType("rl::math::Vector"); + qRegisterMetaType("rl::plan::VectorList"); + qRegisterMetaType("std::string"); QObject::connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit())); @@ -55,7 +58,8 @@ main(int argc, char** argv) } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - return -1; + QApplication application(argc, argv); + QMessageBox::critical(nullptr, "Error", e.what()); + return EXIT_FAILURE; } } diff --git a/demos/rlPlanDemo/rlPlanDemo.desktop b/demos/rlPlanDemo/rlPlanDemo.desktop.in similarity index 67% rename from demos/rlPlanDemo/rlPlanDemo.desktop rename to demos/rlPlanDemo/rlPlanDemo.desktop.in index 88fa4fdf..929f2bda 100644 --- a/demos/rlPlanDemo/rlPlanDemo.desktop +++ b/demos/rlPlanDemo/rlPlanDemo.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Categories=Science;Robotics; Comment=Path planning demo with Unimation Puma 560 and RRT algorithm -Exec=sh -c "rlPlanDemo $(dirname %k)/../rl/examples/rlplan/unimation-puma560_boxes_rrtConCon.xml" +Exec=sh -c "rlPlanDemo $(dirname %k)/../rl-@VERSION@/examples/rlplan/unimation-puma560_boxes_rrtConCon.xml" Icon=robotics-library Name=Robotics Library (rlPlanDemo) Type=Application diff --git a/demos/rlPolynomialRootsDemo/CMakeLists.txt b/demos/rlPolynomialRootsDemo/CMakeLists.txt new file mode 100644 index 00000000..53c1775c --- /dev/null +++ b/demos/rlPolynomialRootsDemo/CMakeLists.txt @@ -0,0 +1,17 @@ +find_package(Boost REQUIRED) + +add_executable( + rlPolynomialRootsDemo + rlPolynomialRootsDemo.cpp +) + +target_include_directories( + rlPolynomialRootsDemo + PUBLIC + ${Boost_INCLUDE_DIR} +) + +target_link_libraries( + rlPolynomialRootsDemo + math +) diff --git a/demos/rlPolynomialRootsDemo/rlPolynomialRootsDemo.cpp b/demos/rlPolynomialRootsDemo/rlPolynomialRootsDemo.cpp new file mode 100644 index 00000000..ffa753c2 --- /dev/null +++ b/demos/rlPolynomialRootsDemo/rlPolynomialRootsDemo.cpp @@ -0,0 +1,60 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include + +int +main(int argc, char** argv) +{ + if (argc < 2) + { + std::cout << "Usage: rlPolynomialRootsDemo C0 ... CN" << std::endl; + return EXIT_FAILURE; + } + + std::vector c(argc - 1); + + for (std::size_t i = 0; i < c.size(); ++i) + { + c[i] = boost::lexical_cast(argv[i + 1]); + std::cout << (i > 0 ? " + " : "") << c[i] << " * x^" << i; + } + + std::cout << " = 0" << std::endl; + + std::vector roots = rl::math::Polynomial::realRoots(c); + + std::cout << roots.size() << " solution" << (roots.size() != 1 ? "(s)" : "") << std::endl; + + for (std::size_t i = 0; i < roots.size(); ++i) + { + std::cout << "x[" << i << "] = " << roots[i] << std::endl; + } + + return EXIT_SUCCESS; +} diff --git a/demos/rlPrmDemo/CMakeLists.txt b/demos/rlPrmDemo/CMakeLists.txt index e32ba9af..b148d08e 100644 --- a/demos/rlPrmDemo/CMakeLists.txt +++ b/demos/rlPrmDemo/CMakeLists.txt @@ -1,10 +1,8 @@ -project(rlPrmDemo) - find_package(Boost REQUIRED) -find_package(Solid) +find_package(SOLID3) -if(SOLID_FOUND) +if(SOLID3_FOUND) add_executable( rlPrmDemo rlPrmDemo.cpp @@ -18,8 +16,8 @@ if(SOLID_FOUND) target_link_libraries( rlPrmDemo - rlplan - rlkin - rlsg + plan + kin + sg ) -endif(SOLID_FOUND) +endif() diff --git a/demos/rlPrmDemo/rlPrmDemo.cpp b/demos/rlPrmDemo/rlPrmDemo.cpp index f16cdddd..8cf33c56 100644 --- a/demos/rlPrmDemo/rlPrmDemo.cpp +++ b/demos/rlPrmDemo/rlPrmDemo.cpp @@ -25,11 +25,12 @@ // #include +#include #include #include -#include #include #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include int main(int argc, char** argv) @@ -45,7 +45,7 @@ main(int argc, char** argv) if (argc < 3) { std::cout << "Usage: rlPrmDemo SCENEFILE KINEMATICSFILE START1 ... STARTn GOAL1 ... GOALn" << std::endl; - return 1; + return EXIT_FAILURE; } try @@ -53,18 +53,20 @@ main(int argc, char** argv) rl::sg::solid::Scene scene; scene.load(argv[1]); - ::boost::shared_ptr< ::rl::kin::Kinematics > kinematics(::rl::kin::Kinematics::create(argv[2])); + std::shared_ptr kinematics(rl::kin::Kinematics::create(argv[2])); rl::plan::SimpleModel model; model.kin = kinematics.get(); model.model = scene.getModel(0); model.scene = &scene; + rl::plan::KdtreeNearestNeighbors nearestNeighbors(&model); rl::plan::Prm planner; rl::plan::UniformSampler sampler; rl::plan::RecursiveVerifier verifier; planner.model = &model; + planner.setNearestNeighbors(&nearestNeighbors); planner.sampler = &sampler; planner.verifier = &verifier; @@ -77,7 +79,7 @@ main(int argc, char** argv) for (std::size_t i = 0; i < kinematics->getDof(); ++i) { - start(i) = boost::lexical_cast< rl::math::Real >(argv[i + 3]); + start(i) = boost::lexical_cast(argv[i + 3]); } planner.start = &start; @@ -86,30 +88,28 @@ main(int argc, char** argv) for (std::size_t i = 0; i < kinematics->getDof(); ++i) { - goal(i) = boost::lexical_cast< rl::math::Real >(argv[kinematics->getDof() + i + 3]); + goal(i) = boost::lexical_cast(argv[kinematics->getDof() + i + 3]); } planner.goal = &goal; - rl::util::Timer timer; - std::cout << "construct() ... " << std::endl;; - timer.start(); + std::chrono::steady_clock::time_point startTime = std::chrono::steady_clock::now(); planner.construct(15); - timer.stop(); - std::cout << "construct() " << timer.elapsed() * 1000.0f << " ms" << std::endl; + std::chrono::steady_clock::time_point stopTime = std::chrono::steady_clock::now(); + std::cout << "construct() " << std::chrono::duration_cast>(stopTime - startTime).count() * 1000 << " ms" << std::endl; std::cout << "solve() ... " << std::endl;; - timer.start(); + startTime = std::chrono::steady_clock::now(); bool solved = planner.solve(); - timer.stop(); - std::cout << "solve() " << (solved ? "true" : "false") << " " << timer.elapsed() * 1000.0f << " ms" << std::endl; + stopTime = std::chrono::steady_clock::now(); + std::cout << "solve() " << (solved ? "true" : "false") << " " << std::chrono::duration_cast>(stopTime - startTime).count() * 1000 << " ms" << std::endl; - return 0; + return EXIT_SUCCESS; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; - return -1; + return EXIT_FAILURE; } } diff --git a/demos/rlPumaDemo/CMakeLists.txt b/demos/rlPumaDemo/CMakeLists.txt index 53095cfb..db109f04 100644 --- a/demos/rlPumaDemo/CMakeLists.txt +++ b/demos/rlPumaDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlPumaDemo) - find_package(Boost REQUIRED) add_executable( @@ -15,5 +13,5 @@ target_include_directories( target_link_libraries( rlPumaDemo - rlkin + kin ) diff --git a/demos/rlPumaDemo/rlPumaDemo.cpp b/demos/rlPumaDemo/rlPumaDemo.cpp index 90fe3e21..ecca7c58 100644 --- a/demos/rlPumaDemo/rlPumaDemo.cpp +++ b/demos/rlPumaDemo/rlPumaDemo.cpp @@ -27,11 +27,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -43,20 +43,20 @@ main(int argc, char** argv) if (argc < 8) { std::cout << "Usage: rlPumaDemo PUMAFILE Q1 Q2 Q3 Q4 Q5 Q6" << std::endl; - return 1; + return EXIT_FAILURE; } try { - boost::shared_ptr< rl::kin::Kinematics > kinematics(rl::kin::Kinematics::create(argv[1])); + std::shared_ptr kinematics(rl::kin::Kinematics::create(argv[1])); - if (rl::kin::Puma* puma = dynamic_cast< rl::kin::Puma* >(kinematics.get())) + if (rl::kin::Puma* puma = dynamic_cast(kinematics.get())) { rl::math::Vector q(puma->getDof()); for (std::ptrdiff_t i = 0; i < q.size(); ++i) { - q(i) = boost::lexical_cast< rl::math::Real >(argv[i + 2]) * rl::math::DEG2RAD; + q(i) = boost::lexical_cast(argv[i + 2]) * rl::math::DEG2RAD; } rl::kin::Puma::Arm arm; @@ -94,7 +94,7 @@ main(int argc, char** argv) if (!puma->inversePosition(x, q2)) { std::cout << "out of reach" << std::endl; - return 1; + return EXIT_FAILURE; } std::cout << "q=" << std::endl << q2.transpose() * rl::math::RAD2DEG << std::endl; @@ -108,14 +108,14 @@ main(int argc, char** argv) } else { - return 1; + return EXIT_FAILURE; } } catch (const std::exception& e) { std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlQuaternionDemo/CMakeLists.txt b/demos/rlQuaternionDemo/CMakeLists.txt index d098e428..193aebae 100644 --- a/demos/rlQuaternionDemo/CMakeLists.txt +++ b/demos/rlQuaternionDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlQuaternionDemo) - add_executable( rlQuaternionDemo rlQuaternionDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlQuaternionDemo - rlmath + math ) diff --git a/demos/rlQuaternionDemo/rlQuaternionDemo.cpp b/demos/rlQuaternionDemo/rlQuaternionDemo.cpp index e95a01f8..b6935547 100644 --- a/demos/rlQuaternionDemo/rlQuaternionDemo.cpp +++ b/demos/rlQuaternionDemo/rlQuaternionDemo.cpp @@ -24,10 +24,14 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include +#include #include +#include #include #include #include +#include #include #include #include @@ -35,52 +39,294 @@ int main(int argc, char** argv) { - rl::math::Matrix33 r1( - ::rl::math::AngleAxis(120.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitZ()) * - ::rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitY()) * - ::rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitX()) - ); - std::cout << "r1 = " << std::endl << r1 << std::endl; + { + rl::math::Matrix33 r1( + rl::math::AngleAxis(90.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + std::cout << "r1 = " << std::endl << r1 << std::endl; + + rl::math::Quaternion q1(r1); + std::cout << "q1 = " << q1.coeffs().transpose() << std::endl; + + r1 = q1.toRotationMatrix(); + std::cout << "r1 = " << std::endl << r1 << std::endl; + + rl::math::Matrix33 r2( + rl::math::AngleAxis(-90.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + std::cout << "r2 = " << std::endl << r2 << std::endl; + + rl::math::Quaternion q2(r2); + std::cout << "q2 = " << q2.coeffs().transpose() << std::endl; + + rl::math::Quaternion q = q1.slerp(0.5f, q2); + std::cout << "q = " << q.coeffs().transpose() << std::endl; + + rl::math::Matrix33 r(q); + std::cout << "r = " << std::endl << r << std::endl; + + std::cout << "q1 -> q2 = " << q1.angularDistance(q2) << std::endl; + std::cout << "q1 -> q = " << q1.angularDistance(q) << std::endl; + std::cout << "q -> q2 = " << q.angularDistance(q2) << std::endl; + + std::cout << "log(q1) = " << q1.log().coeffs().transpose() << std::endl; + std::cout << "exp(q1) = " << q1.exp().coeffs().transpose() << std::endl; + std::cout << "exp(log(q1)) = " << q1.log().exp().coeffs().transpose() << std::endl; + + std::cout << "q1^1 = " << q1.pow(1).coeffs().transpose() << std::endl; + std::cout << "q1^2 = " << q1.pow(2).coeffs().transpose() << std::endl; + std::cout << "(q1^2)^0.5 = " << q1.pow(2).pow(0.5).coeffs().transpose() << std::endl; + + rl::math::Vector3 omega( + 45.0f * rl::math::DEG2RAD, + 90.0f * rl::math::DEG2RAD, + 135.0f * rl::math::DEG2RAD + ); + std::cout << "omega = " << omega.transpose() * rl::math::RAD2DEG << std::endl; + + rl::math::Quaternion qd = q1.firstDerivative(omega); + std::cout << "qd = " << qd.coeffs().transpose() << std::endl; + + omega = q1.angularVelocity(qd); + std::cout << "omega = " << omega.transpose() * rl::math::RAD2DEG << std::endl; + + rl::math::Vector3 omegad( + 450.0f * rl::math::DEG2RAD, + 900.0f * rl::math::DEG2RAD, + 1350.0f * rl::math::DEG2RAD + ); + std::cout << "omegad = " << omegad.transpose() * rl::math::RAD2DEG << std::endl; + + rl::math::Quaternion qdd = q1.secondDerivative(qd, omega, omegad); + std::cout << "qdd = " << qdd.coeffs().transpose() << std::endl; + + omegad = q1.angularAcceleration(qd, qdd); + std::cout << "omegad = " << omegad.transpose() * rl::math::RAD2DEG << std::endl; + } - rl::math::Quaternion q1(r1); - std::cout << "q1 = " << q1.coeffs().transpose() << std::endl; + { + rl::math::Quaternion q0( + rl::math::AngleAxis(90.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + rl::math::Quaternion q1( + rl::math::AngleAxis(45.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(60.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(45.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + rl::math::Quaternion q2( + rl::math::AngleAxis(45.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(10.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(30.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + rl::math::Quaternion q3( + rl::math::AngleAxis(90.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(10.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ); + + rl::math::Vector3 p(1, 0, 0); + + std::size_t steps = 100; + + // splot "slerp.dat" u 1:2:3 with lines + std::ofstream slerp; + slerp.open("slerp.dat", std::fstream::trunc); + + // plot for [i=2:4] "slerpFirstDerivative.dat" using 1:i with lines + std::ofstream slerpFirstDerivative; + slerpFirstDerivative.open("slerpFirstDerivative.dat", std::fstream::trunc); + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion q = q0.slerp(t, q1); + slerp << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q0.slerpFirstDerivative(t, q1); + rl::math::Vector3 omega = q.angularVelocity(qd); + slerpFirstDerivative << i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion q = q1.slerp(t, q2); + slerp << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q1.slerpFirstDerivative(t, q2); + rl::math::Vector3 omega = q.angularVelocity(qd); + slerpFirstDerivative << steps + i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion q = q2.slerp(static_cast(i) / static_cast(steps), q3); + slerp << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q2.slerpFirstDerivative(t, q3); + rl::math::Vector3 omega = q.angularVelocity(qd); + slerpFirstDerivative << 2 * steps + i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + slerp.close(); + slerpFirstDerivative.close(); + + // splot "squad.dat" u 1:2:3 with lines + std::ofstream squad; + squad.open("squad.dat", std::fstream::trunc); + + // plot for [i=2:4] "squadFirstDerivative.dat" using 1:i with lines + std::ofstream squadFirstDerivative; + squadFirstDerivative.open("squadFirstDerivative.dat", std::fstream::trunc); + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion a = q0.squadControlPoint(q0, q1); + rl::math::Quaternion b = q1.squadControlPoint(q0, q2); + rl::math::Quaternion q = q0.squad(t, a, b, q1); + squad << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q0.squadFirstDerivative(t, a, b, q1); + rl::math::Vector3 omega = q.angularVelocity(qd); + squadFirstDerivative << i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion a = q1.squadControlPoint(q0, q2); + rl::math::Quaternion b = q2.squadControlPoint(q1, q3); + rl::math::Quaternion q = q1.squad(t, a, b, q2); + squad << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q1.squadFirstDerivative(t, a, b, q2); + rl::math::Vector3 omega = q.angularVelocity(qd); + squadFirstDerivative << steps + i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = static_cast(i) / static_cast(steps); + + rl::math::Quaternion a = q2.squadControlPoint(q1, q3); + rl::math::Quaternion b = q3.squadControlPoint(q2, q3); + rl::math::Quaternion q = q2.squad(t, a, b, q3); + squad << q._transformVector(p).transpose() << std::endl; + + rl::math::Quaternion qd = q2.squadFirstDerivative(t, a, b, q3); + rl::math::Vector3 omega = q.angularVelocity(qd); + squadFirstDerivative << 2 * steps + i << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + } + + squad.close(); + squadFirstDerivative.close(); + } - r1 = q1.toRotationMatrix(); - std::cout << "r1 = " << std::endl << r1 << std::endl; + { + std::vector y; + y.push_back(rl::math::Quaternion(1, 0, 0, 0)); + y.push_back(rl::math::Quaternion(0.5f * std::sqrt(2.0f), 0, -0.5f * std::sqrt(2.0f), 0)); + y.push_back(rl::math::Quaternion(0.5, -0.5, -0.5, 0.5)); + y.push_back(rl::math::Quaternion(0.5f * std::sqrt(2.0f), 0, 0, 0.5f * std::sqrt(2.0f))); + y.push_back(rl::math::Quaternion(1, 0, 0, 0)); + + std::vector x; + x.push_back(0); + x.push_back(90); + x.push_back(180); + x.push_back(270); + x.push_back(360); + + rl::math::Vector3 yd0; + yd0 << 0, 1 * rl::math::DEG2RAD, 0; + rl::math::Vector3 yd1; + yd1 << 0, 1 * rl::math::DEG2RAD, 0; + + rl::math::Spline f = rl::math::Spline::CubicFirst(x, y, yd0, yd1); + + std::size_t steps = 999; + + // plot for [i=2:5] "cubic.dat" using 1:i with lines + std::ofstream cubic; + cubic.open("cubic.dat", std::fstream::trunc); + + // plot for [i=2:4] "cubicFirstDerivative.dat" using 1:i with lines + std::ofstream cubicFirstDerivative; + cubicFirstDerivative.open("cubicFirstDerivative.dat", std::fstream::trunc); + + // plot for [i=2:4] "cubicSecondDerivative.dat" using 1:i with lines + std::ofstream cubicSecondDerivative; + cubicSecondDerivative.open("cubicSecondDerivative.dat", std::fstream::trunc); + + for (std::size_t i = 0; i < steps; ++i) + { + rl::math::Real t = f.duration() * i / static_cast(steps - 1); + + rl::math::Quaternion q = f(t); + cubic << t << "\t" << q.coeffs().transpose() << std::endl; + + rl::math::Quaternion qd = f(t, 1); + rl::math::Vector3 omega = q.angularVelocity(qd); + cubicFirstDerivative << t << "\t" << omega.transpose() * rl::math::RAD2DEG << std::endl; + + rl::math::Quaternion qdd = f(t, 2); + rl::math::Vector3 omegad = q.angularAcceleration(qd, qdd); + cubicSecondDerivative << t << "\t" << omegad.transpose() * rl::math::RAD2DEG << std::endl; + } + + cubic.close(); + cubicFirstDerivative.close(); + cubicSecondDerivative.close(); + } - rl::math::Matrix33 r2( - ::rl::math::AngleAxis(-120.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitZ()) * - ::rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitY()) * - ::rl::math::AngleAxis(0.0f * rl::math::DEG2RAD, ::rl::math::Vector3::UnitX()) - ); - std::cout << "r2 = " << std::endl << r2 << std::endl; + { + rl::math::Vector3 point(0, 0, 1); + + std::function rand = std::bind(std::uniform_real_distribution(0.0, 1.0), std::mt19937(0)); + rl::math::Quaternion uniform; + + // splot "uniformQuaternions.dat" using 2:3:4 + std::ofstream uniformQuaternions; + uniformQuaternions.open("uniformQuaternions.dat", std::fstream::trunc); + + for (std::size_t i = 0; i < 10000; ++i) + { + uniform.setFromUniform(rl::math::Vector3(rand(), rand(), rand())); + rl::math::Vector3 rotated = uniform._transformVector(point); + uniformQuaternions << i << "\t" << rotated.transpose() << std::endl; + } + + uniformQuaternions.close(); + + std::function gauss = std::bind(std::normal_distribution(0.0, 1.0), std::mt19937(0)); + rl::math::Quaternion normal; + + // splot "normalQuaternions.dat" using 2:3:4 + std::ofstream normalQuaternions; + normalQuaternions.open("normalQuaternions.dat", std::fstream::trunc); + + for (std::size_t i = 0; i < 10000; ++i) + { + normal.setFromGaussian(rl::math::Vector3(gauss(), gauss(), gauss()), rl::math::Quaternion::Identity(), rl::math::Vector3(0.25, 0.125, 0.0625)); + rl::math::Vector3 rotated = normal._transformVector(point); + normalQuaternions << i << "\t" << rotated.transpose() << std::endl; + } + + normalQuaternions.close(); + } - rl::math::Quaternion q2(r2); - std::cout << "q2 = " << q2.coeffs().transpose() << std::endl; - - rl::math::Quaternion q = q1.slerp(0.5f, q2); - std::cout << "q = " << q.coeffs().transpose() << std::endl; - - rl::math::Matrix33 r(q); - std::cout << "r = " << std::endl << r << std::endl; - - std::cout << q1.angularDistance(q2) << std::endl; - std::cout << q1.angularDistance(q) << std::endl; - std::cout << q.angularDistance(q2) << std::endl; - -// rl::math::Transform t1; -// boost::numeric::bindings::ippm::loadIdentity(t1); -// rl::math::rotation::fromXyz(0.0f * rl::math::DEG2RAD, 0.0f * rl::math::DEG2RAD, 120.0f * rl::math::DEG2RAD, t1); -// std::cout << t1 << std::endl; -// -// rl::math::Transform t2; -// boost::numeric::bindings::ippm::loadIdentity(t2); -// rl::math::rotation::fromXyz(0.0f * rl::math::DEG2RAD, 0.0f * rl::math::DEG2RAD, -120.0f * rl::math::DEG2RAD, t2); -// std::cout << t2 << std::endl; -// -// rl::math::Transform t3; -// rl::math::transform::slerp(t1, t2, 0.5f, t3); -// std::cout << t3 << std::endl; - - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlRangeSensorDemo/CMakeLists.txt b/demos/rlRangeSensorDemo/CMakeLists.txt index 051df87d..8cb3f5cf 100644 --- a/demos/rlRangeSensorDemo/CMakeLists.txt +++ b/demos/rlRangeSensorDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlRangeSensorDemo) - add_executable( rlRangeSensorDemo rlRangeSensorDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlRangeSensorDemo - rlhal + hal ) diff --git a/demos/rlRangeSensorDemo/rlRangeSensorDemo.cpp b/demos/rlRangeSensorDemo/rlRangeSensorDemo.cpp index 9dd5cb79..fc724a39 100644 --- a/demos/rlRangeSensorDemo/rlRangeSensorDemo.cpp +++ b/demos/rlRangeSensorDemo/rlRangeSensorDemo.cpp @@ -85,24 +85,21 @@ main(int argc, char** argv) sensor.open(); sensor.start(); - rl::math::Vector data(sensor.getDistancesCount()); - while (running) { sensor.step(); - sensor.getDistances(data); - + rl::math::Vector data = sensor.getDistances(); std::cout << data << std::endl; } sensor.stop(); sensor.close(); - return 0; + return EXIT_SUCCESS; } catch (const std::exception& e) { std::cout << e.what() << std::endl; - return -1; + return EXIT_FAILURE; } } diff --git a/demos/rlRodriguesDemo/CMakeLists.txt b/demos/rlRodriguesDemo/CMakeLists.txt deleted file mode 100644 index 8dc35471..00000000 --- a/demos/rlRodriguesDemo/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(rlRodriguesDemo) - -add_executable( - rlRodriguesDemo - rlRodriguesDemo.cpp -) - -target_link_libraries( - rlRodriguesDemo - rlmath -) diff --git a/demos/rlSimulator/CMakeLists.txt b/demos/rlSimulator/CMakeLists.txt new file mode 100644 index 00000000..0aeef929 --- /dev/null +++ b/demos/rlSimulator/CMakeLists.txt @@ -0,0 +1,157 @@ +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + find_package(Boost REQUIRED) +endif() + +find_package(OpenGL REQUIRED) +find_package(SoQt) + +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui Network OpenGL Widgets QUIET) +endif() + +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +if(QT_FOUND AND SoQt_FOUND) + set( + HDRS + ConfigurationDelegate.h + ConfigurationModel.h + MainWindow.h + OperationalDelegate.h + OperationalModel.h + Server.h + Socket.h + SoGradientBackground.h + ) + + set( + SRCS + rlSimulator.cpp + ConfigurationDelegate.cpp + ConfigurationModel.cpp + MainWindow.cpp + OperationalDelegate.cpp + OperationalModel.cpp + Server.cpp + Socket.cpp + SoGradientBackground.cpp + ${rl_SOURCE_DIR}/robotics-library.rc + ) + + add_executable( + rlSimulator + WIN32 + ${HDRS} + ${SRCS} + ) + + target_compile_definitions( + rlSimulator + PUBLIC + ${SoQt_DEFINITIONS} + ) + + if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( + rlSimulator + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED + ) + endif() + + target_include_directories( + rlSimulator + PUBLIC + ${Boost_INCLUDE_DIR} + ${Coin_INCLUDE_DIRS} + ${OPENGL_INCLUDE_DIR} + ${SoQt_INCLUDE_DIRS} + ) + + target_link_libraries( + rlSimulator + math + mdl + sg + ${Coin_LIBRARIES} + ${OPENGL_LIBRARIES} + ${QT_LIBRARIES} + ${SoQt_LIBRARIES} + ) + + set_target_properties( + rlSimulator + PROPERTIES + VERSION ${VERSION} + ) + + if(WIN32) + set_target_properties( + rlSimulator + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + + install( + TARGETS rlSimulator + COMPONENT demos + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + + if(UNIX) + configure_file(rlSimulator.desktop.in rlSimulator.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlSimulator.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() + + set( + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} + "CreateShortCut \\\\ + \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlSimulator.lnk\\\" \\\\ + \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlSimulator.exe\\\" \\\\ + \\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\" \\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlmdl\\\\unimation-puma560.xml\\\$\\\\\\\"\\\\ + \\\" \\\\ + \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ + \\\"Simulation demo with Unimation Puma 560\\\"" + PARENT_SCOPE + ) + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlSimulator.lnk\\\"" PARENT_SCOPE) + + set( + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" + PARENT_SCOPE + ) +endif() + diff --git a/demos/rlSimulator/ConfigurationDelegate.cpp b/demos/rlSimulator/ConfigurationDelegate.cpp new file mode 100644 index 00000000..74d2b7c6 --- /dev/null +++ b/demos/rlSimulator/ConfigurationDelegate.cpp @@ -0,0 +1,158 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include +#include + +#include "ConfigurationDelegate.h" +#include "MainWindow.h" + +ConfigurationDelegate::ConfigurationDelegate(QObject* parent) : + QItemDelegate(parent) +{ +} + +ConfigurationDelegate::~ConfigurationDelegate() +{ +} + +void +ConfigurationDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); +} + +void +ConfigurationDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->interpretText(); + + if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) + { + doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + } +} + +void +ConfigurationDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + editor->setGeometry(option.rect); +} + +void +ConfigurationDelegate::valueChanged(double d) +{ + emit commitData(static_cast(QObject::sender())); +} + +QWidget* +PositionDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + rl::math::Vector maximum = MainWindow::instance()->kinematicModels->getMaximum(); + rl::math::Vector minimum = MainWindow::instance()->kinematicModels->getMinimum(); + Eigen::Matrix qUnits = MainWindow::instance()->kinematicModels->getPositionUnits(); + + if (rl::math::UNIT_RADIAN == qUnits(index.row())) + { + editor->setMinimum(minimum(index.row()) * rl::math::RAD2DEG); + editor->setMaximum(maximum(index.row()) * rl::math::RAD2DEG); + editor->setSingleStep(1.0f); + } + else + { + editor->setMinimum(minimum(index.row())); + editor->setMaximum(maximum(index.row())); + editor->setSingleStep(0.1f); + } + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} + +QWidget* +VelocityDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + Eigen::Matrix qUnits = MainWindow::instance()->kinematicModels->getVelocityUnits(); + + editor->setRange(-10000, 10000); //TODO? + if (rl::math::UNIT_RADIAN == qUnits(index.row())) + { + editor->setSingleStep(1.0f); + } + else + { + editor->setSingleStep(0.1f); + } + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} + +QWidget* +AccelerationDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + Eigen::Matrix qUnits = MainWindow::instance()->kinematicModels->getVelocityUnits(); + + editor->setRange(-10000, 10000); + if (rl::math::UNIT_RADIAN == qUnits(index.row())) + { + editor->setSingleStep(10.0f); + } + else + { + editor->setSingleStep(1.0f); + } + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} + +QWidget* +TorqueDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + editor->setRange(-1000, 1000); + editor->setSingleStep(1.0f); + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} diff --git a/demos/rlSimulator/ConfigurationDelegate.h b/demos/rlSimulator/ConfigurationDelegate.h new file mode 100644 index 00000000..f2e4c5d2 --- /dev/null +++ b/demos/rlSimulator/ConfigurationDelegate.h @@ -0,0 +1,128 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef CONFIGURATIONDELEGATE_H +#define CONFIGURATIONDELEGATE_H + +#include + +class ConfigurationDelegate : public QItemDelegate +{ + Q_OBJECT + +public: + ConfigurationDelegate(QObject* parent = nullptr); + + virtual ~ConfigurationDelegate(); + + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const = 0; + + void setEditorData(QWidget* editor, const QModelIndex& index) const; + + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; + + std::size_t id; + +public slots: + void valueChanged(double d); + +protected: + +private: + +}; + +class PositionDelegate : public ConfigurationDelegate +{ +public: + PositionDelegate(QObject* parent = nullptr) + : ConfigurationDelegate(parent) + { + + } + + virtual ~PositionDelegate() + { + + } + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; +}; + +class VelocityDelegate : public ConfigurationDelegate +{ +public: + VelocityDelegate(QObject* parent = nullptr) + : ConfigurationDelegate(parent) + { + + } + + virtual ~VelocityDelegate() + { + + } + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; +}; + +class AccelerationDelegate : public ConfigurationDelegate +{ +public: + AccelerationDelegate(QObject* parent = nullptr) + : ConfigurationDelegate(parent) + { + + } + + virtual ~AccelerationDelegate() + { + + } + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; +}; + +class TorqueDelegate : public ConfigurationDelegate +{ +public: + TorqueDelegate(QObject* parent = nullptr) + : ConfigurationDelegate(parent) + { + + } + + virtual ~TorqueDelegate() + { + + } + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; +}; + +#endif // CONFIGURATIONDELEGATE_H diff --git a/demos/rlSimulator/ConfigurationModel.cpp b/demos/rlSimulator/ConfigurationModel.cpp new file mode 100644 index 00000000..d86b88da --- /dev/null +++ b/demos/rlSimulator/ConfigurationModel.cpp @@ -0,0 +1,419 @@ +// +// Copyright (c) 2009, Andre Gaschler +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include + +#include "ConfigurationModel.h" +#include "MainWindow.h" + +ConfigurationModel::ConfigurationModel(QObject* parent) : + QAbstractTableModel(parent) +{ +} + +ConfigurationModel::~ConfigurationModel() +{ +} + +int +ConfigurationModel::columnCount(const QModelIndex& parent) const +{ + return 1; +} + +Qt::ItemFlags +ConfigurationModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + { + return Qt::NoItemFlags; + } + + return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; +} + +QVariant +ConfigurationModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (Qt::DisplayRole == role && Qt::Vertical == orientation) + { + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels.get())) + { + for (std::size_t i = 0, j = 0; i < kinematic->getJoints(); ++i) + { + rl::mdl::Joint* joint = kinematic->getJoint(i); + + for (std::size_t k = 0; k < joint->getDofPosition(); ++j, ++k) + { + if (section == j) + { + return QString::fromStdString(joint->getName()); + } + } + } + } + } + + return QVariant(); +} + +void +ConfigurationModel::operationalChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) +{ + this->beginResetModel(); + this->endResetModel(); +} + +bool +ConfigurationModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return false; + } + + if (index.isValid() && Qt::EditRole == role) + { + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels.get())) + { + if (dynamic_cast(this)) + { + rl::math::Vector q = kinematic->getPosition(); + Eigen::Matrix qUnits = kinematic->getPositionUnits(); + + if (rl::math::UNIT_RADIAN == qUnits(index.row())) + { + q(index.row()) = value.value() * rl::math::DEG2RAD; + } + else + { + q(index.row()) = value.value(); + } + + kinematic->setPosition(q); + kinematic->forwardPosition(); + + for (std::size_t i = 0; i < MainWindow::instance()->geometryModels->getNumBodies(); ++i) + { + MainWindow::instance()->geometryModels->getBody(i)->setFrame(kinematic->getFrame(i)); + } + } + else if (dynamic_cast(this)) + { + rl::math::Vector qd = kinematic->getVelocity(); + Eigen::Matrix qdUnits = kinematic->getVelocityUnits(); + + if (rl::math::UNIT_RADIAN == qdUnits(index.row())) + { + qd(index.row()) = value.value() * rl::math::DEG2RAD; + } + else + { + qd(index.row()) = value.value(); + } + + kinematic->setVelocity(qd); + } + else if (dynamic_cast(this)) + { + rl::math::Vector qdd = kinematic->getAcceleration(); + Eigen::Matrix qddUnits = kinematic->getAccelerationUnits(); + + if (rl::math::UNIT_RADIAN == qddUnits(index.row())) + { + qdd(index.row()) = value.value() * rl::math::DEG2RAD; + } + else + { + qdd(index.row()) = value.value(); + } + + kinematic->setAcceleration(qdd); + } + else if (dynamic_cast(this)) + { + MainWindow::instance()->externalTorque(index.row()) = value.value(); + } + + emit dataChanged(index, index); + + return true; + } + } + + return false; +} + +bool +ConfigurationModel::setData(const rl::math::Vector& values) +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return false; + } + + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels.get())) + { + if (dynamic_cast(this)) + { + kinematic->setPosition(values); + kinematic->forwardPosition(); + + for (std::size_t i = 0; i < MainWindow::instance()->geometryModels->getNumBodies(); ++i) + { + MainWindow::instance()->geometryModels->getBody(i)->setFrame(kinematic->getFrame(i)); + } + } + else if (dynamic_cast(this)) + { + kinematic->setVelocity(values); + } + else if (dynamic_cast(this)) + { + kinematic->setAcceleration(values); + } + else if (dynamic_cast(this)) + { + MainWindow::instance()->externalTorque = values; + } + + emit dataChanged(this->createIndex(0, 0), this->createIndex(this->rowCount(), this->columnCount())); + + return true; + } + + return false; +} + + +int +PositionModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return 0; + } + + return MainWindow::instance()->kinematicModels->getDofPosition(); +} + + +int +VelocityModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return 0; + } + + return MainWindow::instance()->kinematicModels->getDof(); +} + + +int +AccelerationModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return 0; + } + + return MainWindow::instance()->kinematicModels->getDof(); +} + +int +TorqueModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return 0; + } + + return MainWindow::instance()->kinematicModels->getDof(); +} + +QVariant +PositionModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + { + rl::math::Vector values = MainWindow::instance()->kinematicModels->getPosition(); + Eigen::Matrix units = MainWindow::instance()->kinematicModels->getPositionUnits(); + + if (rl::math::UNIT_RADIAN == units(index.row())) + { + return values(index.row()) * rl::math::RAD2DEG; + } + else + { + return values(index.row()); + } + } + break; + case Qt::TextAlignmentRole: + return Qt::AlignRight; + break; + default: + break; + } + + return QVariant(); +} + +QVariant +VelocityModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + { + rl::math::Vector values = MainWindow::instance()->kinematicModels->getVelocity(); + Eigen::Matrix units = MainWindow::instance()->kinematicModels->getVelocityUnits(); + + if (rl::math::UNIT_RADIAN == units(index.row())) + { + return values(index.row()) * rl::math::RAD2DEG; + } + else + { + return values(index.row()); + } + } + break; + case Qt::TextAlignmentRole: + return Qt::AlignRight; + break; + default: + break; + } + + return QVariant(); +} + +QVariant +AccelerationModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + { + rl::math::Vector values = MainWindow::instance()->kinematicModels->getAcceleration(); + Eigen::Matrix units = MainWindow::instance()->kinematicModels->getAccelerationUnits(); + + if (rl::math::UNIT_RADIAN == units(index.row())) + { + return values(index.row()) * rl::math::RAD2DEG; + } + else + { + return values(index.row()); + } + } + break; + case Qt::TextAlignmentRole: + return Qt::AlignRight; + break; + default: + break; + } + + return QVariant(); +} + + +QVariant +TorqueModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + { + return MainWindow::instance()->externalTorque(index.row()); + } + break; + case Qt::TextAlignmentRole: + return Qt::AlignRight; + break; + default: + break; + } + + return QVariant(); +} diff --git a/demos/rlSimulator/ConfigurationModel.h b/demos/rlSimulator/ConfigurationModel.h new file mode 100644 index 00000000..f4c377b1 --- /dev/null +++ b/demos/rlSimulator/ConfigurationModel.h @@ -0,0 +1,133 @@ +// +// Copyright (c) 2009, Andre Gaschler +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef CONFIGURATIONMODEL_H +#define CONFIGURATIONMODEL_H + +#include +#include + +class ConfigurationModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + ConfigurationModel(QObject* parent = nullptr); + + virtual ~ConfigurationModel(); + + int columnCount(const QModelIndex& parent = QModelIndex()) const; + + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const = 0; + + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const = 0; + + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + + bool setData(const rl::math::Vector& q); + +public slots: + void operationalChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); + +protected: + +private: + +}; + +class PositionModel : public ConfigurationModel +{ +public: + PositionModel(QObject* parent = nullptr) + : ConfigurationModel(parent) + { + } + + virtual ~PositionModel() + { + } + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; +}; + +class VelocityModel : public ConfigurationModel +{ +public: + VelocityModel(QObject* parent = nullptr) + : ConfigurationModel(parent) + { + } + + virtual ~VelocityModel() + { + } + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; +}; + +class AccelerationModel : public ConfigurationModel +{ +public: + AccelerationModel(QObject* parent = nullptr) + : ConfigurationModel(parent) + { + } + + virtual ~AccelerationModel() + { + } + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; +}; + +class TorqueModel : public ConfigurationModel +{ +public: + TorqueModel(QObject* parent = nullptr) + : ConfigurationModel(parent) + { + } + + virtual ~TorqueModel() + { + } + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; +}; + +#endif // CONFIGURATIONMODEL_H diff --git a/demos/rlSimulator/MainWindow.cpp b/demos/rlSimulator/MainWindow.cpp new file mode 100644 index 00000000..8777ed23 --- /dev/null +++ b/demos/rlSimulator/MainWindow.cpp @@ -0,0 +1,557 @@ +// +// Copyright (c) 2009, Andre Gaschler +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ConfigurationDelegate.h" +#include "ConfigurationModel.h" +#include "MainWindow.h" +#include "OperationalDelegate.h" +#include "OperationalModel.h" +#include "Server.h" +#include "SoGradientBackground.h" + +MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags f) : + QMainWindow(parent, f), + accelerationModel(nullptr), + externalTorque(), + geometryModels(nullptr), + kinematicModels(), + operationalModel(nullptr), + positionModel(nullptr), + scene(), + torqueModel(nullptr), + velocityModel(nullptr), + accelerationDelegate(nullptr), + accelerationDockWidget(new QDockWidget(this)), + accelerationView(nullptr), + gradientBackground(), + operationalDelegate(nullptr), + operationalDockWidget(new QDockWidget(this)), + operationalViews(nullptr), + positionDelegate(nullptr), + positionDockWidget(new QDockWidget(this)), + positionView(nullptr), + saveImageAction(new QAction(this)), + saveSceneAction(new QAction(this)), + server(new Server(this)), + serverConnectionStatus(nullptr), + simulationDampingFactor(nullptr), + simulationDampingValue(0.001f), + simulationDockWidget(new QDockWidget(this)), + simulationGravity(nullptr), + simulationGravityValue(9.81f), + simulationIsRunning(true), + simulationPause(nullptr), + simulationReset(nullptr), + simulationResultsEnergy(nullptr), + simulationResultsTime(nullptr), + simulationResetQ(), + simulationResetQd(), + simulationResetQdd(), + simulationStart(nullptr), + simulationStepsPerFrame(50), + simulationTime(nullptr), + simulationTimeElapsed(0), + simulationTimeStep(0.001f), + timer(), + torqueDelegate(nullptr), + torqueDockWidget(new QDockWidget(this)), + torqueView(nullptr), + velocityDelegate(nullptr), + velocityDockWidget(new QDockWidget(this)), + velocityView(nullptr), + viewer(nullptr) +{ + MainWindow::singleton = this; + + SoQt::init(this); + SoDB::init(); + SoGradientBackground::initClass(); + + this->scene = std::make_shared(); + this->scene->load(QApplication::arguments()[1].toStdString()); + + rl::mdl::XmlFactory factory; + + this->geometryModels = this->scene->getModel(0); + this->kinematicModels.reset(factory.create(QApplication::arguments()[2].toStdString())); + this->simulationResetQ = rl::math::Vector::Zero(kinematicModels->getDof()); + this->simulationResetQd = rl::math::Vector::Zero(kinematicModels->getDof()); + this->simulationResetQdd = rl::math::Vector::Zero(kinematicModels->getDof()); + + this->positionDelegate = new PositionDelegate(this); + this->positionModel = new PositionModel(this); + this->positionView = new QTableView(this); +#if QT_VERSION >= 0x050000 + this->positionView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->positionView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->positionView->horizontalHeader()->hide(); + this->positionView->setAlternatingRowColors(true); + this->positionView->setItemDelegate(positionDelegate); + this->positionView->setModel(positionModel); +#if QT_VERSION >= 0x050000 + this->positionView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else // QT_VERSION + this->positionView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif // QT_VERSION + + this->velocityDelegate = new VelocityDelegate(this); + this->velocityModel = new VelocityModel(this); + this->velocityView = new QTableView(this); +#if QT_VERSION >= 0x050000 + this->velocityView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->velocityView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->velocityView->horizontalHeader()->hide(); + this->velocityView->setAlternatingRowColors(true); + this->velocityView->setItemDelegate(velocityDelegate); + this->velocityView->setModel(velocityModel); +#if QT_VERSION >= 0x050000 + this->velocityView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else // QT_VERSION + this->velocityView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif // QT_VERSION + + this->accelerationDelegate = new AccelerationDelegate(this); + this->accelerationModel = new AccelerationModel(this); + this->accelerationView = new QTableView(this); +#if QT_VERSION >= 0x050000 + this->accelerationView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->accelerationView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->accelerationView->horizontalHeader()->hide(); + this->accelerationView->setAlternatingRowColors(true); + this->accelerationView->setItemDelegate(accelerationDelegate); + this->accelerationView->setModel(accelerationModel); +#if QT_VERSION >= 0x050000 + this->accelerationView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else // QT_VERSION + this->accelerationView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif // QT_VERSION + + this->torqueDelegate = new TorqueDelegate(this); + this->torqueModel = new TorqueModel(this); + this->torqueView = new QTableView(this); +#if QT_VERSION >= 0x050000 + this->torqueView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + this->torqueView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + this->torqueView->horizontalHeader()->hide(); + this->torqueView->setAlternatingRowColors(true); + this->torqueView->setItemDelegate(torqueDelegate); + this->torqueView->setModel(torqueModel); +#if QT_VERSION >= 0x050000 + this->torqueView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else // QT_VERSION + this->torqueView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif // QT_VERSION + + OperationalDelegate* operationalDelegate = new OperationalDelegate(this); + this->operationalDelegate = operationalDelegate; + + OperationalModel* operationalModel = new OperationalModel(this); + this->operationalModel = operationalModel; + + QTableView* operationalView = new QTableView(this); +#if QT_VERSION >= 0x050000 + operationalView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else // QT_VERSION + operationalView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // QT_VERSION + operationalView->setAlternatingRowColors(true); + operationalView->setItemDelegate(operationalDelegate); + operationalView->setModel(operationalModel); +#if QT_VERSION >= 0x050000 + operationalView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#else // QT_VERSION + operationalView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#endif // QT_VERSION + this->operationalViews = operationalView; + + QObject::connect( + positionModel, + SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), + operationalModel, + SLOT(configurationChanged(const QModelIndex&, const QModelIndex&)) + ); + + QObject::connect( + operationalModel, + SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), + positionModel, + SLOT(operationalChanged(const QModelIndex&, const QModelIndex&)) + ); + + rl::math::Vector q(this->kinematicModels->getDof()); + q.setZero(); + positionModel->setData(q); //TODO? + + rl::math::Vector externalTorque = rl::math::Vector::Zero(this->kinematicModels->getDof()); + this->externalTorque = externalTorque; + torqueModel->setData(externalTorque); + + QWidget* simulationDockWidgetContent = new QWidget(simulationDockWidget); + QGroupBox* simulationGroup = new QGroupBox("Simulation", simulationDockWidgetContent); + QVBoxLayout* simulationVerticalLayout = new QVBoxLayout(); + QHBoxLayout* simulationHorizontalLayout = new QHBoxLayout(); + + this->addDockWidget(Qt::LeftDockWidgetArea, simulationDockWidget); + this->simulationDockWidget->setWindowTitle("Control"); + simulationDockWidget->setWidget(simulationDockWidgetContent); + simulationDockWidgetContent->setLayout(simulationVerticalLayout); + simulationVerticalLayout->addWidget(simulationGroup); + simulationGroup->setLayout(simulationHorizontalLayout); + simulationStart = new QPushButton("&Start", simulationGroup); + simulationPause = new QPushButton("&Pause", simulationGroup); + simulationReset = new QPushButton("&Reset", simulationGroup); + QObject::connect(simulationStart, SIGNAL(clicked()), this, SLOT(clickSimulationStart())); + QObject::connect(simulationPause, SIGNAL(clicked()), this, SLOT(clickSimulationPause())); + QObject::connect(simulationReset, SIGNAL(clicked()), this, SLOT(clickSimulationReset())); + simulationHorizontalLayout->addWidget(simulationStart); + simulationHorizontalLayout->addWidget(simulationPause); + simulationHorizontalLayout->addWidget(simulationReset); + + QGridLayout* simulationSettingsLayout = new QGridLayout(); + QGroupBox* simulationSettings = new QGroupBox("Settings", simulationDockWidgetContent); + simulationVerticalLayout->addWidget(simulationSettings); + simulationSettings->setLayout(simulationSettingsLayout); + simulationGravity = new QDoubleSpinBox(simulationSettings); + simulationSettingsLayout->addWidget(new QLabel("Gravity [m/s^2]", simulationSettings), 0, 0); + simulationSettingsLayout->addWidget(simulationGravity, 0, 1); + simulationGravity->setRange(0, 100); + simulationGravity->setSingleStep(0.1f); + simulationGravity->setDecimals(2); + simulationGravity->setValue(simulationGravityValue); + QObject::connect(simulationGravity, SIGNAL(valueChanged(double)), this, SLOT(changeSimulationGravity(double))); + simulationDampingFactor = new QDoubleSpinBox(simulationSettings); + simulationSettingsLayout->addWidget(new QLabel("Damping Factor", simulationSettings), 1, 0); + simulationSettingsLayout->addWidget(simulationDampingFactor, 1, 1); + simulationDampingFactor->setRange(0, 1.5); + simulationDampingFactor->setSingleStep(0.0001f); + simulationDampingFactor->setDecimals(5); + simulationDampingFactor->setValue(simulationDampingValue); + simulationDampingFactor->setToolTip(QString("0.0 gives a frictionless system, 1.0 damps almost all motion; try 0.001--0.005 for typical viscous friction")); + QObject::connect(simulationDampingFactor, SIGNAL(valueChanged(double)), this, SLOT(changeSimulationDampingFactor(double))); + + QGroupBox* simulationResults = new QGroupBox("Results", simulationDockWidgetContent); + QGridLayout* simulationResultsLayout = new QGridLayout(); + simulationVerticalLayout->addWidget(simulationResults); + simulationResults->setLayout(simulationResultsLayout); + this->simulationTime = new QLineEdit(simulationResults); + this->simulationResultsEnergy = new QLineEdit(simulationResults); + this->simulationResultsTime = new QLineEdit(simulationResults); + simulationResultsLayout->addWidget(new QLabel("Simulated Time [s]", simulationResults), 0, 0); + simulationResultsLayout->addWidget(simulationTime, 0, 1); + simulationTime->setReadOnly(true); + simulationResultsLayout->addWidget(new QLabel("Frame Computation Time [s]", simulationResults), 1, 0); + simulationResultsLayout->addWidget(simulationResultsTime, 1, 1); + simulationResultsTime->setToolTip(QString("should be under 0.05 s for good interactive results")); + simulationResultsTime->setReadOnly(true); + simulationResultsLayout->addWidget(new QLabel("Kinetic Energy [kJ]", simulationResults), 2, 0); + simulationResultsLayout->addWidget(simulationResultsEnergy, 2, 1); + simulationResultsEnergy->setReadOnly(true); + + QGroupBox* serverBox = new QGroupBox("rlCoach Server", simulationDockWidgetContent); + QGridLayout* serverBoxLayout = new QGridLayout(); + serverBox->setLayout(serverBoxLayout); + simulationVerticalLayout->addWidget(serverBox); + this->serverConnectionStatus = new QLineEdit(serverBox); + serverBoxLayout->addWidget(new QLabel("Connection Status", serverBox), 0, 0); + serverBoxLayout->addWidget(serverConnectionStatus, 0, 1); + serverConnectionStatus->setReadOnly(true); + //simulationVerticalLayout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Expanding)); + + this->addDockWidget(Qt::RightDockWidgetArea, positionDockWidget); + this->positionDockWidget->setWidget(this->positionView); + this->positionDockWidget->setWindowTitle("Position"); + + this->addDockWidget(Qt::RightDockWidgetArea, velocityDockWidget); + this->velocityDockWidget->setWidget(this->velocityView); + this->velocityDockWidget->setWindowTitle("Velocity"); + + this->addDockWidget(Qt::RightDockWidgetArea, accelerationDockWidget); + this->accelerationDockWidget->setWidget(this->accelerationView); + this->accelerationDockWidget->setWindowTitle("Acceleration"); + + this->addDockWidget(Qt::LeftDockWidgetArea, torqueDockWidget); + this->torqueDockWidget->setWidget(this->torqueView); + this->torqueDockWidget->setWindowTitle("Motor Torque"); + + this->addDockWidget(Qt::BottomDockWidgetArea, operationalDockWidget); + this->operationalDockWidget->setWidget(this->operationalViews); + this->operationalDockWidget->setWindowTitle("Operational Position"); + + this->gradientBackground = new SoGradientBackground(); + this->gradientBackground->ref(); + this->gradientBackground->color0.setValue(0.8f, 0.8f, 0.8f); + this->gradientBackground->color1.setValue(1.0f, 1.0f, 1.0f); + this->scene->root->insertChild(this->gradientBackground, 0); + + QWidget* viewerContainer = new QWidget(this); + this->viewer = new SoQtExaminerViewer(viewerContainer, nullptr, true, SoQtFullViewer::BUILD_POPUP); + this->viewer->setSceneGraph(this->scene->root); + this->viewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); + this->viewer->viewAll(); + + this->setCentralWidget(viewerContainer); + //this->viewer->getWidget()->resize(400, 300); + this->resize(1000, 750); + this->setWindowIconText("rlSimulator"); + this->setWindowTitle("rlSimulator"); + + this->init(); + + this->server->listen(QHostAddress::Any, 11235); + this->setServerConnectionStatus("Listening on port 11235"); + + this->timer.start(simulationTimeStep * simulationStepsPerFrame * 1000.f, this); +} + +MainWindow::~MainWindow() +{ + this->gradientBackground->unref(); + MainWindow::singleton = nullptr; +} + +void +MainWindow::changeSimulationGravity(double value) +{ + this->simulationGravityValue = value; +} + +void +MainWindow::changeSimulationDampingFactor(double value) +{ + this->simulationDampingValue = value; +} + +void +MainWindow::clickSimulationStart() +{ + this->simulationIsRunning = true; +} + +void +MainWindow::clickSimulationPause() +{ + this->simulationIsRunning = false; +} + +void +MainWindow::clickSimulationReset() +{ + this->simulationIsRunning = false; + this->simulationTimeElapsed = 0; + this->simulationTime->setText(QString::number(this->simulationTimeElapsed)); + this->simulationResultsTime->setText(""); + this->simulationResultsEnergy->setText(""); + kinematicModels->setPosition(simulationResetQ); + kinematicModels->setVelocity(simulationResetQd); + kinematicModels->setAcceleration(simulationResetQdd); + positionModel->setData(simulationResetQ); +} + +MainWindow* +MainWindow::instance() +{ + if (nullptr == MainWindow::singleton) + { + new MainWindow(); + } + + return MainWindow::singleton; +} + +void +MainWindow::init() +{ + this->positionDockWidget->toggleViewAction()->setShortcut(QKeySequence("F5")); + this->addAction(this->positionDockWidget->toggleViewAction()); + + this->saveImageAction->setShortcut(QKeySequence("Return")); + QObject::connect(this->saveImageAction, SIGNAL(triggered()), this, SLOT(saveImage())); + this->addAction(this->saveImageAction); + + this->saveSceneAction->setShortcut(QKeySequence("Ctrl+Return")); + QObject::connect(this->saveSceneAction, SIGNAL(triggered()), this, SLOT(saveScene())); + this->addAction(this->saveSceneAction); +} + +void +MainWindow::timerEvent(QTimerEvent *event) +{ + if (!simulationIsRunning) + { + return; + } + + rl::mdl::Dynamic* dynamic = dynamic_cast(this->kinematicModels.get()); + + rl::math::Vector3 g(0, 0, this->simulationGravityValue); + dynamic->setWorldGravity(g); + + std::chrono::steady_clock::time_point startTime = std::chrono::steady_clock::now(); + rl::math::Vector q(dynamic->getDof()); + rl::math::Vector qd(dynamic->getDof()); + rl::math::Vector qdd(dynamic->getDof()); + rl::math::Vector torque(dynamic->getDof()); + rl::math::Matrix M(dynamic->getDof(), dynamic->getDof()); + +#if 1 + for (int i = 0; i < simulationStepsPerFrame; ++i) + { + dynamic->setTorque(externalTorque); + dynamic->forwardDynamics(); +#if 1 + q = dynamic->getPosition(); + qd = dynamic->getVelocity(); + qdd = dynamic->getAcceleration(); + qdd -= simulationDampingValue * qd / simulationTimeStep; + // TODO: this is a very simple integration, slightly better than Euler, could be replaced by a *functional-style* Runge-Kutta + q += simulationTimeStep * (qd + qdd * simulationTimeStep / 2); + qd += simulationTimeStep * qdd; + dynamic->setPosition(q); + dynamic->setVelocity(qd); + dynamic->setAcceleration(qdd); +#else + dynamic->rungeKuttaNystrom(simulationTimeStep); // its side effects do not work with damping +#endif + } + + q = dynamic->getPosition(); + qd = dynamic->getVelocity(); + qdd = dynamic->getAcceleration(); + torque = dynamic->getTorque(); + dynamic->calculateMassMatrix(M); + dynamic->setPosition(q); + dynamic->setVelocity(qd); + dynamic->setAcceleration(qdd); + dynamic->setTorque(torque); +#else + for (int i = 0; i < simulationStepsPerFrame; ++i) + { + dynamic->getPosition(q); + dynamic->getVelocity(qd); + dynamic->getAcceleration(qdd); + dynamic->getTorque(torque); + + // V + rl::math::Vector V(dynamic->getDof()); + dynamic->setPosition(q); + dynamic->setVelocity(qd); + dynamic->calculateCentrifugalCoriolis(V); + + // G + rl::math::Vector G(dynamic->getDof()); + dynamic->setPosition(q); + dynamic->calculateGravity(G); + + // M^{-1} + rl::math::Matrix invM(dynamic->getDof(), dynamic->getDof()); + dynamic->calculateMassMatrixInverse(invM); + + // M^{-1} * ( tau - V - G ) + //qdd = invM * (torque - V - G); + qdd = invM * (- V - G); + + qdd -= simulationDampingValue * qd / simulationTimeStep; + + // simple Euler-Cauchy integration + dynamic->setAcceleration(qdd); + q += simulationTimeStep * qd; + qd += simulationTimeStep * qdd; + dynamic->setPosition(q); + dynamic->setVelocity(qd); + } +#endif + + dynamic->forwardPosition(); + std::chrono::steady_clock::time_point stopTime = std::chrono::steady_clock::now(); + this->simulationTimeElapsed += simulationStepsPerFrame * simulationTimeStep; + this->simulationTime->setText(QString::number(this->simulationTimeElapsed)); + this->simulationResultsTime->setText(QString::number(std::chrono::duration_cast>(stopTime - startTime).count())); + rl::math::Real energy = 0.5 * qd.transpose() * M * qd; + this->simulationResultsEnergy->setText(QString::number(energy)); + this->positionModel->setData(q); + this->velocityModel->setData(qd); + this->accelerationModel->setData(qdd); +} + +void +MainWindow::saveImage() +{ + QImage image = static_cast(this->viewer->getGLWidget())->grabFrameBuffer(true); + image.save("coach-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".png", "PNG"); +} + +void +MainWindow::saveScene() +{ + SoOutput output; + + if (!output.openFile(QString("coach-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".wrl").toStdString().c_str())) + { + return; + } + + output.setHeaderString("#VRML V2.0 utf8"); + + SoWriteAction writeAction(&output); + writeAction.apply(this->scene->root); + + output.closeFile(); +} + +void +MainWindow::setServerConnectionStatus(QString str) +{ + this->serverConnectionStatus->setText(str); +} diff --git a/demos/rlSimulator/MainWindow.h b/demos/rlSimulator/MainWindow.h new file mode 100644 index 00000000..72b3065f --- /dev/null +++ b/demos/rlSimulator/MainWindow.h @@ -0,0 +1,196 @@ +// +// Copyright (c) 2009, Andre Gaschler +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ConfigurationDelegate; +class ConfigurationModel; +class PositionDelegate; +class PositionModel; +class VelocityDelegate; +class VelocityModel; +class AccelerationDelegate; +class AccelerationModel; +class TorqueModel; +class TorqueDelegate; +class OperationalDelegate; +class OperationalModel; +class Server; +class SoGradientBackground; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + virtual ~MainWindow(); + + static MainWindow* instance(); + + AccelerationModel* accelerationModel; + + rl::math::Vector externalTorque; + + rl::sg::Model* geometryModels; + + std::shared_ptr kinematicModels; + + OperationalModel* operationalModel; + + PositionModel* positionModel; + + std::shared_ptr scene; + + TorqueModel* torqueModel; + + VelocityModel* velocityModel; + +public slots: + void changeSimulationGravity(double value); + + void changeSimulationDampingFactor(double value); + + void clickSimulationPause(); + + void clickSimulationReset(); + + void clickSimulationStart(); + + void saveImage(); + + void saveScene(); + + void setServerConnectionStatus(QString str); + +protected: + MainWindow(QWidget* parent = nullptr, Qt::WindowFlags f = 0); + + void timerEvent(QTimerEvent *event); + +private: + void init(); + + AccelerationDelegate* accelerationDelegate; + + QDockWidget* accelerationDockWidget; + + QTableView* accelerationView; + + SoGradientBackground* gradientBackground; + + OperationalDelegate* operationalDelegate; + + QDockWidget* operationalDockWidget; + + QTableView* operationalViews; + + PositionDelegate* positionDelegate; + + QDockWidget* positionDockWidget; + + QTableView* positionView; + + QAction* saveImageAction; + + QAction* saveSceneAction; + + Server* server; + + QLineEdit* serverConnectionStatus; + + QDoubleSpinBox* simulationDampingFactor; + + rl::math::Real simulationDampingValue; + + QDockWidget* simulationDockWidget; + + QDoubleSpinBox* simulationGravity; + + rl::math::Real simulationGravityValue; + + bool simulationIsRunning; + + QPushButton* simulationPause; + + QPushButton* simulationReset; + + QLineEdit* simulationResultsEnergy; + + QLineEdit* simulationResultsTime; + + rl::math::Vector simulationResetQ; + + rl::math::Vector simulationResetQd; + + rl::math::Vector simulationResetQdd; + + QPushButton* simulationStart; + + int simulationStepsPerFrame; + + QLineEdit* simulationTime; + + rl::math::Real simulationTimeElapsed; + + rl::math::Real simulationTimeStep; + + static MainWindow* singleton; + + QBasicTimer timer; + + TorqueDelegate* torqueDelegate; + + QDockWidget* torqueDockWidget; + + QTableView* torqueView; + + VelocityDelegate* velocityDelegate; + + QDockWidget* velocityDockWidget; + + QTableView* velocityView; + + SoQtExaminerViewer* viewer; +}; + +#endif // MAINWINDOW_H diff --git a/demos/rlSimulator/OperationalDelegate.cpp b/demos/rlSimulator/OperationalDelegate.cpp new file mode 100644 index 00000000..4fefd6c7 --- /dev/null +++ b/demos/rlSimulator/OperationalDelegate.cpp @@ -0,0 +1,100 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include + +#include "OperationalDelegate.h" +#include "MainWindow.h" + +OperationalDelegate::OperationalDelegate(QObject* parent) : + QItemDelegate(parent) +{ +} + +OperationalDelegate::~OperationalDelegate() +{ +} + +QWidget* +OperationalDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + QDoubleSpinBox* editor = new QDoubleSpinBox(parent); + + editor->setMaximum(std::numeric_limits::max()); + editor->setMinimum(-std::numeric_limits::max()); + + switch (index.column()) + { + case 0: + case 1: + case 2: + editor->setSingleStep(0.01f); + break; + case 3: + case 4: + case 5: + editor->setSingleStep(1.0f); + break; + default: + break; + } + + QObject::connect(editor, SIGNAL(valueChanged(double)), this, SLOT(valueChanged(double))); + + return editor; +} + +void +OperationalDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); +} + +void +OperationalDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const +{ + QDoubleSpinBox* doubleSpinBox = static_cast(editor); + doubleSpinBox->interpretText(); + + if (!model->setData(index, doubleSpinBox->value(), Qt::EditRole)) + { + doubleSpinBox->setValue(index.model()->data(index, Qt::DisplayRole).toDouble()); + } +} + +void +OperationalDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const +{ + editor->setGeometry(option.rect); +} + +void +OperationalDelegate::valueChanged(double d) +{ + emit commitData(static_cast(QObject::sender())); +} diff --git a/demos/rlSimulator/OperationalDelegate.h b/demos/rlSimulator/OperationalDelegate.h new file mode 100644 index 00000000..2e1f4108 --- /dev/null +++ b/demos/rlSimulator/OperationalDelegate.h @@ -0,0 +1,58 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef OPERATIONALDELEGATE_H +#define OPERATIONALDELEGATE_H + +#include + +class OperationalDelegate : public QItemDelegate +{ + Q_OBJECT + +public: + OperationalDelegate(QObject* parent = nullptr); + + virtual ~OperationalDelegate(); + + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; + + void setEditorData(QWidget* editor, const QModelIndex& index) const; + + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + + void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const; + +public slots: + void valueChanged(double d); + +protected: + +private: + +}; + +#endif // OPERATIONALDELEGATE_H diff --git a/demos/rlSimulator/OperationalModel.cpp b/demos/rlSimulator/OperationalModel.cpp new file mode 100644 index 00000000..47694176 --- /dev/null +++ b/demos/rlSimulator/OperationalModel.cpp @@ -0,0 +1,254 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#include +#include +#include +#include + +#include "ConfigurationModel.h" +#include "OperationalModel.h" +#include "MainWindow.h" + +OperationalModel::OperationalModel(QObject* parent) : + QAbstractTableModel(parent) +{ +} + +OperationalModel::~OperationalModel() +{ +} + +int +OperationalModel::columnCount(const QModelIndex& parent) const +{ + return 6; +} + +void +OperationalModel::configurationChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) +{ + this->beginResetModel(); + this->endResetModel(); +} + +QVariant +OperationalModel::data(const QModelIndex& index, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (!index.isValid()) + { + return QVariant(); + } + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + { + const rl::math::Transform::ConstTranslationPart& position = MainWindow::instance()->kinematicModels->getOperationalPosition(index.row()).translation(); + rl::math::Vector3 orientation = MainWindow::instance()->kinematicModels->getOperationalPosition(index.row()).rotation().eulerAngles(2, 1, 0).reverse(); + + switch (index.column()) + { + case 0: + return position.x(); + break; + case 1: + return position.y(); + break; + case 2: + return position.z(); + break; + case 3: + return orientation.x() * rl::math::RAD2DEG; + break; + case 4: + return orientation.y() * rl::math::RAD2DEG; + break; + case 5: + return orientation.z() * rl::math::RAD2DEG; + break; + default: + break; + } + } + break; + case Qt::TextAlignmentRole: + return Qt::AlignRight; + break; + default: + break; + } + + return QVariant(); +} + +Qt::ItemFlags +OperationalModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + { + return Qt::NoItemFlags; + } + + return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; +} + +QVariant +OperationalModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return QVariant(); + } + + if (Qt::DisplayRole == role && Qt::Horizontal == orientation) + { + switch (section) + { + case 0: + return "x"; + break; + case 1: + return "y"; + break; + case 2: + return "z"; + break; + case 3: + return "a"; + break; + case 4: + return "b"; + break; + case 5: + return "c"; + break; + default: + break; + } + } + + if (Qt::DisplayRole == role && Qt::Vertical == orientation) + { + return QString("tool%1").arg(section); + } + + return QVariant(); +} + +int +OperationalModel::rowCount(const QModelIndex& parent) const +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return 0; + } + + return MainWindow::instance()->kinematicModels->getOperationalDof(); +} + +bool +OperationalModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + if (nullptr == MainWindow::instance()->kinematicModels) + { + return false; + } + + if (index.isValid() && Qt::EditRole == role) + { + if (rl::mdl::Kinematic* kinematic = dynamic_cast(MainWindow::instance()->kinematicModels.get())) + { + rl::math::Transform x = kinematic->getOperationalPosition(index.row()); + + rl::math::Vector3 orientation = x.linear().eulerAngles(2, 1, 0).reverse(); + + switch (index.column()) + { + case 0: + x.translation().x() = value.value(); + break; + case 1: + x.translation().y() = value.value(); + break; + case 2: + x.translation().z() = value.value(); + break; + case 3: + x.linear() = ( + rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + case 4: + x.linear() = ( + rl::math::AngleAxis(orientation.z(), rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + case 5: + x.linear() = ( + rl::math::AngleAxis(value.value() * rl::math::DEG2RAD, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(orientation.y(), rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(orientation.x(), rl::math::Vector3::UnitX()) + ).toRotationMatrix(); + break; + default: + break; + } + + rl::math::Vector q = kinematic->getPosition(); + + if (kinematic->calculateInversePosition(x, index.row(), 1.0f)) + { + kinematic->forwardPosition(); + + for (std::size_t i = 0; i < MainWindow::instance()->geometryModels->getNumBodies(); ++i) + { + MainWindow::instance()->geometryModels->getBody(i)->setFrame(kinematic->getFrame(i)); + } + + emit dataChanged(this->createIndex(0, 0), this->createIndex(this->rowCount(), this->columnCount())); + + return true; + } + else + { + kinematic->setPosition(q); + kinematic->forwardPosition(); + } + } + } + + return false; +} diff --git a/demos/rlSimulator/OperationalModel.h b/demos/rlSimulator/OperationalModel.h new file mode 100644 index 00000000..c1683fa4 --- /dev/null +++ b/demos/rlSimulator/OperationalModel.h @@ -0,0 +1,61 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +#ifndef OPERATIONALMODEL_H +#define OPERATIONALMODEL_H + +#include + +class OperationalModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + OperationalModel(QObject* parent = nullptr); + + virtual ~OperationalModel(); + + int columnCount(const QModelIndex& parent = QModelIndex()) const; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + +public slots: + void configurationChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); + +protected: + +private: + +}; + +#endif // OPERATIONALMODEL_H diff --git a/demos/rlSimulator/Server.cpp b/demos/rlSimulator/Server.cpp new file mode 100644 index 00000000..6b28dc9f --- /dev/null +++ b/demos/rlSimulator/Server.cpp @@ -0,0 +1,48 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include "Server.h" +#include "Socket.h" + +Server::Server(QObject* parent) : + QTcpServer(parent) +{ +} + +Server::~Server() +{ +} + +void +#if QT_VERSION >= 0x050000 +Server::incomingConnection(qintptr socketDescriptor) +#else // QT_VERSION +Server::incomingConnection(int socketDescriptor) +#endif // QT_VERSION +{ + Socket* socket = new Socket(this); + socket->setSocketDescriptor(socketDescriptor); +} diff --git a/demos/rlSimulator/Server.h b/demos/rlSimulator/Server.h new file mode 100644 index 00000000..d2bc1ffd --- /dev/null +++ b/demos/rlSimulator/Server.h @@ -0,0 +1,52 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SERVER_H +#define SERVER_H + +#include + +class Server : public QTcpServer +{ + Q_OBJECT + +public: + Server(QObject* parent = nullptr); + + virtual ~Server(); + +protected: +#if QT_VERSION >= 0x050000 + void incomingConnection(qintptr socketDescriptor); +#else // QT_VERSION + void incomingConnection(int socketDescriptor); +#endif // QT_VERSION + +private: + +}; + +#endif //_SERVER_H diff --git a/demos/rlSimulator/SoGradientBackground.cpp b/demos/rlSimulator/SoGradientBackground.cpp new file mode 100644 index 00000000..bd1d852f --- /dev/null +++ b/demos/rlSimulator/SoGradientBackground.cpp @@ -0,0 +1,109 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifdef WIN32 +#include +#endif // WIN32 + +#ifdef __APPLE__ +#include +#else // __APPLE__ +#include +#endif // __APPLE__ + +#include + +#include "SoGradientBackground.h" + +SO_NODE_SOURCE(SoGradientBackground); + +SoGradientBackground::SoGradientBackground() : + SoNode(), + color0(), + color1() +{ + SO_NODE_CONSTRUCTOR(SoGradientBackground); + + SO_NODE_ADD_FIELD(color0, (1.0f, 1.0f, 1.0f)); + SO_NODE_ADD_FIELD(color1, (0.0f, 0.0f, 0.0f)); +} + +SoGradientBackground::~SoGradientBackground() +{ +} + +SbBool +SoGradientBackground::affectsState() const +{ + return false; +} + +void +SoGradientBackground::exitClass() +{ +} + +void +SoGradientBackground::GLRender(SoGLRenderAction* action) +{ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glBegin(GL_QUADS); + + glColor3f(this->color0.getValue()[0], this->color0.getValue()[1], this->color0.getValue()[2]); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glColor3f(this->color1.getValue()[0], this->color1.getValue()[1], this->color1.getValue()[2]); + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + + glEnd(); + + glPopAttrib(); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void +SoGradientBackground::initClass() +{ + SO_NODE_INIT_CLASS(SoGradientBackground, SoNode, "Node"); +} diff --git a/demos/rlSimulator/SoGradientBackground.h b/demos/rlSimulator/SoGradientBackground.h new file mode 100644 index 00000000..5fc080f5 --- /dev/null +++ b/demos/rlSimulator/SoGradientBackground.h @@ -0,0 +1,59 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOGRADIENTBACKGROUND_H +#define SOGRADIENTBACKGROUND_H + +#include +#include + +class SoGradientBackground : public SoNode +{ + SO_NODE_HEADER(SoGradientBackground); + +public: + SoGradientBackground(); + + virtual SbBool affectsState() const; + + static void exitClass(); + + virtual void GLRender(SoGLRenderAction* action); + + static void initClass(); + + SoSFColor color0; + + SoSFColor color1; + +protected: + virtual ~SoGradientBackground(); + +private: + +}; + +#endif // SOGRADIENTBACKGROUND_H diff --git a/demos/rlSimulator/Socket.cpp b/demos/rlSimulator/Socket.cpp new file mode 100644 index 00000000..3ac3e772 --- /dev/null +++ b/demos/rlSimulator/Socket.cpp @@ -0,0 +1,198 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include + +#include "ConfigurationModel.h" +#include "MainWindow.h" +#include "Socket.h" + +Socket::Socket(QObject* parent) : + QTcpSocket(parent) +{ + QObject::connect(this, SIGNAL(disconnected()), this, SLOT(deleteLater())); + QObject::connect(this, SIGNAL(readyRead()), this, SLOT(readClient())); + MainWindow::instance()->setServerConnectionStatus("Connected"); +} + +Socket::~Socket() +{ + MainWindow::instance()->setServerConnectionStatus("Disconnected"); +} + +void +Socket::readClient() +{ + QTextStream textStream(this); + + while (this->canReadLine()) + { + MainWindow::instance()->setServerConnectionStatus("Received command"); + std::size_t cmd = 0; + textStream >> cmd; + + switch (cmd) + { + case 0: + { + std::size_t i = 0; + textStream >> i; + + std::size_t j = 0; + textStream >> j; + + rl::math::Real x = 0; + textStream >> x; + + rl::math::Real y = 0; + textStream >> y; + + rl::math::Real z = 0; + textStream >> z; + + rl::math::Real a = 0; + textStream >> a; + + rl::math::Real b = 0; + textStream >> b; + + rl::math::Real c = 0; + textStream >> c; + + rl::math::Transform t; + t = rl::math::AngleAxis(a, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(b, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(c, rl::math::Vector3::UnitX()); + t.translation().x() = x; + t.translation().y() = y; + t.translation().z() = z; + + if (MainWindow::instance()->scene->getNumModels() > i) + { + if (MainWindow::instance()->scene->getModel(i)->getNumBodies() > j) + { + MainWindow::instance()->scene->getModel(i)->getBody(j)->setFrame(t); + } + } + } + break; + case 1: + { + std::size_t i = 0; + textStream >> i; + + std::size_t j = 0; + textStream >> j; + + std::size_t k = 0; + textStream >> k; + + rl::math::Real x = 0; + textStream >> x; + + rl::math::Real y = 0; + textStream >> y; + + rl::math::Real z = 0; + textStream >> z; + + rl::math::Real a = 0; + textStream >> a; + + rl::math::Real b = 0; + textStream >> b; + + rl::math::Real c = 0; + textStream >> c; + + rl::math::Transform t; + t = rl::math::AngleAxis(a, rl::math::Vector3::UnitZ()) * + rl::math::AngleAxis(b, rl::math::Vector3::UnitY()) * + rl::math::AngleAxis(c, rl::math::Vector3::UnitX()); + t.translation().x() = x; + t.translation().y() = y; + t.translation().z() = z; + + if (MainWindow::instance()->scene->getNumModels() > i) + { + if (MainWindow::instance()->scene->getModel(i)->getNumBodies() > j) + { + if (MainWindow::instance()->scene->getModel(i)->getBody(j)->getNumShapes() > k) + { + MainWindow::instance()->scene->getModel(i)->getBody(j)->getShape(k)->setTransform(t); + } + } + } + } + break; + case 2: + { + std::size_t i = 0; + textStream >> i; + + if (i < 1) + { + rl::math::Vector q(MainWindow::instance()->kinematicModels->getDof()); + q.setZero(); + + for (std::ptrdiff_t j = 0; j < q.size(); ++j) + { + textStream >> q(j); + } + + MainWindow::instance()->positionModel->setData(q); + } + } + break; + case 5: + { + std::size_t i = 0; + textStream >> i; + + if (i < 1) + { + rl::math::Vector torque(MainWindow::instance()->kinematicModels->getDof()); + torque.setZero(); + + for (std::ptrdiff_t j = 0; j < torque.size(); ++j) + { + textStream >> torque(j); + } + + MainWindow::instance()->torqueModel->setData(torque); + } + } + break; + default: + break; + } + + textStream << endl; + } +} diff --git a/demos/rlSimulator/Socket.h b/demos/rlSimulator/Socket.h new file mode 100644 index 00000000..b37369c7 --- /dev/null +++ b/demos/rlSimulator/Socket.h @@ -0,0 +1,49 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef SOCKET_H +#define SOCKET_H + +#include + +class Socket : public QTcpSocket +{ + Q_OBJECT + +public: + Socket(QObject* parent = nullptr); + + virtual ~Socket(); + +protected: + +private: + +private slots: + void readClient(); +}; + +#endif // SOCKET_H diff --git a/demos/rlSimulator/rlSimulator.cpp b/demos/rlSimulator/rlSimulator.cpp new file mode 100644 index 00000000..912f0467 --- /dev/null +++ b/demos/rlSimulator/rlSimulator.cpp @@ -0,0 +1,60 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include + +#include "MainWindow.h" + +MainWindow* MainWindow::singleton = nullptr; + +int +main(int argc, char** argv) +{ + if (argc < 3) + { + std::cout << "Usage: rlSimulator SCENEFILE MODELFILE" << std::endl; + return EXIT_FAILURE; + } + + try + { + QApplication application(argc, argv); + + QObject::connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit())); + + MainWindow::instance()->show(); + + return application.exec(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; + } +} + diff --git a/demos/rlSimulator/rlSimulator.desktop.in b/demos/rlSimulator/rlSimulator.desktop.in new file mode 100644 index 00000000..87f27358 --- /dev/null +++ b/demos/rlSimulator/rlSimulator.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Categories=Science;Robotics; +Comment=Simulation demo with Unimation Puma 560 +Exec=sh -c "rlSimulator $(dirname %k)/../rl-@VERSION@/examples/rlsg/unimation-puma560_boxes.xml $(dirname %k)/../rl-@VERSION@/examples/rlmdl/unimation-puma560.xml" +Icon=robotics-library +Name=Robotics Library (rlSimulator) +Type=Application +X-Unity-IconBackgroundColor=#ffffff diff --git a/demos/rlSixAxisForceTorqueSensorDemo/CMakeLists.txt b/demos/rlSixAxisForceTorqueSensorDemo/CMakeLists.txt index c7123607..143ed562 100644 --- a/demos/rlSixAxisForceTorqueSensorDemo/CMakeLists.txt +++ b/demos/rlSixAxisForceTorqueSensorDemo/CMakeLists.txt @@ -1,14 +1,29 @@ -project(rlSixAxisForceTorqueSensorDemo) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + find_package(Boost REQUIRED COMPONENTS thread) +endif() -if(COMEDI_FOUND) - add_executable( - rlSixAxisForceTorqueSensorDemo - rlSixAxisForceTorqueSensorDemo.cpp - ) - - target_link_libraries( +add_executable( + rlSixAxisForceTorqueSensorDemo + rlSixAxisForceTorqueSensorDemo.cpp +) + +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( rlSixAxisForceTorqueSensorDemo - rlhal - rlutil + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED ) -endif(COMEDI_FOUND) +endif() + +target_link_libraries( + rlSixAxisForceTorqueSensorDemo + hal + util +) + +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_link_libraries(rlSixAxisForceTorqueSensorDemo ${Boost_LIBRARIES}) +endif() diff --git a/demos/rlSixAxisForceTorqueSensorDemo/rlSixAxisForceTorqueSensorDemo.cpp b/demos/rlSixAxisForceTorqueSensorDemo/rlSixAxisForceTorqueSensorDemo.cpp index 36cbb06a..48920d61 100644 --- a/demos/rlSixAxisForceTorqueSensorDemo/rlSixAxisForceTorqueSensorDemo.cpp +++ b/demos/rlSixAxisForceTorqueSensorDemo/rlSixAxisForceTorqueSensorDemo.cpp @@ -24,14 +24,19 @@ // POSSIBILITY OF SUCH DAMAGE. // +#define __STDC_WANT_LIB_EXT1__ 1 + +#include +#include #include #include #include -#include -#include +#include +#include //#define ATI -#define JR3 +//#define JR3 +#define WEISSKMS40 #ifdef ATI #include @@ -39,68 +44,130 @@ #ifdef JR3 #include #endif +#ifdef WEISSKMS40 +#include +#endif bool running = true; -void handler(int signum) +void +handler(int signum) { running = false; } +std::string +toIsoString(const std::chrono::system_clock::time_point& timePoint) +{ + std::time_t time = std::chrono::system_clock::to_time_t(timePoint); + std::array str; + std::tm result; +#ifdef __STDC_LIB_EXT1__ + std::strftime(str.data(), str.size(), "%Y-%m-%d %H:%M:%S", gmtime_s(&time, &result)); +#elif _MSC_VER + if (NULL == gmtime_s(&result, &time)) + { + std::strftime(str.data(), str.size(), "%Y-%m-%d %H:%M:%S", &result); + } +#else + std::strftime(str.data(), str.size(), "%Y-%m-%d %H:%M:%S", gmtime_r(&time, &result)); +#endif + return str.data(); +} + int main(int argc, char** argv) { - std::ofstream ft; - ft.open("ft.txt", std::fstream::trunc); + if (argc < 2) + { + std::cout << "Usage: rlSixAxisForceTorqueSensorDemo FILE" << std::endl; + return EXIT_FAILURE; + } + + signal(SIGINT, handler); + + std::ofstream file; + file.open(argv[1], std::fstream::trunc); try { #ifdef ATI - rl::hal::Ati sensor("/usr/local/share/atidaq/left.cal", 0, "/dev/comedi0"); + rl::hal::Ati sensor("/usr/local/share/atidaq/left.cal", std::chrono::milliseconds(1), 0, "/dev/comedi0"); #endif #ifdef JR3 - rl::hal::Jr3 sensor("/dev/comedi0"); + rl::hal::Jr3 sensor("/dev/comedi0", std::chrono::milliseconds(1)); +#endif +#ifdef WEISSKMS40 + rl::hal::WeissKms40 sensor("192.168.29.21"); #endif sensor.open(); - sensor.start(); - sensor.step(); - sensor.bias(); +#ifdef WEISSKMS40 + std::cout << "Verbose level: " << sensor.doGetVerboseLevel() << std::endl; + std::cout << "System type: " << sensor.doGetSystemType() << std::endl; + std::cout << "Firmware version: " << sensor.doGetFirmwareVersion() << std::endl; + std::cout << "Serial number: " << sensor.doGetSerialNumber() << std::endl; + std::cout << "Descriptor string: " << sensor.doGetDescriptorString() << std::endl; + std::cout << "System flags: " << sensor.doGetSystemFlags() << std::endl; + std::cout << "Temperature: " << sensor.doGetTemperature() << std::endl; + std::cout << "Single frame: " << sensor.doAcquireSingleFrame().transpose() << std::endl; + std::cout << "Data acquisition mask: " << sensor.doGetDataAcquisitionMask() << std::endl; + std::cout << "Frame send divider: " << sensor.doGetFrameSendDivider() << std::endl; + std::cout << "Tare: " << sensor.doGetTare() << std::endl; + std::cout << "Filter: " << sensor.doGetFilter() << std::endl; + ::std::pair< ::std::chrono::system_clock::time_point, ::std::chrono::system_clock::duration> calibrationDateLifetime = sensor.doGetCalibrationDateLifetime(); + std::cout << "Calibration date: " << calibrationDateLifetime.first.time_since_epoch().count() << " " << toIsoString(calibrationDateLifetime.first) << std::endl; + std::cout << "Calibration lifetime: " << calibrationDateLifetime.second.count() << " " << toIsoString(calibrationDateLifetime.first + calibrationDateLifetime.second) << std::endl; +#endif + + std::chrono::steady_clock::time_point time = std::chrono::steady_clock::now(); - rl::math::Vector data(6); - ::std::size_t t = 0; + do + { + time += std::chrono::duration_cast(sensor.getUpdateRate()); + std::this_thread::sleep_until(time); + sensor.start(); + } + while (!sensor.isRunning()); - while (running) + for (std::size_t i = 0; running; ++i) { + time += std::chrono::duration_cast(sensor.getUpdateRate()); + std::this_thread::sleep_until(time); + sensor.step(); - sensor.getForcesTorques(data); + rl::math::Vector data = sensor.getForcesTorques(); - std::cout << data << std::endl; - ft << t++; + file << i; - for (::std::size_t i = 0; i < 6; ++i) + for (std::size_t j = 0; j < 6; ++j) { - ft << " " << data(i); + file << " " << data(j); } - ft << std::endl; - ft.flush(); - - rl::util::Timer::sleep(0.001f); + file << std::endl; + } + + do + { + time += std::chrono::duration_cast(sensor.getUpdateRate()); + std::this_thread::sleep_until(time); + sensor.stop(); } + while (sensor.isRunning()); - sensor.stop(); sensor.close(); - ft.close(); + file.flush(); + file.close(); } - catch (rl::hal::Exception& e) + catch (const std::exception& e) { - ft.close(); + file.close(); std::cout << e.what() << std::endl; - return 1; + return EXIT_FAILURE; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlSocketDemo/CMakeLists.txt b/demos/rlSocketDemo/CMakeLists.txt new file mode 100644 index 00000000..d4fe40ce --- /dev/null +++ b/demos/rlSocketDemo/CMakeLists.txt @@ -0,0 +1,33 @@ +find_package(Boost REQUIRED) + +add_executable( + rlSocketDemoClient + rlSocketDemoClient.cpp +) + +target_include_directories( + rlSocketDemoClient + PUBLIC + ${Boost_INCLUDE_DIR} +) + +target_link_libraries( + rlSocketDemoClient + hal +) + +add_executable( + rlSocketDemoServer + rlSocketDemoServer.cpp +) + +target_include_directories( + rlSocketDemoServer + PUBLIC + ${Boost_INCLUDE_DIR} +) + +target_link_libraries( + rlSocketDemoServer + hal +) diff --git a/demos/rlSocketDemo/rlSocketDemoClient.cpp b/demos/rlSocketDemo/rlSocketDemoClient.cpp new file mode 100644 index 00000000..2b5086b2 --- /dev/null +++ b/demos/rlSocketDemo/rlSocketDemoClient.cpp @@ -0,0 +1,85 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include + +#define IPV4 +//#define IPV6 + +#define TCP +//#define UDP + +int +main(int argc, char** argv) +{ + if (argc < 5) + { + std::cout << "Usage: rlSocketDemoClient ADDRESS PORT MESSAGE BUFFERSIZE" << std::endl; + return EXIT_FAILURE; + } + + try + { +#ifdef IPV4 + rl::hal::Socket::Address address = rl::hal::Socket::Address::Ipv4(argv[1], argv[2]); +#endif +#ifdef IPV6 + rl::hal::Socket::Address address = rl::hal::Socket::Address::Ipv6(argv[1], argv[2]); +#endif + +#ifdef TCP + rl::hal::Socket socket = rl::hal::Socket::Tcp(address); +#endif +#ifdef UDP + rl::hal::Socket socket = rl::hal::Socket::Udp(address); +#endif + socket.open(); + socket.connect(); + + std::string message = argv[3]; + std::size_t numbytes = socket.send(message.c_str(), message.length()); + std::cout << numbytes << " characters sent" << std::endl; + std::cout << message.substr(0, numbytes) << std::endl; + + std::vector buffer(boost::lexical_cast(argv[4]) + 1); + buffer.back() = '\0'; + numbytes = socket.recv(buffer.data(), buffer.size() - 1); + std::cout << numbytes << " characters received" << std::endl; + std::cout << buffer.data() << std::endl; + + socket.close(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/demos/rlSocketDemo/rlSocketDemoServer.cpp b/demos/rlSocketDemo/rlSocketDemoServer.cpp new file mode 100644 index 00000000..8a156445 --- /dev/null +++ b/demos/rlSocketDemo/rlSocketDemoServer.cpp @@ -0,0 +1,107 @@ +// +// Copyright (c) 2009, Markus Rickert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#include +#include +#include +#include +#include +#include + +#define IPV4 +//#define IPV6 + +#define TCP +//#define UDP + +int +main(int argc, char** argv) +{ + if (argc < 2) + { + std::cout << "Usage: rlSocketDemoServer PORT BUFFERSIZE" << std::endl; + return EXIT_FAILURE; + } + + std::vector buffer(boost::lexical_cast(argv[2]) + 1); + buffer.back() = '\0'; + + try + { +#ifdef IPV4 + rl::hal::Socket::Address address = rl::hal::Socket::Address::Ipv4("", argv[1]); +#endif +#ifdef IPV6 + rl::hal::Socket::Address address = rl::hal::Socket::Address::Ipv6("", argv[1]); +#endif + +#ifdef TCP + rl::hal::Socket socket = rl::hal::Socket::Tcp(address); +#endif +#ifdef UDP + rl::hal::Socket socket = rl::hal::Socket::Udp(address); +#endif + socket.open(); + socket.bind(); +#ifdef TCP + socket.listen(); +#endif + + while (true) + { + std::memset(buffer.data(), 0, buffer.size() - 1); + +#ifdef TCP + rl::hal::Socket connection = socket.accept(); + std::size_t numbytes = connection.recv(buffer.data(), buffer.size() - 1); +#endif +#ifdef UDP + rl::hal::Socket::Address address; + std::size_t numbytes = socket.recvfrom(buffer.data(), buffer.size() - 1, address); +#endif + std::cout << numbytes << " characters received" << std::endl; + std::cout << buffer.data() << std::endl; + +#ifdef TCP + numbytes = connection.send(buffer.data(), numbytes); +#endif +#ifdef UDP + numbytes = socket.sendto(buffer.data(), numbytes, address); +#endif + std::cout << numbytes << " characters sent" << std::endl; + std::cout << buffer.data() << std::endl; + } + + socket.close(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/demos/rlSpatialDemo/CMakeLists.txt b/demos/rlSpatialDemo/CMakeLists.txt index abd681f4..32c866c2 100644 --- a/demos/rlSpatialDemo/CMakeLists.txt +++ b/demos/rlSpatialDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlSpatialDemo) - add_executable( rlSpatialDemo rlSpatialDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlSpatialDemo - rlmath + math ) diff --git a/demos/rlSpatialDemo/rlSpatialDemo.cpp b/demos/rlSpatialDemo/rlSpatialDemo.cpp index db76c10f..aab73b36 100644 --- a/demos/rlSpatialDemo/rlSpatialDemo.cpp +++ b/demos/rlSpatialDemo/rlSpatialDemo.cpp @@ -302,5 +302,5 @@ main(int argc, char** argv) std::cout << "f1 = " << f1.matrix().transpose() << std::endl; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlThreadsDemo/CMakeLists.txt b/demos/rlThreadsDemo/CMakeLists.txt index 22a2ce31..df66b9c6 100644 --- a/demos/rlThreadsDemo/CMakeLists.txt +++ b/demos/rlThreadsDemo/CMakeLists.txt @@ -1,11 +1,30 @@ -project(rlThreadsDemo) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + find_package(Boost REQUIRED COMPONENTS thread) +endif() add_executable( rlThreadsDemo rlThreadsDemo.cpp ) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( + rlThreadsDemo + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED + ) + + target_include_directories(rlThreadsDemo PUBLIC ${Boost_INCLUDE_DIR}) +endif() + target_link_libraries( rlThreadsDemo - rlutil + util ) + +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_link_libraries(rlThreadsDemo ${Boost_LIBRARIES}) +endif() diff --git a/demos/rlThreadsDemo/rlThreadsDemo.cpp b/demos/rlThreadsDemo/rlThreadsDemo.cpp index e9b63f08..be4aa92f 100644 --- a/demos/rlThreadsDemo/rlThreadsDemo.cpp +++ b/demos/rlThreadsDemo/rlThreadsDemo.cpp @@ -24,65 +24,44 @@ // POSSIBILITY OF SUCH DAMAGE. // +#include +#include #include +#include +#include #include -#include -#include -class TestThread : public rl::util::Thread +void run(const std::size_t& i) { -public: - TestThread(const std::size_t& i = 0) : - i(i) - { - }; - - virtual ~TestThread() - { - }; + std::function rand = std::bind(std::uniform_real_distribution(0.0, 2.0), std::mt19937(std::random_device()())); - void run() + for (std::size_t j = 0; j < 5; ++j) { -#ifdef WIN32 - srand(static_cast< unsigned int >(rl::util::Timer::now() * 1000000.0f)); -#endif // WIN32 - - for (std::size_t j = 0; j < 5; ++j) - { - std::size_t time = rand() % 1000 + 100; - sleep(time / 1000.0f); - std::cout << "TestThread[" << i << "]::run() - " << j << " - " << time / 1000.0f << " seconds" << std::endl; - } + double seconds = rand(); + std::this_thread::sleep_for(std::chrono::duration(seconds)); + std::cout << "Thread[" << i << "] - " << j << " - " << seconds << " seconds" << std::endl; } - -private: - std::size_t i; -}; +} int main(int argc, char** argv) { - srand(static_cast< unsigned int >(rl::util::Timer::now() * 1000000.0f)); - - std::vector< rl::util::Thread* > threads; + std::vector threads; for (std::size_t i = 0; i < 5; ++i) { - std::cout << "TestThread[" << i << "]" << std::endl; - TestThread* thread = new TestThread(i); - std::cout << "TestThread[" << i << "]::start()" << std::endl; - thread->start(); - threads.push_back(thread); + std::cout << "Thread[" << i << "]" << std::endl; + threads.push_back(std::thread(run, i)); } std::cout << "before join()" << std::endl; - for (std::size_t i = 0; i < 5; ++i) + for (std::size_t i = 0; i < threads.size(); ++i) { - threads[i]->join(); + threads[i].join(); } std::cout << "after join()" << std::endl; - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlTimerDemo/CMakeLists.txt b/demos/rlTimerDemo/CMakeLists.txt index 3921ccc4..3f38e421 100644 --- a/demos/rlTimerDemo/CMakeLists.txt +++ b/demos/rlTimerDemo/CMakeLists.txt @@ -1,11 +1,25 @@ project(rlTimerDemo) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + find_package(Boost REQUIRED COMPONENTS thread) +endif() + add_executable( rlTimerDemo rlTimerDemo.cpp ) -target_link_libraries( - rlTimerDemo - rlutil -) +if(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.00.23918) + target_compile_definitions( + rlTimerDemo + PUBLIC + -DBOOST_ALL_NO_LIB + -DBOOST_CHRONO_HEADER_ONLY + -DBOOST_ERROR_CODE_HEADER_ONLY + -DBOOST_SYSTEM_NO_DEPRECATED + ) + + target_include_directories(rlTimerDemo PUBLIC ${Boost_INCLUDE_DIR}) + + target_link_libraries(rlTimerDemo ${Boost_LIBRARIES}) +endif() diff --git a/demos/rlTimerDemo/rlTimerDemo.cpp b/demos/rlTimerDemo/rlTimerDemo.cpp index 481430d1..72cc3d7b 100644 --- a/demos/rlTimerDemo/rlTimerDemo.cpp +++ b/demos/rlTimerDemo/rlTimerDemo.cpp @@ -24,32 +24,28 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include -#include +#include +#include #include -#include +#include +#include int main(int argc, char** argv) { - srand(static_cast< unsigned int >(rl::util::Timer::now() * 1000000.0f)); - - rl::util::Timer timer; - - double seconds = 0.0f; + std::function rand = std::bind(std::uniform_real_distribution(0.0, 1.0), std::mt19937(std::random_device()())); for (std::size_t i = 0; i < 7; ++i) { - seconds += static_cast< double >(rand() % 42) * M_PI / 256.0f; - + double seconds = rand(); std::cout << seconds << " seconds... " << std::flush; - timer.start(); - rl::util::Timer::sleep(seconds); - timer.stop(); + std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); + std::this_thread::sleep_for(std::chrono::duration(seconds)); + std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now(); - std::cout << timer.elapsed() << " seconds" << std::endl; + std::cout << std::chrono::duration(stop - start).count() << std::endl; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlTrapezoidalVelocityDemo/CMakeLists.txt b/demos/rlTrapezoidalVelocityDemo/CMakeLists.txt index b5e50bd9..765c15e9 100644 --- a/demos/rlTrapezoidalVelocityDemo/CMakeLists.txt +++ b/demos/rlTrapezoidalVelocityDemo/CMakeLists.txt @@ -1,5 +1,3 @@ -project(rlTrapezoidalVelocityDemo) - add_executable( rlTrapezoidalVelocityDemo rlTrapezoidalVelocityDemo.cpp @@ -7,5 +5,5 @@ add_executable( target_link_libraries( rlTrapezoidalVelocityDemo - rlmath + math ) diff --git a/demos/rlTrapezoidalVelocityDemo/rlTrapezoidalVelocityDemo.cpp b/demos/rlTrapezoidalVelocityDemo/rlTrapezoidalVelocityDemo.cpp index 038cc2de..4420fd23 100644 --- a/demos/rlTrapezoidalVelocityDemo/rlTrapezoidalVelocityDemo.cpp +++ b/demos/rlTrapezoidalVelocityDemo/rlTrapezoidalVelocityDemo.cpp @@ -30,7 +30,7 @@ int main(int argc, char** argv) { - rl::math::TrapezoidalVelocity< rl::math::Real > interpolator; + rl::math::TrapezoidalVelocity interpolator; interpolator.x0 = 50.0; interpolator.xe = -200.0; @@ -63,5 +63,5 @@ main(int argc, char** argv) interpolator.v0 = v; } - return 0; + return EXIT_SUCCESS; } diff --git a/demos/rlViewDemo/CMakeLists.txt b/demos/rlViewDemo/CMakeLists.txt index 1f609614..ca854343 100644 --- a/demos/rlViewDemo/CMakeLists.txt +++ b/demos/rlViewDemo/CMakeLists.txt @@ -1,13 +1,26 @@ -project(rlViewDemo) +find_package(SoQt) -find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) -include(${QT_USE_FILE}) +if(USE_QT5 AND SoQt5_FOUND) + find_package(Qt5 COMPONENTS Core Gui OpenGL Widgets QUIET) +endif() -find_package(SoQt) +if(Qt5_FOUND) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_FOUND Qt5_FOUND) +else() + set(QT_USE_IMPORTED_TARGETS ON) + find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) + set(QT_USE_QTMAIN ON) + include(${QT_USE_FILE}) +endif() + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -if(QT_FOUND AND SOQT_FOUND) +if(QT_FOUND AND SoQt_FOUND) add_executable( rlViewDemo + WIN32 rlViewDemo.cpp ${rl_SOURCE_DIR}/robotics-library.rc ) @@ -15,31 +28,36 @@ if(QT_FOUND AND SOQT_FOUND) target_compile_definitions( rlViewDemo PUBLIC - ${QT_DEFINITIONS} - ${SOQT_DEFINITIONS} + ${SoQt_DEFINITIONS} ) include_directories( rlViewDemo PUBLIC - ${QT_INCLUDES} - ${SOQT_INCLUDE_DIRS} + ${SoQt_INCLUDE_DIRS} ) target_link_libraries( rlViewDemo - rlsg + sg ${QT_LIBRARIES} - ${SOQT_LIBRARIES} + ${SoQt_LIBRARIES} ) set_target_properties( rlViewDemo PROPERTIES VERSION ${VERSION} - DEBUG_POSTFIX d ) + if(WIN32) + set_target_properties( + rlViewDemo + PROPERTIES + DEBUG_POSTFIX d + ) + endif() + install( TARGETS rlViewDemo COMPONENT demos @@ -48,22 +66,41 @@ if(QT_FOUND AND SOQT_FOUND) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT demos) + endif() + if(UNIX) - install(FILES rlViewDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) - endif(UNIX) + configure_file(rlViewDemo.desktop.in rlViewDemo.desktop @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rlViewDemo.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT demos) + endif() set( - CPACK_NSIS_EXTRA_INSTALL_COMMANDS - ${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + CPACK_NSIS_CREATE_ICONS_EXTRA + ${CPACK_NSIS_CREATE_ICONS_EXTRA} "CreateShortCut \\\\ \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\rlViewDemo.lnk\\\" \\\\ \\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\rlViewDemo.exe\\\" \\\\ \\\"\\\\ - \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\"\\\\ + \\\$\\\\\\\"$INSTDIR\\\\${CMAKE_INSTALL_DATADIR}\\\\rl-${VERSION}\\\\examples\\\\rlsg\\\\unimation-puma560_boxes.xml\\\$\\\\\\\"\\\\ \\\" \\\\ \\\"\\\" \\\"\\\" \\\"\\\" \\\"\\\" \\\\ \\\"Visualization demo with Unimation Puma 560\\\"" PARENT_SCOPE ) - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlViewDemo.lnk\\\"" PARENT_SCOPE) -endif(QT_FOUND AND SOQT_FOUND) + set(CPACK_NSIS_DELETE_ICONS_EXTRA ${CPACK_NSIS_DELETE_ICONS_EXTRA} "Delete \\\"$SMPROGRAMS\\\\$START_MENU\\\\rlViewDemo.lnk\\\"" PARENT_SCOPE) + + set( + WIX_SHORTCUTS + ${WIX_SHORTCUTS} + "" + PARENT_SCOPE + ) +endif() diff --git a/demos/rlViewDemo/rlViewDemo.cpp b/demos/rlViewDemo/rlViewDemo.cpp index b83bf26e..0d190ebb 100644 --- a/demos/rlViewDemo/rlViewDemo.cpp +++ b/demos/rlViewDemo/rlViewDemo.cpp @@ -24,7 +24,9 @@ // POSSIBILITY OF SUCH DAMAGE. // -#include +#include +#include +#include #include #include #include @@ -35,12 +37,6 @@ int main(int argc, char** argv) { - if (argc < 2) - { - std::cout << "Usage: rlViewDemo SCENEFILE" << std::endl; - return 1; - } - try { SoDB::init(); @@ -48,24 +44,40 @@ main(int argc, char** argv) QWidget* widget = SoQt::init(argc, argv, argv[0]); widget->resize(800, 600); + QString filename; + + if (argc < 2) + { + filename = QFileDialog::getOpenFileName(widget, "", filename, "All Formats (*.xml)"); + } + else + { + filename = argv[1]; + } + rl::sg::so::Scene scene; - scene.load(argv[1]); - SoQtExaminerViewer viewer(widget, NULL, true, SoQtFullViewer::BUILD_POPUP); + if (!filename.isEmpty()) + { + scene.load(filename.toStdString()); + } + + SoQtExaminerViewer viewer(widget, nullptr, true, SoQtFullViewer::BUILD_POPUP); viewer.setSceneGraph(scene.root); viewer.setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); viewer.show(); - widget->setWindowTitle(QString(argv[1]) + " - rlViewDemo"); + widget->setWindowTitle(filename + (filename.isEmpty() ? "" : " - ") + "rlViewDemo"); SoQt::show(widget); SoQt::mainLoop(); - return 0; + return EXIT_SUCCESS; } catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - return -1; + QApplication application(argc, argv); + QMessageBox::critical(nullptr, "Error", e.what()); + return EXIT_FAILURE; } } diff --git a/demos/rlViewDemo/rlViewDemo.desktop b/demos/rlViewDemo/rlViewDemo.desktop.in similarity index 68% rename from demos/rlViewDemo/rlViewDemo.desktop rename to demos/rlViewDemo/rlViewDemo.desktop.in index a008ce48..11947a76 100644 --- a/demos/rlViewDemo/rlViewDemo.desktop +++ b/demos/rlViewDemo/rlViewDemo.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Categories=Science;Robotics; Comment=Visualization demo with Unimation Puma 560 -Exec=sh -c "rlViewDemo $(dirname %k)/../rl/examples/rlsg/unimation-puma560_boxes.xml" +Exec=sh -c "rlViewDemo $(dirname %k)/../rl-@VERSION@/examples/rlsg/unimation-puma560_boxes.xml" Icon=robotics-library Name=Robotics Library (rlViewDemo) Type=Application diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 00000000..e09ea116 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,13 @@ +find_package(Doxygen) +find_package(LATEX) +find_package(Perl) + +configure_file(Doxyfile.in Doxyfile) + +if(BUILD_DOCUMENTATION) + add_custom_target(doc ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +elseif(DOXYGEN_FOUND) + add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +endif() + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rl-${VERSION} OPTIONAL COMPONENT documentation) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in new file mode 100644 index 00000000..cf406092 --- /dev/null +++ b/doc/Doxyfile.in @@ -0,0 +1,2380 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Robotics Library" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = "${VERSION}" + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = "${rl_SOURCE_DIR}/robotics-library.svg" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = "${CMAKE_CURRENT_BINARY_DIR}" + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = "${rl_SOURCE_DIR}/src" + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = "${rl_SOURCE_DIR}/src/rl" + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.as \ + *.js + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = "${CMAKE_CURRENT_SOURCE_DIR}/extra.css" + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = "${CMAKE_CURRENT_SOURCE_DIR}/extra.sty" + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = YES + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2 + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = "${CMAKE_CURRENT_SOURCE_DIR}/extra.js" + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /