├── .gitignore
├── CMakeLists.txt
├── README.md
├── RealResults.png
├── Screenshot.png
├── VirtualScan
├── VirtualScan.sln
├── VirtualScan.vcxproj
├── VirtualScan.vcxproj.filters
├── VirtualScan.vcxproj.user
├── shaders
│ ├── phong.hlsl
│ ├── test.hlsl
│ └── ward.hlsl
├── src
│ ├── GlobalAppState.h
│ ├── Lighting.cpp
│ ├── Lighting.h
│ ├── Scene.cpp
│ ├── Scene.h
│ ├── VirtualScanCPU.h
│ ├── Visualizer.cpp
│ ├── Visualizer.h
│ ├── mLibInclude.h
│ ├── mLibSource.cpp
│ ├── main.cpp
│ ├── stdafx.cpp
│ ├── stdafx.h
│ └── targetver.h
└── zParametersScan.txt
├── cmake.sh
├── cmake
├── CheckC11.cmake
└── Modules
│ ├── FindGStreamer.cmake
│ ├── FindGStreamerWin.cmake
│ └── FindTCLAP.cmake
├── cmake_jetson.sh
├── external
├── QGLViewer
│ ├── .gitignore
│ ├── CHANGELOG
│ ├── GPL_EXCEPTION
│ ├── INSTALL
│ ├── ImageInterface.ui
│ ├── LICENCE
│ ├── Makefile
│ ├── QGLViewer.pro
│ ├── README
│ ├── VRender
│ │ ├── AxisAlignedBox.h
│ │ ├── BSPSortMethod.cpp
│ │ ├── BackFaceCullingOptimizer.cpp
│ │ ├── EPSExporter.cpp
│ │ ├── Exporter.cpp
│ │ ├── Exporter.h
│ │ ├── FIGExporter.cpp
│ │ ├── NVector3.cpp
│ │ ├── NVector3.h
│ │ ├── Optimizer.h
│ │ ├── ParserGL.cpp
│ │ ├── ParserGL.h
│ │ ├── Primitive.cpp
│ │ ├── Primitive.h
│ │ ├── PrimitivePositioning.cpp
│ │ ├── PrimitivePositioning.h
│ │ ├── SortMethod.h
│ │ ├── TopologicalSortMethod.cpp
│ │ ├── Types.h
│ │ ├── VRender.cpp
│ │ ├── VRender.h
│ │ ├── Vector2.cpp
│ │ ├── Vector2.h
│ │ ├── Vector3.cpp
│ │ ├── Vector3.h
│ │ ├── VisibilityOptimizer.cpp
│ │ ├── gpc.cpp
│ │ └── gpc.h
│ ├── VRenderInterface.ui
│ ├── camera.cpp
│ ├── camera.h
│ ├── config.h
│ ├── constraint.cpp
│ ├── constraint.h
│ ├── domUtils.h
│ ├── frame.cpp
│ ├── frame.h
│ ├── keyFrameInterpolator.cpp
│ ├── keyFrameInterpolator.h
│ ├── manipulatedCameraFrame.cpp
│ ├── manipulatedCameraFrame.h
│ ├── manipulatedFrame.cpp
│ ├── manipulatedFrame.h
│ ├── mouseGrabber.cpp
│ ├── mouseGrabber.h
│ ├── qglviewer-icon.xpm
│ ├── qglviewer.cpp
│ ├── qglviewer.h
│ ├── qglviewer.icns
│ ├── qglviewer_fr.qm
│ ├── qglviewer_fr.ts
│ ├── quaternion.cpp
│ ├── quaternion.h
│ ├── saveSnapshot.cpp
│ ├── vec.cpp
│ └── vec.h
├── fastlz
│ ├── 6pack.c
│ ├── 6unpack.c
│ ├── LICENSE
│ ├── README.TXT
│ ├── fastlz.c
│ └── fastlz.h
└── snappy
│ ├── AUTHORS
│ ├── COPYING
│ ├── README
│ ├── format_description.txt
│ ├── framing_format.txt
│ ├── snappy-internal.h
│ ├── snappy-sinksource.cc
│ ├── snappy-sinksource.h
│ ├── snappy-stubs-internal.cc
│ ├── snappy-stubs-internal.h
│ ├── snappy-stubs-public.h
│ ├── snappy.cc
│ └── snappy.h
├── get_octomap.sh
├── include
├── ait
│ ├── BoostNetworkClientTCP.h
│ ├── BoostNetworkClientUDP.h
│ ├── boost.h
│ ├── boost_serialization_utils.h
│ ├── color.h
│ ├── common.h
│ ├── cuda_math.h
│ ├── cuda_utils.h
│ ├── cv_utilities.h
│ ├── dji
│ │ ├── RosDjiDrone.h
│ │ └── dji_drone.h
│ ├── eigen.h
│ ├── eigen_alignment.h
│ ├── eigen_options.h
│ ├── eigen_serialization.h
│ ├── eigen_serialization_plugin.h
│ ├── eigen_utils.h
│ ├── eigen_with_serialization.h
│ ├── filesystem.h
│ ├── gps.h
│ ├── graph_boost.h
│ ├── mLib.h
│ ├── mLibUtils.h
│ ├── mLibZlib.h
│ ├── math.h
│ ├── math
│ │ ├── continuous_grid3d.h
│ │ ├── geometry.h
│ │ ├── grid3d.h
│ │ └── statistics.h
│ ├── nn
│ │ └── approximate_nearest_neighbor.h
│ ├── options.h
│ ├── pose.h
│ ├── qt_utils.h
│ ├── random.h
│ ├── serializable.h
│ ├── serialization.h
│ ├── thread.h
│ ├── utilities.h
│ └── vision_utilities.h
└── bh
│ ├── aabb
│ ├── aabb_tree.h
│ └── aabb_tree.hxx
│ ├── algorithm.h
│ ├── boost.h
│ ├── boost_serialization_utils.h
│ ├── color.h
│ ├── common.h
│ ├── config_options.h
│ ├── cuda_math.h
│ ├── cuda_utils.h
│ ├── eigen.h
│ ├── eigen_options.h
│ ├── eigen_serialization.h
│ ├── eigen_utils.h
│ ├── filesystem.h
│ ├── gperf.h
│ ├── gps.h
│ ├── graph_boost.h
│ ├── mLib
│ ├── mLib.h
│ ├── mLibUtils.h
│ └── mLibZlib.h
│ ├── math
│ ├── continuous_grid3d.h
│ ├── geometry.h
│ ├── grid3d.h
│ ├── histogram.h
│ ├── statistics.h
│ └── utilities.h
│ ├── memory.h
│ ├── mesh
│ ├── triangle_mesh.h
│ └── triangle_mesh.hxx
│ ├── nn
│ ├── approximate_nearest_neighbor.h
│ └── approximate_nearest_neighbor.hxx
│ ├── opencv
│ ├── cameras.h
│ ├── drawing.h
│ ├── images.h
│ └── matrix.h
│ ├── opengl
│ ├── offscreen_opengl.h
│ ├── offscreen_opengl.hxx
│ └── utils.h
│ ├── pose.h
│ ├── qt
│ └── utils.h
│ ├── random.h
│ ├── se3_transform.h
│ ├── sqlite
│ └── sqlite3_wrapper.h
│ ├── string_utils.h
│ ├── thread.h
│ ├── utilities.h
│ └── vision
│ ├── cameras.h
│ ├── drawing_qt.h
│ ├── geometry.h
│ └── types.h
├── make_jetson.sh
├── plane_sweep_stereo
├── CMakeLists.txt
└── src
│ ├── plane_sweep_test.cpp
│ ├── plane_sweep_test_orig.cpp
│ └── plane_sweep_zed.cpp
├── quad_flight
├── CMakeLists.txt
├── cfg
│ └── PositionController.cfg
├── config
│ └── gimbal_control.yaml
├── launch
│ ├── buildings_flight_gazebo.launch
│ ├── buildings_world.launch
│ ├── display_quad.launch
│ ├── moveit_test.launch
│ ├── outdoor_flight_gazebo.launch
│ ├── position_controller.launch
│ ├── position_controller_with_teleop.launch
│ ├── position_teleop.launch
│ ├── rolling_landscape_120m.launch
│ ├── start_world.launch
│ └── velocity_teleop.launch
├── package.xml
├── rviz_cfg
│ ├── buildings_flight.rviz
│ ├── outdoor_flight.rviz
│ └── urdf.rviz
├── src
│ ├── position_controller.cpp
│ ├── position_teleop.cpp
│ └── velocity_teleop.cpp
├── test
│ ├── get_link_state.sh
│ ├── pub_control.sh
│ └── set_link_state.sh
├── urdf
│ ├── camera_gimbal.urdf.xacro
│ ├── camera_gimbal2.urdf.xacro
│ ├── depth_camera.urdf.xacro
│ ├── materials.xacro
│ ├── quadrotor_base.urdf.xacro
│ ├── quadrotor_simple.urdf.xacro
│ ├── quadrotor_test.gazebo
│ ├── quadrotor_test.xacro
│ ├── quadrotor_with_depth_camera.gazebo.xacro
│ ├── quadrotor_with_depth_camera.urdf.xacro
│ ├── utils.xacro
│ └── xacro_test.sh
└── worlds
│ ├── buildings.world
│ ├── buildings.world.xacro
│ ├── house1.sdf.xacro
│ ├── house2.sdf.xacro
│ ├── house3.sdf.xacro
│ └── xacro.sh
├── quad_planner
├── CMakeLists.txt
├── LICENSE
├── cmake
│ └── Modules
│ │ └── Findglm.cmake
├── include
│ └── quad_planner
│ │ ├── optimizing_rrt_planner.h
│ │ ├── quad_planner.h
│ │ └── rendering
│ │ ├── color.h
│ │ ├── glm.h
│ │ ├── linalg.h
│ │ ├── lines.h
│ │ ├── octomap_renderer.h
│ │ ├── render_object.h
│ │ ├── scene_object.h
│ │ ├── shader_program.h
│ │ ├── triangle_mesh.h
│ │ ├── utilities.h
│ │ └── visualizer.h
├── octomap_trajectory.txt
├── package.xml
├── scripts
│ └── visualize_trajectory.py
├── src
│ ├── octomap_trajectory.txt
│ ├── optimizing_rrt_planner.cpp
│ ├── quad_planner.cpp
│ ├── quad_planner_app.cpp
│ ├── rendering
│ │ ├── lines.cpp
│ │ ├── octomap_renderer.cpp
│ │ ├── scene_object.cpp
│ │ ├── shader_program.cpp
│ │ ├── triangle_mesh.cpp
│ │ ├── utilities.cpp
│ │ └── visualizer.cpp
│ └── shaders
│ │ ├── octomap_shader.fragment
│ │ ├── octomap_shader.geometry
│ │ ├── octomap_shader.vertex
│ │ ├── phong_shader.fragment
│ │ ├── phong_shader.vertex
│ │ ├── simple_fragment_shader.fragmentshader
│ │ ├── simple_vertex_shader.vertexshader
│ │ ├── trajectory_shader.fragment
│ │ ├── trajectory_shader.geometry
│ │ ├── trajectory_shader.vertex
│ │ └── vertex.shader
└── voxel_coordinate_system.jpeg
├── src
├── bh
│ └── utilities.cpp
├── mLib.cpp
├── mLibSource.cpp
├── mLibZlib.cpp
└── utilities.cpp
├── stereo
├── CMakeLists.txt
├── cmake.sh
├── include
│ └── ait
│ │ └── stereo
│ │ ├── dense_stereo_matcher.h
│ │ ├── sparse_stereo.h
│ │ ├── sparse_stereo_matcher.h
│ │ ├── sparse_stereo_matcher.hpp
│ │ └── stereo_calibration.h
└── src
│ ├── sparse_stereo_test.cpp
│ ├── sparse_stereo_zed.cpp
│ ├── stereo_calibration.cpp
│ ├── stereo_calibration_tool_zed.cpp
│ └── stereo_capture_zed.cpp
├── video
├── CMakeLists.txt
├── cmake
│ ├── CheckC11.cmake
│ └── Modules
│ │ ├── FindGStreamer.cmake
│ │ ├── FindGStreamerWin.cmake
│ │ └── FindTCLAP.cmake
├── include
│ └── ait
│ │ └── video
│ │ ├── EncodingGstreamerPipeline.h
│ │ ├── GstMetaCorrespondence.h
│ │ ├── GstreamerPipeline.h
│ │ ├── StereoNetworkSensorClient.h
│ │ ├── StereoNetworkSensorManager.h
│ │ ├── StereoNetworkSensorProtocol.h
│ │ ├── video_source.h
│ │ ├── video_source_opencv.h
│ │ └── video_source_zed.h
├── src
│ ├── GstMetaCorrespondence.cpp
│ ├── video_capture.cpp
│ ├── video_capture_zed.cpp
│ ├── video_source.cpp
│ ├── video_source_opencv.cpp
│ ├── video_source_zed.cpp
│ ├── video_streamer.cpp
│ ├── video_streamer_bundlefusion.cpp
│ └── video_streamer_bundlefusion_drone.cpp
└── tools
│ ├── make_all_pipeline_graphs.sh
│ ├── make_pipeline_graph.sh
│ ├── play_file.sh
│ ├── receive_stream.sh
│ ├── record_file.sh
│ ├── run_with_graph.sh
│ ├── send_stream.sh
│ └── send_zed_stream.sh
└── viewpoint_planner
├── CMakeLists.txt
├── src
├── bvh
│ ├── bvh.cu
│ ├── bvh.cuh
│ └── bvh.h
├── exe
│ ├── clip_mesh.cpp
│ ├── clip_point_cloud.cpp
│ ├── compute_ground_truth_mesh.cpp
│ ├── create_baseline_viewpoint_path.cpp
│ ├── create_colmap_mvs_files.cpp
│ ├── evaluate_dense_points.cpp
│ ├── fuse_point_cloud.cpp
│ ├── image_match_invalidator.cpp
│ ├── image_matcher.cpp
│ ├── image_matcher_test.cpp
│ ├── merge_viewpoint_paths.cpp
│ ├── occupancy_map_from_colmap.cpp
│ ├── occupancy_map_from_mesh.cpp
│ ├── occupancy_map_from_sens.cpp
│ ├── transform_mesh.cpp
│ ├── viewpoint_planner_cmdline.cpp
│ └── viewpoint_planner_gui.cpp
├── mLib
│ ├── mLib.cpp
│ └── mLib.h
├── octree
│ ├── occupancy_map.cpp
│ ├── occupancy_map.h
│ ├── occupancy_map.hxx
│ ├── occupancy_map_tree_navigator.hxx
│ ├── occupancy_node.cpp
│ └── occupancy_node.h
├── planner
│ ├── motion_planner.h
│ ├── occupied_tree.h
│ ├── offscreen_octree_renderer.h
│ ├── viewpoint.cpp
│ ├── viewpoint.h
│ ├── viewpoint_offscreen_renderer.cpp
│ ├── viewpoint_offscreen_renderer.h
│ ├── viewpoint_planner.cpp
│ ├── viewpoint_planner.h
│ ├── viewpoint_planner.hxx
│ ├── viewpoint_planner_data.cpp
│ ├── viewpoint_planner_data.h
│ ├── viewpoint_planner_dump.cpp
│ ├── viewpoint_planner_export.cpp
│ ├── viewpoint_planner_graph.cpp
│ ├── viewpoint_planner_graph.hxx
│ ├── viewpoint_planner_motion.cpp
│ ├── viewpoint_planner_opengl.cpp
│ ├── viewpoint_planner_path.cpp
│ ├── viewpoint_planner_path_tour.cpp
│ ├── viewpoint_planner_raycast.cpp
│ ├── viewpoint_planner_sampling.cpp
│ ├── viewpoint_planner_scoring.cpp
│ ├── viewpoint_planner_serialization.cpp
│ ├── viewpoint_planner_serialization.h
│ ├── viewpoint_planner_sparse_matching.cpp
│ ├── viewpoint_planner_types.h
│ ├── viewpoint_raycast.cpp
│ ├── viewpoint_raycast.h
│ ├── viewpoint_score.cpp
│ └── viewpoint_score.h
├── reconstruction
│ ├── colmap_database.h
│ ├── dense_reconstruction.cpp
│ ├── dense_reconstruction.h
│ ├── sparse_reconstruction.cpp
│ └── sparse_reconstruction.h
├── rendering
│ ├── binned_octree_drawer.cpp
│ ├── binned_octree_drawer.h
│ ├── line_drawer.h
│ ├── octree_drawer.cpp
│ ├── octree_drawer.h
│ ├── point_drawer.h
│ ├── sparse_reconstruction_drawer.cpp
│ ├── sparse_reconstruction_drawer.h
│ ├── triangle_drawer.h
│ ├── viewpoint_drawer.h
│ ├── viewpoint_drawer.hxx
│ ├── voxel_drawer.cpp
│ └── voxel_drawer.h
├── shaders.qrc
├── shaders
│ ├── lines.f.glsl
│ ├── lines.g.glsl
│ ├── lines.v.glsl
│ ├── octomap_shader.f.glsl
│ ├── octomap_shader.g.glsl
│ ├── octomap_shader.v.glsl
│ ├── phong_shader.f.glsl
│ ├── phong_shader.v.glsl
│ ├── points.f.glsl
│ ├── points.v.glsl
│ ├── trajectory_shader.f.glsl
│ ├── trajectory_shader.g.glsl
│ ├── trajectory_shader.v.glsl
│ ├── triangles.f.glsl
│ ├── triangles.v.glsl
│ ├── triangles_depth.f.glsl
│ ├── triangles_depth.v.glsl
│ ├── triangles_indices.f.glsl
│ ├── triangles_indices.v.glsl
│ ├── triangles_normals.f.glsl
│ ├── triangles_normals.v.glsl
│ ├── voxels.f.glsl
│ └── voxels.v.glsl
├── shaders_offscreen.qrc
├── ui
│ ├── qt_utils.h
│ ├── viewer_info_panel.h
│ ├── viewer_info_panel.ui
│ ├── viewer_planner_panel.h
│ ├── viewer_planner_panel.ui
│ ├── viewer_settings_panel.h
│ ├── viewer_settings_panel.ui
│ ├── viewer_widget.cpp
│ ├── viewer_widget.h
│ ├── viewer_window.cpp
│ └── viewer_window.h
├── viewpoint_planner_window2.h
├── viewpoint_statistics_app.cpp
└── web
│ ├── .idea
│ ├── modules.xml
│ └── web.iml
│ ├── external
│ ├── bootstrap
│ │ └── 3.3.7
│ │ │ ├── LICENSE
│ │ │ ├── css
│ │ │ ├── bootstrap-theme.css
│ │ │ ├── bootstrap-theme.css.map
│ │ │ ├── bootstrap-theme.min.css
│ │ │ ├── bootstrap-theme.min.css.map
│ │ │ ├── bootstrap.css
│ │ │ ├── bootstrap.css.map
│ │ │ ├── bootstrap.min.css
│ │ │ └── bootstrap.min.css.map
│ │ │ ├── fonts
│ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ ├── glyphicons-halflings-regular.svg
│ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ └── glyphicons-halflings-regular.woff2
│ │ │ └── js
│ │ │ ├── bootstrap.js
│ │ │ ├── bootstrap.min.js
│ │ │ └── npm.js
│ └── jquery
│ │ └── 3.1.1
│ │ ├── LICENSE
│ │ ├── jquery-3.1.1.js
│ │ └── jquery-3.1.1.min.js
│ ├── map.html
│ ├── src
│ └── kml_utils.js
│ ├── web_socket_server.cpp
│ └── web_socket_server.h
├── test
├── CMakeLists.txt
├── test_ann.cpp
├── test_qt_image.cpp
├── test_se3_transform.cpp
├── test_vision.cpp
└── test_vision_qt.cpp
└── viewpoint_planner.cfg
/.gitignore:
--------------------------------------------------------------------------------
1 | images/
2 | workspace/
3 | catkin_ws/
4 | #catkin_ws/.catkin_tools/
5 | #catkin_ws/build/
6 | #catkin_ws/devel/
7 | #catkin_ws/logs/
8 | stereo/build_jetson/
9 | video/build/
10 | video/build_jetson/
11 | *.mp4
12 | .qglviewer.xml
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Quad3DR
2 |
3 | *Quad3DR* enables planning of Quadrotor trajectories for dense 3D reconstruction of buildings and other structures.
4 |
5 | *Quad3DR* computes a volumetric map of the environment from an initial flight
6 | (using a modified version of [Octomap](https://github.com/OctoMap)). The volumetric map is used to **ensure that the
7 | planned trajectories are only in free space** and not in occupied or unknown space.
8 | Next a viewpoint graph is built by performing a **raycast on the GPU** to measure visible voxels and a viewpoint score is computed.
9 | The viewpoint score is computed based on distance and incidence angle of viewpoint and voxel
10 | (the angle is computed by using a rendered Poisson-reconstructed mesh of the initial flight).
11 | Connections in the viewpoint graph are found using **RRT***. The resulting viewpoint score is **submodular** and we compute
12 | a viewpoint path by using an adaptation of the recursive method in
13 | (Chekuri, Chandra, and Martin Pal. "A recursive greedy algorithm for walks in directed graphs." Foundations of Computer Science, 2005. FOCS 2005. 46th Annual IEEE Symposium on. IEEE, 2005.).
14 |
15 | The planned viewpoint paths were evaluated on synthetic scenes using Unreal Engine and on real scenes using a DJI Matrice 100.
16 |
17 | ## Screenshot
18 | 
19 |
20 | ## Some results from real a scene
21 | 
22 |
--------------------------------------------------------------------------------
/RealResults.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bennihepp/Quad3DR/e86a64617aea4c71060552ef1215fdc35c755aa2/RealResults.png
--------------------------------------------------------------------------------
/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bennihepp/Quad3DR/e86a64617aea4c71060552ef1215fdc35c755aa2/Screenshot.png
--------------------------------------------------------------------------------
/VirtualScan/VirtualScan.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VirtualScan", "VirtualScan.vcxproj", "{B7522A83-8AE0-4351-BE91-71C5989A6519}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Release|x64 = Release|x64
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {B7522A83-8AE0-4351-BE91-71C5989A6519}.Debug|x64.ActiveCfg = Debug|x64
15 | {B7522A83-8AE0-4351-BE91-71C5989A6519}.Debug|x64.Build.0 = Debug|x64
16 | {B7522A83-8AE0-4351-BE91-71C5989A6519}.Release|x64.ActiveCfg = Release|x64
17 | {B7522A83-8AE0-4351-BE91-71C5989A6519}.Release|x64.Build.0 = Release|x64
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/VirtualScan/VirtualScan.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
7 |
8 |
9 | {8e0e7543-8329-42d8-a2e5-c872d029edc0}
10 |
11 |
12 |
13 |
14 | Shader
15 |
16 |
17 | Shader
18 |
19 |
20 | Shader
21 |
22 |
23 |
24 |
25 | Resource Files
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/VirtualScan/VirtualScan.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/VirtualScan/shaders/phong.hlsl:
--------------------------------------------------------------------------------
1 |
2 | cbuffer ConstantBufferCamera : register( b0 )
3 | {
4 | matrix worldViewProj;
5 | matrix world;
6 | float4 eye;
7 | }
8 |
9 | Texture2D modelTexture : register(t0);
10 | SamplerState modelSampler : register(s0);
11 |
12 | cbuffer ConstantBufferMaterial : register( b1 )
13 | {
14 | float4 ambient;
15 | float4 diffuse;
16 | float4 specular;
17 | float shiny;
18 | float3 dummyMaterial;
19 | }
20 |
21 | #define MAX_NUM_LIGHTS 10
22 | cbuffer ConstantBufferLight : register ( b2 )
23 | {
24 | float4 lightDirs[MAX_NUM_LIGHTS];
25 | unsigned int numLights;
26 | float3 dummy123;
27 | }
28 |
29 |
30 |
31 | struct VertexShaderOutput
32 | {
33 | float4 position : SV_POSITION;
34 | float4 normal : TEXCOORD0;
35 | float4 color : TEXCOORD1;
36 | float4 view : TEXCOORD2;
37 | float4 texCoord : TEXCOORD3;
38 | };
39 |
40 | VertexShaderOutput vertexShaderMain( float4 position : position,
41 | float4 normal : normal,
42 | float4 color : color,
43 | float4 texCoord : texCoord )
44 | {
45 | VertexShaderOutput output;
46 | output.position = mul(position, worldViewProj);
47 | float4 posWorld = mul(position, world);
48 | output.view = normalize(eye - posWorld);
49 | normal.w = 0.0f;
50 | output.normal = mul(normal, world);
51 | output.color = color;
52 | output.texCoord = texCoord;
53 | return output;
54 | }
55 |
56 | float3 phong(float3 normal, float3 viewDir, float3 lightDir)
57 | {
58 | normal = normalize(normal);
59 | lightDir = normalize(lightDir);
60 | viewDir = normalize(viewDir);
61 |
62 | //float4 diff = saturate(dot(normal, lightDir)); // diffuse component
63 | float3 diff = saturate(dot(normal, lightDir)); // diffuse component
64 |
65 | // R = 2 * (N.L) * N - L
66 | float3 reflect = normalize(2 * dot(normal, lightDir) * normal - lightDir);
67 | float3 spec = 0.0f;
68 |
69 | if (shiny > 0.0f) {
70 | spec = pow(saturate(dot(reflect, viewDir)), shiny); // R.V^n
71 | }
72 |
73 | return ambient.xyz + diffuse.xyz*diff.xyz + specular.xyz*spec.xyz;
74 | }
75 |
76 | float4 shade_phong( VertexShaderOutput input ) {
77 | float3 color = input.color.xyz;
78 |
79 | float3 res = 0.0f;
80 | for (unsigned int i = 0; i < numLights; i++) {
81 | float3 curr = phong(input.normal.xyz, input.view.xyz, lightDirs[i]) * color;
82 | res += curr;
83 | }
84 |
85 | return float4(res, 1.0f);
86 | }
87 |
88 | float4 pixelShaderMain( VertexShaderOutput input ) : SV_Target
89 | {
90 | return shade_phong(input);
91 | }
92 |
93 | float4 pixelShaderMain_textured(VertexShaderOutput input) : SV_Target
94 | {
95 | float4 shadeColor = shade_phong(input);
96 | float4 texColor = modelTexture.Sample(modelSampler, float2(input.texCoord.x, 1.0f - input.texCoord.y));
97 |
98 | return float4(shadeColor.xyz * texColor.xyz, 1.0f);
99 | }
100 |
--------------------------------------------------------------------------------
/VirtualScan/shaders/test.hlsl:
--------------------------------------------------------------------------------
1 |
2 | cbuffer ConstantBuffer : register( b0 )
3 | {
4 | matrix worldViewProj;
5 | matrix world;
6 | float4 lightDir;
7 | float4 eye;
8 | }
9 |
10 | struct VertexShaderOutput
11 | {
12 | float4 position : SV_POSITION;
13 | float4 color : TEXCOORD0;
14 | };
15 |
16 | VertexShaderOutput vertexShaderMain( float4 position : position,
17 | float4 normal : normal,
18 | float4 color : color,
19 | float4 texCoord : texCoord )
20 | {
21 | VertexShaderOutput output;
22 | output.position = mul( position, worldViewProj );
23 | output.color = color;
24 | return output;
25 | }
26 |
27 | float4 pixelShaderMain( VertexShaderOutput input ) : SV_Target
28 | {
29 | //return float4( input.color.x, input.color.y, input.color.z, 1.0f );
30 | return float4( 0.8, 0.8, 0.8, 1.0);
31 | }
32 |
--------------------------------------------------------------------------------
/VirtualScan/src/GlobalAppState.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "stdafx.h"
4 |
5 | #include
6 | #include
7 | #include
8 |
9 |
10 |
11 | #define X_GLOBAL_APP_STATE_FIELDS \
12 | X(std::vector, s_meshFilenames) \
13 | X(unsigned int, s_imageWidth) \
14 | X(unsigned int, s_imageHeight) \
15 | X(float, s_cameraFov) \
16 | X(bool, s_addNoiseToDepth) \
17 | X(float, s_depthNoiseSigma) \
18 | X(bool, s_filterDepthMap) \
19 | X(float, s_depthSigmaD) \
20 | X(float, s_depthSigmaR) \
21 | X(float, s_voxelSize) \
22 | X(float, s_depthMin) \
23 | X(float, s_depthMax) \
24 | X(unsigned int, s_numMaterialsDiffuse) \
25 | X(unsigned int, s_numMaterialsSpecular) \
26 | X(unsigned int, s_maxTrajectoryLength) \
27 | X(unsigned int, s_maxVoxelSamples) \
28 | X(unsigned int, s_randomizeLighting) \
29 | X(bool, s_randomizeTrajectory) \
30 | X(std::string, s_hostReconstructionName) \
31 | X(unsigned int, s_hostReconstructionPort) \
32 | X(unsigned int, s_listenControlPort)
33 |
34 |
35 | #ifndef VAR_NAME
36 | #define VAR_NAME(x) #x
37 | #endif
38 |
39 | #define checkSizeArray(a, d)( (((sizeof a)/(sizeof a[0])) >= d))
40 |
41 | class GlobalAppState
42 | {
43 | public:
44 |
45 | #define X(type, name) type name;
46 | X_GLOBAL_APP_STATE_FIELDS
47 | #undef X
48 |
49 | //! sets the parameter file and reads
50 | void readMembers(const ParameterFile& parameterFile) {
51 | m_ParameterFile = parameterFile;
52 | readMembers();
53 | }
54 |
55 | //! reads all the members from the given parameter file (could be called for reloading)
56 | void readMembers() {
57 | #define X(type, name) \
58 | if (!m_ParameterFile.readParameter(std::string(#name), name)) {MLIB_WARNING(std::string(#name).append(" ").append("uninitialized")); name = type();}
59 | X_GLOBAL_APP_STATE_FIELDS
60 | #undef X
61 |
62 |
63 | m_bIsInitialized = true;
64 | }
65 |
66 | void print() const {
67 | #define X(type, name) \
68 | std::cout << #name " = " << name << std::endl;
69 | X_GLOBAL_APP_STATE_FIELDS
70 | #undef X
71 | }
72 |
73 | static GlobalAppState& getInstance() {
74 | static GlobalAppState s;
75 | return s;
76 | }
77 | static GlobalAppState& get() {
78 | return getInstance();
79 | }
80 |
81 |
82 | //! constructor
83 | GlobalAppState() {
84 | m_bIsInitialized = false;
85 | }
86 |
87 | //! destructor
88 | ~GlobalAppState() {
89 | }
90 |
91 | Timer s_Timer;
92 |
93 | private:
94 | bool m_bIsInitialized;
95 | ParameterFile m_ParameterFile;
96 | };
97 |
--------------------------------------------------------------------------------
/VirtualScan/src/Lighting.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "stdafx.h"
4 | #include "Lighting.h"
--------------------------------------------------------------------------------
/VirtualScan/src/Scene.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "stdafx.h"
3 | #include "Scene.h"
4 |
5 |
--------------------------------------------------------------------------------
/VirtualScan/src/Visualizer.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | #include
5 | #include
6 |
7 | class Visualizer : public ApplicationCallback
8 | {
9 | public:
10 | Visualizer() : ApplicationCallback() {}
11 | ~Visualizer();
12 |
13 | void init(ApplicationData &app);
14 | void render(ApplicationData &app);
15 |
16 | void keyDown(ApplicationData &app, UINT key);
17 | void keyPressed(ApplicationData &app, UINT key);
18 | void mouseDown(ApplicationData &app, MouseButtonType button);
19 | void mouseMove(ApplicationData &app);
20 | void mouseWheel(ApplicationData &app, int wheelDelta);
21 | void resize(ApplicationData &app);
22 |
23 | private:
24 | FrameTimer m_timer;
25 |
26 | Scene m_scene;
27 | D3D11Font m_font;
28 | Cameraf m_camera;
29 | D3D11RenderTarget m_renderTarget;
30 |
31 | };
--------------------------------------------------------------------------------
/VirtualScan/src/mLibInclude.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef MLIB_INCLUDE_H
3 | #define MLIB_INCLUDE_H
4 |
5 | //
6 | // mLib config options
7 | //
8 | #define MLIB_ERROR_CHECK
9 | #define MLIB_BOUNDS_CHECK
10 |
11 | //
12 | // mLib includes
13 | //
14 |
15 | #include "mLibCore.h"
16 | #include "mLibDepthCamera.h"
17 | #include "mLibD3D11.h"
18 | #include "mLibD3D11Font.h"
19 | #include "mLibZLib.h"
20 | #include "mLibFreeImage.h"
21 |
22 | using namespace ml;
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/VirtualScan/src/mLibSource.cpp:
--------------------------------------------------------------------------------
1 |
2 | //#include "stdafx.h"
3 |
4 | #include "mLibCore.cpp"
5 | #include "mLibD3D11.cpp"
6 | #include "mLibDepthCamera.cpp"
7 | #include "mlibZLib.cpp"
--------------------------------------------------------------------------------
/VirtualScan/src/main.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include "stdafx.h"
4 |
5 |
6 | void loadGlobalAppState(const std::string& fileNameDescGlobalApp) {
7 | if (!util::fileExists(fileNameDescGlobalApp)) {
8 | throw MLIB_EXCEPTION("cannot find parameter filer " + fileNameDescGlobalApp);
9 | }
10 |
11 | std::cout << VAR_NAME(fileNameDescGlobalApp) << " = " << fileNameDescGlobalApp << std::endl;
12 | ParameterFile parameterFileGlobalApp(fileNameDescGlobalApp);
13 | GlobalAppState::get().readMembers(parameterFileGlobalApp);
14 | GlobalAppState::get().print();
15 | }
16 |
17 | int _tmain(int argc, _TCHAR* argv[])
18 | {
19 | try {
20 | const std::string fileNameDescGlobalApp = "zParametersScan.txt";
21 | loadGlobalAppState(fileNameDescGlobalApp);
22 |
23 | Visualizer callback;
24 | ApplicationWin32 app(NULL, 640, 480, "Virtual Scan", GraphicsDeviceTypeD3D11, callback);
25 | app.messageLoop();
26 | }
27 | catch (const std::exception& e)
28 | {
29 | MessageBoxA(NULL, e.what(), "Exception caught", MB_ICONERROR);
30 | exit(EXIT_FAILURE);
31 | }
32 | catch (...)
33 | {
34 | MessageBoxA(NULL, "UNKNOWN EXCEPTION", "Exception caught", MB_ICONERROR);
35 | exit(EXIT_FAILURE);
36 | }
37 | return 0;
38 | }
39 |
--------------------------------------------------------------------------------
/VirtualScan/src/stdafx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // VirtualScan.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 | #include "mLibSource.cpp"
8 | // TODO: reference any additional headers you need in STDAFX.H
9 | // and not in this file
10 |
--------------------------------------------------------------------------------
/VirtualScan/src/stdafx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 | //
5 |
6 | #pragma once
7 |
8 | #include "targetver.h"
9 |
10 |
11 | #include
12 | #include
13 |
14 | #include "mLibInclude.h"
15 | #include "Scene.h"
16 | #include "Visualizer.h"
17 |
18 | // TODO: reference additional headers your program requires here
19 |
--------------------------------------------------------------------------------
/VirtualScan/src/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/VirtualScan/zParametersScan.txt:
--------------------------------------------------------------------------------
1 |
2 | s_meshFilenames[0] = "./data/dabrovic-sponza/sponza.obj";
3 |
4 | s_imageWidth = 640; // render width
5 | s_imageHeight = 480; // render height
6 | s_cameraFov = 60.0f; // degrees
7 |
8 | //noise model for depth -- TODO implement
9 | s_addNoiseToDepth = false;
10 | s_depthNoiseSigma = 0.01f;
11 |
12 | s_filterDepthMap = true; //bilateral filter depth map
13 | s_depthSigmaD = 5.0f; //bilateral filter sigma domain
14 | s_depthSigmaR = 0.1f; //bilateral filter sigma range
15 |
--------------------------------------------------------------------------------
/cmake.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | pushd .
4 | cd build || { echo "No such directory 'build'"; exit 1; }
5 |
6 | GENERATOR="Unix Makefiles"
7 | #GENERATOR="Eclipse CDT4 - Unix Makefiles"
8 |
9 | #BUILD_TYPE=Debug
10 | BUILD_TYPE=RelWithDebInfo
11 | #BUILD_TYPE=Release
12 |
13 | #OPENCV_VERSION=2.4
14 | OPENCV_VERSION=3.1
15 |
16 | WITH_ZED=False
17 | #WITH_ZED=True
18 |
19 | #CMAKE_SOURCE_DIR=${HOME}/Projects/Quad3DR/
20 | CMAKE_SOURCE_DIR=..
21 |
22 | #CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fno-strict-aliasing -march=native -msse2 -mavx"
23 | # Can't use -Werror=return-type because boost json_parser/standard_callbacks.hpp:132 does not comply
24 | CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -O2 -g3"
25 | #CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -O0 -g -pg"
26 | C_FLAGS="$CXX_FLAGS"
27 |
28 | rm -rf CMakeCache.txt CMakeFiles
29 |
30 | cmake \
31 | -G"$GENERATOR" \
32 | -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
33 | -DCMAKE_C_FLAGS="$C_FLAGS" \
34 | -DUSE_OPENCV_VERSION=$OPENCV_VERSION \
35 | -DWITH_ZED=$WITH_ZED \
36 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
37 | -DBUILD_PLANE_SWEEP_STEREO=OFF \
38 | -DBUILD_STEREO=OFF \
39 | -DBUILD_QUAD_PLANNER=OFF \
40 | -DBUILD_VIDEO=OFF \
41 | -DEIGEN3_INCLUDE_DIR=$HOME/Projects/Libraries/eigen-3.3.1 \
42 | -DBOOST_ROOT=$HOME/Projects/Libraries/boost_1_60_0/ \
43 | -Doctomap_DIR=$HOME/Projects/Libraries/octomap/lib/cmake/octomap \
44 | -Doctovis_DIR=$HOME/Projects/Libraries/octomap/lib/cmake/octovis \
45 | -DCMAKE_PREFIX_PATH=$HOME/Projects/Libraries/ompl \
46 | -DOMPL_PREFIX=$HOME/Projects/Libraries/ompl \
47 | $CMAKE_SOURCE_DIR \
48 | $@
49 |
50 | popd
51 |
52 |
--------------------------------------------------------------------------------
/cmake/CheckC11.cmake:
--------------------------------------------------------------------------------
1 | # Check for C++11/0x support
2 |
3 | if(CMAKE_COMPILER_IS_GNUCXX)
4 | include(CheckCXXCompilerFlag)
5 | CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
6 | CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
7 | if(COMPILER_SUPPORTS_CXX11)
8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
9 | elseif(COMPILER_SUPPORTS_CXX0X)
10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
11 | else()
12 | message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
13 | endif()
14 | endif()
15 |
--------------------------------------------------------------------------------
/cmake/Modules/FindTCLAP.cmake:
--------------------------------------------------------------------------------
1 | # - Try to find TCLAP lib
2 | #
3 | # TCLAP_FOUND - system has TCLAP lib
4 | # TCLAP_INCLUDE_DIR - the TCLAP include directory
5 |
6 | # Copyright (c) 2015, Benjamin Hepp
7 |
8 | macro(_tclap_check_path)
9 |
10 | if(EXISTS "${TCLAP_INCLUDE_DIR}/tclap/CmdLine.h")
11 | set(TCLAP_OK TRUE)
12 | endif()
13 |
14 | if(NOT TCLAP_OK)
15 | message(STATUS "TCLAP include path was specified but no CmdLine.h file was found: ${TCLAP_INCLUDE_DIR}")
16 | endif()
17 |
18 | endmacro()
19 |
20 | if(NOT TCLAP_INCLUDE_DIR)
21 |
22 | find_path(TCLAP_INCLUDE_DIR NAMES tclap/CmdLine.h
23 | PATHS
24 | ${CMAKE_INSTALL_PREFIX}/include
25 | ${KDE4_INCLUDE_DIR}
26 | #PATH_SUFFIXES tclap
27 | )
28 |
29 | endif()
30 |
31 | if(TCLAP_INCLUDE_DIR)
32 | _tclap_check_path()
33 | endif()
34 |
35 | include(FindPackageHandleStandardArgs)
36 | find_package_handle_standard_args(TCLAP DEFAULT_MSG TCLAP_INCLUDE_DIR TCLAP_OK)
37 |
38 | mark_as_advanced(TCLAP_INCLUDE_DIR)
39 |
--------------------------------------------------------------------------------
/cmake_jetson.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | pushd .
4 | cd build_jetson || { echo "No such directory 'build_jetson'"; exit 1; }
5 |
6 | ROS_DIR=/opt/ros/kinetic
7 | DJI_DIR=$HOME/DJI
8 | DJI_CATKIN_DIR=$DJI_DIR/catkin_ws_jetson
9 |
10 | BUILD_TYPE=Release
11 | #BUILD_TYPE=Debug
12 |
13 | rm -r CMakeCache.txt CMakeFiles/
14 | #cmake -DUSE_OPENCV_VERSION=2.4 ..
15 | cmake \
16 | -DBUILD_PLANE_SWEEP_STEREO=OFF \
17 | -DBUILD_QUAD_PLANNER=OFF \
18 | -DBUILD_STEREO=OFF \
19 | -DWITH_ROS=ON \
20 | -DWITH_DJI=ON \
21 | -DROS_INCLUDE_DIRS=$ROS_DIR/include \
22 | -DROS_LIBRARY_DIR=$ROS_DIR/lib \
23 | -DDJI_LIBRARY=$DJI_CATKIN_DIR/devel/lib/libdji_sdk_lib.a \
24 | -DDJI_INCLUDE_DIRS="$DJI_CATKIN_DIR/src/dji_sdk/include;$DJI_CATKIN_DIR/src/dji_sdk_lib/include;$DJI_CATKIN_DIR/devel/include" \
25 | -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF \
26 | -DUSE_OPENCV_VERSION=2.4 \
27 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
28 | .. $@
29 |
30 | popd
31 |
32 |
--------------------------------------------------------------------------------
/external/QGLViewer/.gitignore:
--------------------------------------------------------------------------------
1 | .moc
2 | .obj
3 | *.so
4 | *.so.*
5 | ui_*.h
6 | libQGLViewer.prl
7 |
8 |
9 |
--------------------------------------------------------------------------------
/external/QGLViewer/CHANGELOG:
--------------------------------------------------------------------------------
1 | This is libQGLViewer version 2.6.3. Packaged on July 10, 2015.
2 |
3 | The complete change log is available in doc/changeLog.html
4 |
5 | The latest releases and changeLog are available at:
6 | http://www.libqglviewer.com/changeLog.html
7 |
--------------------------------------------------------------------------------
/external/QGLViewer/INSTALL:
--------------------------------------------------------------------------------
1 |
2 | l i b Q G L V i e w e r I n s t a l l a t i o n
3 |
4 |
5 |
6 | libQGLViewer requires the Qt library, available from Digia.
7 |
8 | In order to compile the library from its sources:
9 |
10 | - On UNIX platforms, simply type (see doc/installUnix.html for details):
11 |
12 | > qmake
13 | > make
14 | > make install [optional]
15 |
16 | - For Windows installation, see doc/installWindows.html.
17 |
18 |
19 |
20 | See doc/compilation.html for details on compiling programs that use libQGLViewer.
21 |
--------------------------------------------------------------------------------
/external/QGLViewer/README:
--------------------------------------------------------------------------------
1 |
2 | l i b Q G L V i e w e r
3 |
4 | Version 2.6.3. Packaged on July 10, 2015
5 |
6 |
7 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved.
8 | http://www.libqglviewer.com
9 | Send e-mail to contact@libqglviewer.com
10 |
11 |
12 | libQGLViewer is a C++ library based on Qt that eases the creation of OpenGL 3D viewers.
13 |
14 | It provides some of the typical 3D viewer functionalities, such as the possibility to
15 | move the camera using the mouse, which lacks in most of the other APIs. Other features
16 | include mouse manipulated frames, interpolated keyFrames, object selection, stereo
17 | display, screenshot saving and much more. It can be used by OpenGL beginners as well as
18 | to create complex applications, being fully customizable and easy to extend.
19 |
20 | Based on the Qt toolkit, it compiles on any architecture (Unix-Linux, Mac, Windows).
21 | Full reference documentation and many examples are provided. libQGLViewer does not
22 | display 3D scenes in various formats, but it can be the base for the coding of such a
23 | viewer.
24 |
25 | libQGLViewer uses dual licensing: it is freely available under the terms of the GNU-GPL
26 | license for open source software development, while commercial applications can apply
27 | for a commercial license.
28 |
29 |
30 | The library's main functionalities are:
31 |
32 | - A camera trackball to intuitively move the camera in the scene.
33 | - Screenshot saving in different file formats (JPG, PNG, EPS...).
34 | - Easy scene object selection and manipulation using the mouse.
35 | - Definition and replay of keyFrame paths.
36 | - Stereo display (provided that your hardware supports it).
37 | - Clean, well-designed and easily extendable API.
38 | - Many examples and a complete reference documentation.
39 |
40 | See the doc/index.html page for details.
41 |
42 |
--------------------------------------------------------------------------------
/external/QGLViewer/VRender/Types.h:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of the VRender library.
3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
4 | Version 1.0.0, released on June 27, 2005.
5 |
6 | http://artis.imag.fr/Members/Cyril.Soler/VRender
7 |
8 | VRender is free software; you can redistribute it and/or modify
9 | it under the terms of the GNU General Public License as published by
10 | the Free Software Foundation; either version 2 of the License, or
11 | (at your option) any later version.
12 |
13 | VRender is distributed in the hope that it will be useful,
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | GNU General Public License for more details.
17 |
18 | You should have received a copy of the GNU General Public License
19 | along with VRender; if not, write to the Free Software Foundation, Inc.,
20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
21 | */
22 |
23 | /****************************************************************************
24 |
25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved.
26 |
27 | This file is part of the QGLViewer library version 2.6.3.
28 |
29 | http://www.libqglviewer.com - contact@libqglviewer.com
30 |
31 | This file may be used under the terms of the GNU General Public License
32 | versions 2.0 or 3.0 as published by the Free Software Foundation and
33 | appearing in the LICENSE file included in the packaging of this file.
34 | In addition, as a special exception, Gilles Debunne gives you certain
35 | additional rights, described in the file GPL_EXCEPTION in this package.
36 |
37 | libQGLViewer uses dual licensing. Commercial/proprietary software must
38 | purchase a libQGLViewer Commercial License.
39 |
40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
42 |
43 | *****************************************************************************/
44 |
45 | #ifndef _VRENDER_TYPES_H
46 | #define _VRENDER_TYPES_H
47 |
48 | #ifdef WIN32
49 | # include
50 | #endif
51 |
52 | #ifdef __APPLE__
53 | # include
54 | #else
55 | # include
56 | #endif
57 |
58 | namespace vrender
59 | {
60 | typedef double FLOAT ;
61 | typedef GLdouble GLFLOAT ;
62 |
63 | #ifdef A_VOIR
64 | typedef T_Vect3 DVector3 ;
65 | typedef T_Vect2 Vector2 ;
66 | #endif
67 |
68 | class Primitive ;
69 | typedef Primitive *PtrPrimitive ;
70 |
71 | const float FLAT_POLYGON_EPS = 1e-5f ;
72 | }
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/external/QGLViewer/qglviewer.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bennihepp/Quad3DR/e86a64617aea4c71060552ef1215fdc35c755aa2/external/QGLViewer/qglviewer.icns
--------------------------------------------------------------------------------
/external/QGLViewer/qglviewer_fr.qm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bennihepp/Quad3DR/e86a64617aea4c71060552ef1215fdc35c755aa2/external/QGLViewer/qglviewer_fr.qm
--------------------------------------------------------------------------------
/external/fastlz/LICENSE:
--------------------------------------------------------------------------------
1 | FastLZ - lightning-fast lossless compression library
2 |
3 | Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
4 | Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
5 | Copyright (C) 2005 Ariya Hidayat (ariya@kde.org)
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 |
25 |
--------------------------------------------------------------------------------
/external/fastlz/README.TXT:
--------------------------------------------------------------------------------
1 | FastLZ - lightning-fast lossless compression library
2 |
3 | Author: Ariya Hidayat
4 | Official website: http://www.fastlz.org
5 |
6 | FastLZ is distributed using the MIT license, see file LICENSE
7 | for details.
8 |
9 | FastLZ consists of two files: fastlz.h and fastlz.c. Just add these
10 | files to your project in order to use FastLZ. For information on
11 | compression and decompression routines, see fastlz.h.
12 |
13 | A simple file compressor called 6pack is included as an example
14 | on how to use FastLZ. The corresponding decompressor is 6unpack.
15 |
16 | To compile using GCC:
17 |
18 | gcc -o 6pack 6pack.c fastlz.c
19 | gcc -o 6unpack 6unpack.c fastlz.c
20 |
21 | To compile using MinGW:
22 |
23 | mingw32-gcc -o 6pack 6pack.c fastlz.c
24 | mingw32-gcc -o 6unpack 6unpack.c fastlz.c
25 |
26 | To compile using Microsoft Visual C++:
27 |
28 | cl 6pack.c fastlz.c
29 | cl 6unpack.c fastlz.c
30 |
31 | To compile using Borland C++:
32 |
33 | bcc32 6pack.c fastlz.c
34 | bcc32 6unpack.c fastlz.c
35 |
36 | To compile using OpenWatcom C/C++:
37 |
38 | cl386 6pack.c fastlz.c
39 | cl386 6unpack.c fastlz.c
40 |
41 | To compile using Intel C++ compiler for Windows:
42 |
43 | icl 6pack.c fastlz.c
44 | icl 6unpack.c fastlz.c
45 |
46 | To compile using Intel C++ compiler for Linux:
47 |
48 | icc -o 6pack 6pack.c fastlz.c
49 | icc -o 6unpack 6unpack.c fastlz.c
50 |
51 | To compile 6pack using LCC-Win32:
52 |
53 | lc 6pack.c fastlz.c
54 | lc 6unpack.c fastlz.c
55 |
56 | To compile 6pack using Pelles C:
57 |
58 | pocc 6pack.c
59 | pocc 6unpack.c
60 | pocc fastlz.c
61 | polink 6pack.obj fastlz.obj
62 | polink 6unpack.obj fastlz.obj
63 |
64 | For speed optimization, always use proper compile flags for optimization options.
65 | Typical compiler flags are given below:
66 |
67 | * GCC (pre 4.2): -march=pentium -O3 -fomit-frame-pointer -mtune=pentium
68 | * GCC 4.2 or later: -march=pentium -O3 -fomit-frame-pointer -mtune=generic
69 | * Digital Mars C/C++: -o+all -5
70 | * Intel C++ (Windows): /O3 /Qipo
71 | * Intel C++ (Linux): -O2 -march=pentium -mtune=pentium
72 | * Borland C++: -O2 -5
73 | * LCC-Win32: -O
74 | * Pelles C: /O2
75 |
76 |
--------------------------------------------------------------------------------
/external/snappy/AUTHORS:
--------------------------------------------------------------------------------
1 | opensource@google.com
2 |
--------------------------------------------------------------------------------
/external/snappy/COPYING:
--------------------------------------------------------------------------------
1 | Copyright 2011, Google Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above
11 | copyright notice, this list of conditions and the following disclaimer
12 | in the documentation and/or other materials provided with the
13 | distribution.
14 | * Neither the name of Google Inc. nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | ===
31 |
32 | Some of the benchmark data in testdata/ is licensed differently:
33 |
34 | - fireworks.jpeg is Copyright 2013 Steinar H. Gunderson, and
35 | is licensed under the Creative Commons Attribution 3.0 license
36 | (CC-BY-3.0). See https://creativecommons.org/licenses/by/3.0/
37 | for more information.
38 |
39 | - kppkn.gtb is taken from the Gaviota chess tablebase set, and
40 | is licensed under the MIT License. See
41 | https://sites.google.com/site/gaviotachessengine/Home/endgame-tablebases-1
42 | for more information.
43 |
44 | - paper-100k.pdf is an excerpt (bytes 92160 to 194560) from the paper
45 | “Combinatorial Modeling of Chromatin Features Quantitatively Predicts DNA
46 | Replication Timing in _Drosophila_” by Federico Comoglio and Renato Paro,
47 | which is licensed under the CC-BY license. See
48 | http://www.ploscompbiol.org/static/license for more ifnormation.
49 |
50 | - alice29.txt, asyoulik.txt, plrabn12.txt and lcet10.txt are from Project
51 | Gutenberg. The first three have expired copyrights and are in the public
52 | domain; the latter does not have expired copyright, but is still in the
53 | public domain according to the license information
54 | (http://www.gutenberg.org/ebooks/53).
55 |
--------------------------------------------------------------------------------
/external/snappy/snappy-stubs-internal.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Redistribution and use in source and binary forms, with or without
4 | // modification, are permitted provided that the following conditions are
5 | // met:
6 | //
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above
10 | // copyright notice, this list of conditions and the following disclaimer
11 | // in the documentation and/or other materials provided with the
12 | // distribution.
13 | // * Neither the name of Google Inc. nor the names of its
14 | // contributors may be used to endorse or promote products derived from
15 | // this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | #include
30 | #include
31 |
32 | #include "snappy-stubs-internal.h"
33 |
34 | namespace snappy {
35 |
36 | void Varint::Append32(string* s, uint32 value) {
37 | char buf[Varint::kMax32];
38 | const char* p = Varint::Encode32(buf, value);
39 | s->append(buf, p - buf);
40 | }
41 |
42 | } // namespace snappy
43 |
--------------------------------------------------------------------------------
/get_octomap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rosservice call /world/get_octomap '{bounding_box_origin: {x: 0, y: 0, z: 0}, bounding_box_lengths: {x: 25.0, y: 25.0, z: 15}, leaf_size: 0.1, filename: gazebo_octomap.bt}'
4 |
5 |
--------------------------------------------------------------------------------
/include/ait/boost.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Jan 18, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #ifndef BOOST_SYSTEM_NO_DEPRECATED
12 | #define BOOST_SYSTEM_NO_DEPRECATED 1
13 | #endif
14 |
--------------------------------------------------------------------------------
/include/ait/boost_serialization_utils.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost_serialization_utils.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Feb 28, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include
12 |
13 | // std::tuple serialization
14 | // by Christopher Allen Ogden (https://github.com/Sydius/serialize-tuple)
15 | // Copyright 2011 Christopher Allen Ogden. All rights reserved.
16 | //
17 | // Redistribution and use in source and binary forms, with or without modification, are
18 | // permitted provided that the following conditions are met:
19 | //
20 | // 1. Redistributions of source code must retain the above copyright notice, this list of
21 | // conditions and the following disclaimer.
22 | //
23 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list
24 | // of conditions and the following disclaimer in the documentation and/or other materials
25 | // provided with the distribution.
26 | //
27 | // THIS SOFTWARE IS PROVIDED BY CHRISTOPHER ALLEN OGDEN ``AS IS'' AND ANY EXPRESS OR IMPLIED
28 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CHRISTOPHER ALLEN OGDEN OR
30 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 | //
37 | // The views and conclusions contained in the software and documentation are those of the
38 | // authors and should not be interpreted as representing official policies, either expressed
39 | // or implied, of Christopher Allen Ogden.
40 |
41 | namespace boost {
42 | namespace serialization {
43 |
44 | template
45 | struct serialize_tuple {
46 | template
47 | static void serialize(Archive& ar, std::tuple& t, const unsigned int version) {
48 | ar & std::get(t);
49 | serialize_tuple::serialize(ar, t, version);
50 | }
51 | };
52 |
53 | template<>
54 | struct serialize_tuple<0> {
55 | template
56 | static void serialize(Archive& ar, std::tuple& t, const unsigned int version) {
57 | }
58 | };
59 |
60 | template
61 | void serialize(Archive& ar, std::tuple& t, const unsigned int version)
62 | {
63 | serialize_tuple::serialize(ar, t, version);
64 | }
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/include/ait/dji/RosDjiDrone.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // DjiRosSubscriber.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Nov 11, 2016
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include
12 |
13 | #include
14 | #include
15 |
16 | namespace ait
17 | {
18 | namespace dji
19 | {
20 |
21 | class RosDjiDrone
22 | {
23 | public:
24 | RosDjiDrone() {
25 | dji_drone_ = new DJIDrone(node_handle_);
26 | }
27 |
28 | ~RosDjiDrone() {
29 | SAFE_DELETE(dji_drone_);
30 | }
31 |
32 | const DJIDrone& getDrone() const {
33 | return *dji_drone_;
34 | }
35 |
36 | DJIDrone& getDrone() {
37 | return *dji_drone_;
38 | }
39 |
40 | DJIDrone& operator()() {
41 | return *dji_drone_;
42 | }
43 |
44 | DJIDrone* operator->() {
45 | return dji_drone_;
46 | }
47 |
48 | private:
49 | ros::NodeHandle node_handle_;
50 | DJIDrone* dji_drone_;
51 | };
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/include/ait/eigen.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // eigen.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 12, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "../bh/eigen.h"
11 | /*
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | namespace Eigen
18 | {
19 | // using Mat4f = Eigen::Matrix;
20 | // using Mat4d = Eigen::Matrix;
21 | // using Mat3f = Eigen::Matrix;
22 | // using Mat3d = Eigen::Matrix;
23 |
24 | using Matrix3x4d = Matrix;
25 | using Matrix3x4f = Matrix;
26 | using Vector2s = Matrix;
27 | using Vector3s = Matrix;
28 | using Vector4s = Matrix;
29 | }
30 |
31 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector2f)
32 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector2d)
33 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3f)
34 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3d)
35 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector4f)
36 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector4d)
37 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix2f)
38 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix2d)
39 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix3f)
40 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix3d)
41 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix4f)
42 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix4d)
43 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix3x4f)
44 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Matrix3x4d)
45 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Quaternionf)
46 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Quaterniond)
47 |
48 | #define EIGEN_ALIGNED_UNORDERED_MAP(Key, T) std::unordered_map, std::equal_to, \
49 | Eigen::aligned_allocator>>;
50 | #define EIGEN_ALIGNED_UNORDERED_MAP2(Key, T, Hash) std::unordered_map, \
51 | Eigen::aligned_allocator>>;
52 | #define EIGEN_ALIGNED_UNORDERED_MAP3(Key, T, Hash, EqualTo) std::unordered_map>>;
54 |
55 | #define USE_FIXED_EIGEN_TYPES(FloatType) \
56 | using Vector2 = Eigen::Matrix; \
57 | using Vector3 = Eigen::Matrix; \
58 | using Vector4 = Eigen::Matrix; \
59 | using Matrix4x4 = Eigen::Matrix; \
60 | using Matrix3x3 = Eigen::Matrix; \
61 | using Matrix3x4 = Eigen::Matrix; \
62 | using Quaternion = Eigen::Quaternion; \
63 | using AngleAxis = Eigen::AngleAxis;
64 | */
65 |
--------------------------------------------------------------------------------
/include/ait/eigen_alignment.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // eigen_alignment.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 8, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "eigen.h"
11 |
--------------------------------------------------------------------------------
/include/ait/eigen_options.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // eigen_options.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Feb 21, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include "eigen.h"
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | namespace boost {
18 |
19 | template
20 | void validate(boost::any& v,
21 | const std::vector& values,
22 | Eigen::Matrix* target_type, int) {
23 | using namespace boost::program_options;
24 |
25 | // Make sure no previous assignment to 'v' was made.
26 | validators::check_first_occurrence(v);
27 |
28 | const std::string& s = validators::get_single_string(values);
29 |
30 | std::vector split_vec;
31 | boost::split(split_vec, s, boost::is_any_of(" ,"), boost::token_compress_on);
32 |
33 | if (split_vec.size() != Rows * Cols) {
34 | boost::throw_exception(validation_error(validation_error::invalid_option_value));
35 | }
36 |
37 | typename Eigen::Matrix matrix;
38 | for (size_t i = 0; i < static_cast(matrix.size()); ++i) {
39 | matrix(i) = boost::lexical_cast(split_vec[i]);
40 | }
41 | v = boost::any(matrix);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/include/ait/eigen_serialization.h:
--------------------------------------------------------------------------------
1 | /*
2 | * eigen_serialization.h
3 | *
4 | * Created on: Jan 2, 2017
5 | * Author: bhepp
6 | */
7 | #pragma once
8 |
9 | #include "../bh/eigen_serialization.h"
10 | /*
11 | #include
12 | #include "eigen.h"
13 |
14 | namespace boost {
15 | //namespace serialization {
16 |
17 | // TODO: These don't work
18 | // template
19 | // inline void serialize(
20 | // Archive& ar,
21 | // Eigen::EigenBase& matrix,
22 | // const unsigned int version
23 | // ) {
24 | // ar & boost::serialization::make_array(matrix.data(), matrix.size());
25 | // }
26 | //
27 | // template
28 | // inline void serialize(
29 | // Archive& ar,
30 | // const Eigen::EigenBase& matrix,
31 | // const unsigned int version
32 | // ) {
33 | // ar & boost::serialization::make_array(matrix.data(), matrix.size());
34 | // }
35 |
36 | // template
37 | // inline void serialize(
38 | // Archive& ar,
39 | // Eigen::QuaternionBase& quat,
40 | // const unsigned int version
41 | // ) {
42 | // ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
43 | // }
44 | //
45 | // template
46 | // inline void serialize(
47 | // Archive& ar,
48 | // const Eigen::QuaternionBase& quat,
49 | // const unsigned int version
50 | // ) {
51 | // ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
52 | // }
53 |
54 | template
55 | inline void serialize(
56 | Archive& ar,
57 | Eigen::Quaternion& quat,
58 | const unsigned int version
59 | ) {
60 | ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
61 | }
62 |
63 | template
64 | inline void serialize(
65 | Archive& ar,
66 | const Eigen::Quaternion& quat,
67 | const unsigned int version
68 | ) {
69 | ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
70 | }
71 |
72 | template
73 | inline void serialize(
74 | Archive & ar,
75 | Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& matrix,
76 | const unsigned int file_version) {
77 | ar & boost::serialization::make_array(matrix.data(), matrix.size());
78 | }
79 |
80 | template
81 | inline void serialize(
82 | Archive & ar,
83 | const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& matrix,
84 | const unsigned int file_version) {
85 | ar & boost::serialization::make_array(matrix.data(), matrix.size());
86 | }
87 |
88 | //}
89 | }
90 | */
91 |
--------------------------------------------------------------------------------
/include/ait/eigen_serialization_plugin.h:
--------------------------------------------------------------------------------
1 | /*
2 | * eigen_serialization_plugin.h
3 | *
4 | * Created on: Jan 2, 2017
5 | * Author: bhepp
6 | */
7 | #pragma once
8 |
9 | friend class boost::serialization::access;
10 | template
11 | void save(Archive & ar, const unsigned int version) const {
12 | derived().eval();
13 | const Index rows = derived().rows(), cols = derived().cols();
14 | ar & rows;
15 | ar & cols;
16 | for (Index j = 0; j < cols; ++j )
17 | for (Index i = 0; i < rows; ++i )
18 | ar & derived().coeff(i, j);
19 | }
20 |
21 | template
22 | void load(Archive & ar, const unsigned int version) {
23 | Index rows, cols;
24 | ar & rows;
25 | ar & cols;
26 | if (rows != derived().rows() || cols != derived().cols() )
27 | derived().resize(rows, cols);
28 | ar & boost::serialization::make_array(derived().data(), derived().size());
29 | }
30 |
31 | template
32 | void serialize(Archive & ar, const unsigned int file_version) {
33 | boost::serialization::split_member(ar, *this, file_version);
34 | }
35 |
--------------------------------------------------------------------------------
/include/ait/eigen_utils.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // eigen_utils.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Sep 14, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "../bh/eigen_utils.h"
11 |
--------------------------------------------------------------------------------
/include/ait/eigen_with_serialization.h:
--------------------------------------------------------------------------------
1 | /*
2 | * eigen_serialization.h
3 | *
4 | * Created on: Jan 2, 2017
5 | * Author: bhepp
6 | */
7 | #pragma once
8 |
9 | #include
10 | #define EIGEN_DENSEBASE_PLUGIN "eigen_serialization_plugin.h"
11 | #include "eigen.h"
12 |
--------------------------------------------------------------------------------
/include/ait/filesystem.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost_utilities.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 9, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "boost.h"
11 | #include
12 |
13 | namespace ait {
14 |
15 | ////////////////////////
16 | // File system utilities
17 | ////////////////////////
18 |
19 | template
20 | std::string joinPaths(T const&... paths) {
21 | boost::filesystem::path result;
22 | bool _[]{false, (result /= boost::filesystem::path(paths), false)...};
23 | static_cast(_);
24 | return result.string();
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/include/ait/mLib.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // mLibInclude.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Sep 14, 2016
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #if _WIN32
12 | #define NOMINMAX
13 | #include
14 | #include
15 | #include
16 | #endif
17 |
18 | //
19 | // mLib config options
20 | //
21 |
22 | #define MLIB_ERROR_CHECK
23 | #define MLIB_BOUNDS_CHECK
24 | #define MLIB_SOCKETS
25 |
26 | //
27 | // mLib includes
28 | //
29 |
30 | #include "mLibCore.h"
31 | #include "mLibFreeImage.h"
32 | #include "mLibDepthCamera.h"
33 | //#include "mLibLodePNG.h"
34 | //#include "mLibD3D11.h"
35 |
36 | //#include "mLibEigen.h"
37 |
38 | //move this to mlib (it's currently local)
39 | //#include "mLibCuda.h"
40 |
--------------------------------------------------------------------------------
/include/ait/mLibZlib.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // mLibZlib.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 4, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "mLib.h"
11 |
12 | #include "mLibZLib.h"
13 |
--------------------------------------------------------------------------------
/include/ait/math.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // math.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Nov 8, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include
11 | #include
12 | #include "eigen.h"
13 |
14 | namespace ait {
15 |
16 | using Mat4f = Eigen::Matrix;
17 | using Mat4d = Eigen::Matrix;
18 | using Mat3f = Eigen::Matrix;
19 | using Mat3d = Eigen::Matrix;
20 |
21 | template
22 | FloatType degreeToRadians(const FloatType degrees) {
23 | const FloatType pi = (FloatType)M_PI;
24 | return degrees * pi / 180;
25 | }
26 |
27 | template
28 | FloatType radiansToDegrees(const FloatType radians) {
29 | const FloatType pi = (FloatType)M_PI;
30 | return radians * 180 / pi;
31 | }
32 |
33 | template
34 | bool isApproxEqual(FloatType1 a, FloatType2 b, FloatType3 tolerance) {
35 | return std::abs(a - b) <= tolerance;
36 | }
37 |
38 | template
39 | bool isApproxGreater(FloatType1 a, FloatType2 b, FloatType3 tolerance) {
40 | return a > b + tolerance;
41 | }
42 |
43 | template
44 | bool isApproxGreaterEqual(FloatType1 a, FloatType2 b, FloatType3 tolerance) {
45 | return a >= b + tolerance;
46 | }
47 |
48 | template
49 | bool isApproxSmaller(FloatType1 a, FloatType2 b, FloatType3 tolerance) {
50 | return a < b - tolerance;
51 | }
52 |
53 | template
54 | bool isApproxSmallerEqual(FloatType1 a, FloatType2 b, FloatType3 tolerance) {
55 | return a <= b - tolerance;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/include/ait/math/statistics.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // statistics.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Nov 8, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include
11 | #include
12 | #include
13 | #include "eigen.h"
14 |
15 | namespace ait {
16 |
17 | template
18 | class Histogram {
19 | public:
20 | using ValueType = ValueT;
21 | using CountType = CountT;
22 |
23 | // bin_edges_ contains the left and right edges of all bins.
24 | // i.e. if there are 2 bins, [0, 1) and [1, 2) bins_edges_ = { 0, 1, 2 }.
25 |
26 | Histogram(const size_t num_bins, const ValueT min, const ValueT max) {
27 | for (size_t i = 0; i <= num_bins; ++i) {
28 | const ValueT edge = min + i * (max - min) / num_bins;
29 | bin_edges_.push_back(edge);
30 | }
31 | counts_.resize(bin_edges_.size() - 1, 0);
32 | }
33 |
34 | template
35 | Histogram(const Iterator first, const Iterator last) {
36 | for (Iterator it = first; it != last; ++it) {
37 | bin_edges_.push_back(*it);
38 | }
39 | counts_.resize(bin_edges_.size() - 1, 0);
40 | }
41 |
42 | size_t numBins() const {
43 | return counts_.size();
44 | }
45 |
46 | CountType operator()(const size_t bin) const {
47 | return counts_[bin];
48 | }
49 |
50 | CountType totalCount() const {
51 | const CountT total_count = std::accumulate(counts_.begin(), counts_.end());
52 | return total_count;
53 | }
54 |
55 | ValueT leftBinEdge(const size_t bin) const {
56 | return bin_edges_[bin];
57 | }
58 |
59 | ValueT leftBinEdge(const size_t bin) const {
60 | return bin_edges_[bin + 1];
61 | }
62 |
63 | template
64 | void accumulate(const ValueIterator first, const ValueIterator last) {
65 | for (ValueIterator it = first; it != last; ++it) {
66 | // find bin
67 | const size_t bin = 0;
68 | ++counts_[bin];
69 | }
70 | }
71 |
72 | template ::value>>
73 | void normalize() {
74 | const CountT total_count = totalCount();
75 | std::for_each(counts_.begin(), counts_.end(), [] (CountT& count) {
76 | count /= total_count;
77 | });
78 | }
79 |
80 | private:
81 | std::vector bin_edges_;
82 | std::vector counts_;
83 | };
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/include/ait/nn/approximate_nearest_neighbor.h:
--------------------------------------------------------------------------------
1 | /*
2 | * approximate_nearest_neighbor.h
3 | *
4 | * Created on: Dec 29, 2016
5 | * Author: bhepp
6 | */
7 | #pragma once
8 |
9 | #include "../../bh/nn/approximate_nearest_neighbor.h"
10 |
--------------------------------------------------------------------------------
/include/ait/qt_utils.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // qt_utils.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Jan 18, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include
12 | #include
13 |
14 | std::ostream& operator<<(std::ostream& out, const QVector3D& vec);
15 |
16 | std::ostream& operator<<(std::ostream& out, const QMatrix4x4& mat);
17 |
18 | inline std::ostream& operator<<(std::ostream& out, const QVector3D& vec) {
19 | out << "(" << vec.x() << ", " << vec.y() << ", " << vec.z() << ")";
20 | return out;
21 | }
22 |
23 | inline std::ostream& operator<<(std::ostream& out, const QMatrix4x4& mat) {
24 | for (int i = 0; i < 4; ++i) {
25 | for (int j = 0; j < 4; ++j) {
26 | if (j > 0)
27 | std::cout << ", ";
28 | std::cout << mat(i, j);
29 | }
30 | std::cout << std::endl;
31 | }
32 | std::cout << std::endl;
33 | return out;
34 | }
35 |
--------------------------------------------------------------------------------
/include/ait/vision_utilities.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // vision_utilities.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 12, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "eigen.h"
11 |
12 | namespace ait {
13 |
14 | // -------------------
15 | // Camera utilities
16 | //--------------------
17 |
18 | /// Scale 3x3 intrinsics matrix
19 | template ::type = false>
20 | typename Derived::PlainObject getScaledIntrinsics(const Eigen::MatrixBase& intrinsics, typename Derived::Scalar scale_factor) {
21 | EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived);
22 | EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime == Derived::ColsAtCompileTime, INTRINSICS_MATRIX_MUST_BE_SQUARE);
23 | typename Derived::PlainObject image_transform = Derived::PlainObject::Identity();
24 | image_transform(0, 0) = scale_factor;
25 | image_transform(1, 1) = scale_factor;
26 | image_transform(0, 2) = scale_factor * 0.5 - 0.5;
27 | image_transform(1, 2) = scale_factor * 0.5 - 0.5;
28 | typename Derived::PlainObject scaled_intrinsics = image_transform * intrinsics;
29 | return scaled_intrinsics;
30 | }
31 |
32 | /// Scale 4x4 intrinsics matrix
33 | template ::type = false>
34 | typename Derived::PlainObject getScaledIntrinsics(const Eigen::DenseBase& intrinsics, typename Derived::Scalar scale_factor) {
35 | EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived);
36 | EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime == Derived::ColsAtCompileTime, INTRINSICS_MATRIX_MUST_BE_SQUARE);
37 | typename Derived::PlainObject scaled_intrinsics = Derived::PlainObject::Identity();
38 | scaled_intrinsics.template topLeftCorner<3, 3>() = getScaledIntrinsics(intrinsics.template topLeftCorner<3, 3>(), scale_factor);
39 | return scaled_intrinsics;
40 | }
41 |
42 | //template
43 | //Eigen::Vector2d projectPointIntoImage(const Eigen::MatrixBase& hom_point_camera, const Eigen::MatrixBase& intrinsics) const {
44 | // EIGEN_STATIC_ASSERT(Derived1::RowsAtCompileTime == 3, CAMERA_POINT_MUST_HAVE_3_ROWS);
45 | // Eigen::Matrix point_camera(hom_point_camera.hnormalized());
46 | // Eigen::Matrix point_image;
47 | // point_image(0) = intrinsics(0, 0) * point_camera(0) + intrinsics(0, 2);
48 | // point_image(1) = intrinsics(1, 1) * point_camera(1) + intrinsics(1, 2);
49 | // return point_image;
50 | //}
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/include/bh/boost.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Jan 18, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #ifndef BOOST_SYSTEM_NO_DEPRECATED
12 | #define BOOST_SYSTEM_NO_DEPRECATED 1
13 | #endif
14 |
--------------------------------------------------------------------------------
/include/bh/boost_serialization_utils.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost_serialization_utils.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Feb 28, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include
12 |
13 | // std::tuple serialization
14 | // by Christopher Allen Ogden (https://github.com/Sydius/serialize-tuple)
15 | // Copyright 2011 Christopher Allen Ogden. All rights reserved.
16 | //
17 | // Redistribution and use in source and binary forms, with or without modification, are
18 | // permitted provided that the following conditions are met:
19 | //
20 | // 1. Redistributions of source code must retain the above copyright notice, this list of
21 | // conditions and the following disclaimer.
22 | //
23 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list
24 | // of conditions and the following disclaimer in the documentation and/or other materials
25 | // provided with the distribution.
26 | //
27 | // THIS SOFTWARE IS PROVIDED BY CHRISTOPHER ALLEN OGDEN ``AS IS'' AND ANY EXPRESS OR IMPLIED
28 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CHRISTOPHER ALLEN OGDEN OR
30 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 | //
37 | // The views and conclusions contained in the software and documentation are those of the
38 | // authors and should not be interpreted as representing official policies, either expressed
39 | // or implied, of Christopher Allen Ogden.
40 |
41 | namespace boost {
42 | namespace serialization {
43 |
44 | template
45 | struct serialize_tuple {
46 | template
47 | static void serialize(Archive& ar, std::tuple& t, const unsigned int version) {
48 | ar & std::get(t);
49 | serialize_tuple::serialize(ar, t, version);
50 | }
51 | };
52 |
53 | template<>
54 | struct serialize_tuple<0> {
55 | template
56 | static void serialize(Archive& ar, std::tuple& t, const unsigned int version) {
57 | }
58 | };
59 |
60 | template
61 | void serialize(Archive& ar, std::tuple& t, const unsigned int version)
62 | {
63 | serialize_tuple::serialize(ar, t, version);
64 | }
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/include/bh/eigen_options.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // eigen_options.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Feb 21, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include "eigen.h"
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | namespace boost {
18 |
19 | template
20 | void validate(boost::any& v,
21 | const std::vector& values,
22 | Eigen::Matrix* target_type, int) {
23 | using namespace boost::program_options;
24 |
25 | // Make sure no previous assignment to 'v' was made.
26 | validators::check_first_occurrence(v);
27 |
28 | const std::string& s = validators::get_single_string(values);
29 |
30 | std::vector split_vec;
31 | boost::split(split_vec, s, boost::is_any_of(" ,"), boost::token_compress_on);
32 |
33 | if (split_vec.size() != Rows * Cols) {
34 | boost::throw_exception(validation_error(validation_error::invalid_option_value));
35 | }
36 |
37 | typename Eigen::Matrix matrix;
38 | for (size_t i = 0; i < static_cast(matrix.size()); ++i) {
39 | matrix(i) = boost::lexical_cast(split_vec[i]);
40 | }
41 | v = boost::any(matrix);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/include/bh/eigen_serialization.h:
--------------------------------------------------------------------------------
1 | /*
2 | * eigen_serialization.h
3 | *
4 | * Created on: Jan 2, 2017
5 | * Author: bhepp
6 | */
7 | #pragma once
8 |
9 | #include
10 | #include "eigen.h"
11 |
12 | namespace boost {
13 | //namespace serialization {
14 |
15 | // TODO: These don't work
16 | // template
17 | // inline void serialize(
18 | // Archive& ar,
19 | // Eigen::EigenBase& matrix,
20 | // const unsigned int version
21 | // ) {
22 | // ar & boost::serialization::make_array(matrix.data(), matrix.size());
23 | // }
24 | //
25 | // template
26 | // inline void serialize(
27 | // Archive& ar,
28 | // const Eigen::EigenBase& matrix,
29 | // const unsigned int version
30 | // ) {
31 | // ar & boost::serialization::make_array(matrix.data(), matrix.size());
32 | // }
33 |
34 | // template
35 | // inline void serialize(
36 | // Archive& ar,
37 | // Eigen::QuaternionBase& quat,
38 | // const unsigned int version
39 | // ) {
40 | // ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
41 | // }
42 | //
43 | // template
44 | // inline void serialize(
45 | // Archive& ar,
46 | // const Eigen::QuaternionBase& quat,
47 | // const unsigned int version
48 | // ) {
49 | // ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
50 | // }
51 |
52 | template
53 | inline void serialize(
54 | Archive& ar,
55 | Eigen::Quaternion& quat,
56 | const unsigned int version
57 | ) {
58 | ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
59 | }
60 |
61 | template
62 | inline void serialize(
63 | Archive& ar,
64 | const Eigen::Quaternion& quat,
65 | const unsigned int version
66 | ) {
67 | ar & boost::serialization::make_array(quat.coeffs().data(), quat.coeffs().size());
68 | }
69 |
70 | template
71 | inline void serialize(
72 | Archive & ar,
73 | Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& matrix,
74 | const unsigned int file_version) {
75 | ar & boost::serialization::make_array(matrix.data(), matrix.size());
76 | }
77 |
78 | template
79 | inline void serialize(
80 | Archive & ar,
81 | const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& matrix,
82 | const unsigned int file_version) {
83 | ar & boost::serialization::make_array(matrix.data(), matrix.size());
84 | }
85 |
86 | //}
87 | }
88 |
--------------------------------------------------------------------------------
/include/bh/filesystem.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // boost_utilities.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 9, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "boost.h"
11 | #include
12 |
13 | namespace bh {
14 |
15 | namespace boostfs = boost::filesystem;
16 |
17 | ////////////////////////
18 | // File system utilities
19 | ////////////////////////
20 |
21 | template
22 | std::string joinPaths(T const&... paths) {
23 | boostfs::path result;
24 | bool _[]{false, (result /= boostfs::path(paths), false)...};
25 | static_cast(_);
26 | return result.string();
27 | }
28 |
29 | //
30 | // Thanks to http://stackoverflow.com/questions/10167382/boostfilesystem-get-relative-path.
31 | //
32 | inline boostfs::path pathRelativeTo(const boostfs::path& from, const boostfs::path& to, const bool make_absolute = true) {
33 | if (make_absolute) {
34 | const boostfs::path abs_from = boostfs::absolute(from);
35 | const boostfs::path abs_to = boostfs::absolute(to);
36 | return pathRelativeTo(abs_from, abs_to, false);
37 | }
38 |
39 | // Start at the root path and while they are the same then do nothing then when they first
40 | // diverge take the remainder of the two path and replace the entire from path with ".."
41 | // segments.
42 | boostfs::path::const_iterator from_iter = from.begin();
43 | boostfs::path::const_iterator to_iter = to.begin();
44 |
45 | // Loop through both while same
46 | while (from_iter != from.end() && to_iter != to.end() && (*to_iter) == (*from_iter)) {
47 | ++to_iter;
48 | ++from_iter;
49 | }
50 |
51 | boostfs::path final_path;
52 | while (from_iter != from.end()) {
53 | final_path /= "..";
54 | ++from_iter;
55 | }
56 |
57 | while (to_iter != to.end()) {
58 | final_path /= *to_iter;
59 | ++to_iter;
60 | }
61 |
62 | return final_path;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/include/bh/gperf.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // gperf.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: 21.03.17
7 | //
8 |
9 | #pragma once
10 |
11 | #if BH_WITH_PROFILING
12 | #include
13 | #endif
14 |
15 | namespace bh {
16 |
17 | inline void ProfilerStart(const std::string &filename) {
18 | #if BH_WITH_PROFILING
19 | ::ProfilerStart(filename.c_str());
20 | #endif
21 | }
22 |
23 | inline void ProfilerStop() {
24 | #if BH_WITH_PROFILING
25 | ::ProfilerStop();
26 | #endif
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/include/bh/mLib/mLib.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // mLibInclude.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Sep 14, 2016
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #if _WIN32
12 | #define NOMINMAX
13 | #include
14 | #include
15 | #include
16 | #endif
17 |
18 | //
19 | // mLib config options
20 | //
21 |
22 | #define MLIB_ERROR_CHECK
23 | #define MLIB_BOUNDS_CHECK
24 | #define MLIB_SOCKETS
25 |
26 | //
27 | // mLib includes
28 | //
29 |
30 | #include "mLibCore.h"
31 | #include "mLibFreeImage.h"
32 | #include "mLibDepthCamera.h"
33 | //#include "mLibLodePNG.h"
34 | //#include "mLibD3D11.h"
35 |
36 | //#include "mLibEigen.h"
37 |
38 | //move this to mlib (it's currently local)
39 | //#include "mLibCuda.h"
40 |
--------------------------------------------------------------------------------
/include/bh/mLib/mLibZlib.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // mLibZlib.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Dec 4, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include "mLib.h"
11 |
12 | #include "mLibZLib.h"
13 |
--------------------------------------------------------------------------------
/include/bh/math/histogram.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // histogram.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: 08.05.17
7 | //==================================================
8 | #pragma once
9 |
10 | #include
11 |
12 | namespace bh {
13 |
14 | template
15 | std::vector computeHistogram(const Iterator first, const Iterator last,
16 | const BinIterator first_bin, const BinIterator last_bin);
17 |
18 | /// Computes a histogram of values in range [first, last).
19 | /// The bins are given by the range [first_bin, last_bin), i.e. the first bin is [*first_bin, *(first_bin + 1)).
20 | /// Condition: last_bin - first_bin >= 2.
21 | /// Values below *first_bin are ignored.
22 | template
23 | std::vector computeHistogram(const Iterator first, const Iterator last,
24 | const BinIterator first_bin, const BinIterator last_bin) {
25 | BH_ASSERT(last_bin - first_bin >= 2);
26 | std::vector histogram(last_bin - first_bin, 0);
27 | for (Iterator it = first; it < last; ++it) {
28 | BinIterator it_bin = std::upper_bound(first_bin, last_bin, *it);
29 | if (it_bin != first_bin) {
30 | --it_bin;
31 | const N bin_index = it_bin - first_bin;
32 | ++histogram[bin_index];
33 | }
34 | }
35 | return histogram;
36 | };
37 |
38 | }
--------------------------------------------------------------------------------
/include/bh/math/utilities.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // utilities.h
3 | //
4 | // Copyright (c) 2016 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Nov 8, 2016
7 | //==================================================
8 | #pragma once
9 |
10 | #include
11 | #include
12 |
13 | namespace bh {
14 |
15 | template
16 | FloatT degreeToRadians(const FloatT degrees) {
17 | const FloatT pi = (FloatT)M_PI;
18 | return degrees * pi / 180;
19 | }
20 |
21 | template
22 | FloatT radiansToDegrees(const FloatT radians) {
23 | const FloatT pi = (FloatT)M_PI;
24 | return radians * 180 / pi;
25 | }
26 |
27 | template
28 | FloatT wrapRadiansTo0And2Pi(const FloatT angle) {
29 | const FloatT two_pi = 2 * FloatT(M_PI);
30 | const FloatT wrapped_angle = angle - two_pi * std::floor(angle / two_pi);
31 | return wrapped_angle;
32 | }
33 |
34 | template
35 | FloatT wrapDegreesTo0And360(const FloatT angle) {
36 | const FloatT wrapped_angle = angle - 360 * std::floor(angle / 360);
37 | return wrapped_angle;
38 | }
39 |
40 | template
41 | FloatT wrapRadiansToMinusPiAndPi(const FloatT angle) {
42 | const FloatT angle_0_two_pi = wrapRadiansTo0And2Pi(angle);
43 | if (angle_0_two_pi >= FloatT(M_PI)) {
44 | return angle_0_two_pi - 2 * FloatT(M_PI);
45 | }
46 | return angle_0_two_pi;
47 | }
48 |
49 | template
50 | FloatT wrapDegreesToMinus180And180(const FloatT angle) {
51 | const FloatT angle_0_360 = wrapDegreesTo0And360(angle);
52 | if (angle_0_360 >= 180) {
53 | return angle_0_360 - 360;
54 | }
55 | return angle_0_360;
56 | }
57 |
58 | template
59 | bool isApproxEqual(const FloatT1 a, const FloatT2 b,
60 | const FloatT1 tolerance = std::numeric_limits::epsilon()) {
61 | return std::abs(a - b) <= tolerance;
62 | }
63 |
64 | template
65 | bool isApproxGreater(const FloatT1 a, const FloatT2 b,
66 | const FloatT1 tolerance = std::numeric_limits::epsilon()) {
67 | return a > b + tolerance;
68 | }
69 |
70 | template
71 | bool isApproxGreaterEqual(const FloatT1 a, const FloatT2 b,
72 | const FloatT1 tolerance = std::numeric_limits::epsilon()) {
73 | return a >= b + tolerance;
74 | }
75 |
76 | template
77 | bool isApproxSmaller(const FloatT1 a, const FloatT2 b,
78 | const FloatT1 tolerance = std::numeric_limits::epsilon()) {
79 | return a < b - tolerance;
80 | }
81 |
82 | template
83 | bool isApproxSmallerEqual(const FloatT1 a, const FloatT2 b,
84 | const FloatT1 tolerance = std::numeric_limits::epsilon()) {
85 | return a <= b - tolerance;
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/include/bh/opencv/matrix.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // matrix.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: 06.04.17
7 | //==================================================
8 | #pragma once
9 |
10 | #include "../common.h"
11 | #include "../eigen.h"
12 | #include
13 |
14 | namespace bh {
15 | namespace opencv {
16 |
17 | template
18 | EigenType convertCvToEigen(const cv::Mat& cv_mat) {
19 | EigenType eigen_mat(cv_mat.rows, cv_mat.cols);
20 | if (cv_mat.type() == CV_32F) {
21 | for (size_t row = 0; row < (size_t) cv_mat.rows; ++row) {
22 | for (size_t col = 0; col < (size_t) cv_mat.cols; ++col) {
23 | eigen_mat(row, col) = cv_mat.at(row, col);
24 | }
25 | }
26 | }
27 | else if (cv_mat.type() == CV_64F) {
28 | for (size_t row = 0; row < (size_t) cv_mat.rows; ++row) {
29 | for (size_t col = 0; col < (size_t) cv_mat.cols; ++col) {
30 | eigen_mat(row, col) = cv_mat.at(row, col);
31 | }
32 | }
33 | }
34 | else {
35 | throw bh::Error("OpenCV to Eigen conversion only supports floating types");
36 | }
37 | return eigen_mat;
38 | }
39 |
40 | template
41 | cv::Mat convertEigenToCv32F(const Derived& eigen_mat) {
42 | cv::Mat cv_mat(eigen_mat.rows(), eigen_mat.cols(), CV_32F);
43 | for (size_t row = 0; row < (size_t) eigen_mat.rows(); ++row) {
44 | for (size_t col = 0; col < (size_t) eigen_mat.cols(); ++col) {
45 | cv_mat.at(row, col) = eigen_mat(row, col);
46 | }
47 | }
48 | return cv_mat;
49 | }
50 |
51 | template
52 | cv::Mat convertEigenToCv64F(const Derived& eigen_mat) {
53 | cv::Mat cv_mat(eigen_mat.rows(), eigen_mat.cols(), CV_64F);
54 | for (size_t row = 0; row < (size_t) eigen_mat.rows(); ++row) {
55 | for (size_t col = 0; col < (size_t) eigen_mat.cols(); ++col) {
56 | cv_mat.at(row, col) = eigen_mat(row, col);
57 | }
58 | }
59 | return cv_mat;
60 | }
61 |
62 | }
63 | }
--------------------------------------------------------------------------------
/include/bh/qt/utils.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // qt_utils.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: Jan 18, 2017
7 | //==================================================
8 |
9 | #pragma once
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | std::ostream& operator<<(std::ostream& out, const QSize& size);
19 |
20 | std::ostream& operator<<(std::ostream& out, const QVector3D& vec);
21 |
22 | std::ostream& operator<<(std::ostream& out, const QMatrix4x4& mat);
23 |
24 | inline std::ostream& operator<<(std::ostream& out, const QSize& size) {
25 | out << "(" << size.width() << ", " << size.height() << ")";
26 | return out;
27 | }
28 |
29 | inline std::ostream& operator<<(std::ostream& out, const QVector3D& vec) {
30 | out << "(" << vec.x() << ", " << vec.y() << ", " << vec.z() << ")";
31 | return out;
32 | }
33 |
34 | inline std::ostream& operator<<(std::ostream& out, const QMatrix4x4& mat) {
35 | for (int i = 0; i < 4; ++i) {
36 | for (int j = 0; j < 4; ++j) {
37 | if (j > 0)
38 | std::cout << ", ";
39 | std::cout << mat(i, j);
40 | }
41 | std::cout << std::endl;
42 | }
43 | std::cout << std::endl;
44 | return out;
45 | }
46 |
47 | namespace bh {
48 | namespace qt {
49 |
50 | template
51 | bh::Color3 color3FromQt(const QColor &color_qt);
52 |
53 | template
54 | bh::Color4 colorFromQt(const QColor &color_qt);
55 |
56 | template
57 | QColor colorToQt(const bh::Color3 &color);
58 |
59 | template
60 | QColor colorToQt(const bh::Color4 &color);
61 |
62 | template
63 | bh::Color3 color3FromQt(const QColor &color_qt) {
64 | return bh::Color3(color_qt.redF(), color_qt.greenF(), color_qt.blueF());
65 | }
66 |
67 | template
68 | bh::Color4 colorFromQt(const QColor &color_qt) {
69 | return bh::Color4(color_qt.redF(), color_qt.greenF(), color_qt.blueF(), color_qt.alphaF());
70 | }
71 |
72 | template
73 | QColor colorToQt(const bh::Color3 &color) {
74 | return QColor::fromRgbF(color.r(), color.g(), color.b(), 1);
75 | }
76 |
77 | template
78 | QColor colorToQt(const bh::Color4 &color) {
79 | return QColor::fromRgbF(color.r(), color.g(), color.b(), color.a());
80 | }
81 |
82 | inline void setImageAlphaPremultiplied(QImage* image, const qreal alpha) {
83 | for (int y = 0; y < image->height(); ++y) {
84 | for (int x = 0; x < image->width(); ++x) {
85 | QRgb pixel_rgb = qUnpremultiply(image->pixel(x, y));
86 | QColor pixel_color(pixel_rgb);
87 | pixel_color.setAlphaF(alpha);
88 | QRgb new_pixel_color = qPremultiply(pixel_color.rgba());
89 | image->setPixel(x, y, new_pixel_color);
90 | }
91 | }
92 | }
93 |
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/include/bh/vision/types.h:
--------------------------------------------------------------------------------
1 | //==================================================
2 | // types.h
3 | //
4 | // Copyright (c) 2017 Benjamin Hepp.
5 | // Author: Benjamin Hepp
6 | // Created on: 05.04.17
7 | //==================================================
8 | #pragma once
9 |
10 | #include
11 |
12 | namespace bh {
13 | namespace vision {
14 |
15 | template
16 | class Keypoint {
17 | public:
18 | Keypoint();
19 |
20 | Keypoint(const FloatT x, const FloatT y, const FloatT scale, const FloatT orientation);
21 |
22 | Keypoint(const Keypoint& other) = default;
23 |
24 | FloatT x() const { return x_; }
25 |
26 | FloatT y() const { return y_; }
27 |
28 | FloatT scale() const { return scale_; }
29 |
30 | FloatT orientation() const { return orientation_; }
31 |
32 | private:
33 | FloatT x_;
34 | FloatT y_;
35 | FloatT scale_;
36 | FloatT orientation_;
37 | };
38 |
39 | template
40 | class KeypointMatch {
41 | public:
42 | KeypointMatch(const Keypoint& keypoint1, const Keypoint& keypoint2);
43 |
44 | KeypointMatch(const KeypointMatch& keypoint_match) = default;
45 |
46 | const Keypoint& keypoint1() const { return keypoint1_; }
47 |
48 | const Keypoint& keypoint2() const { return keypoint2_; }
49 |
50 | private:
51 | Keypoint keypoint1_;
52 | Keypoint keypoint2_;
53 | };
54 |
55 |
56 | using Keypointf = Keypoint;
57 | using Keypointd = Keypoint;
58 |
59 | template
60 | Keypoint::Keypoint()
61 | : x_(std::numeric_limits::quiet_NaN()),
62 | y_(std::numeric_limits::quiet_NaN()),
63 | scale_(std::numeric_limits::quiet_NaN()),
64 | orientation_(std::numeric_limits::quiet_NaN()) {}
65 |
66 | template
67 | Keypoint::Keypoint(const FloatT x, const FloatT y, const FloatT scale, const FloatT orientation)
68 | : x_(x), y_(y), scale_(scale), orientation_(orientation) {}
69 |
70 | template
71 | KeypointMatch::KeypointMatch(const Keypoint& keypoint1, const Keypoint& keypoint2)
72 | : keypoint1_(keypoint1), keypoint2_(keypoint2) {}
73 |
74 | }
75 | }
--------------------------------------------------------------------------------
/make_jetson.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | pushd .
4 | cd build_jetson || { echo "No such directory 'build_jetson"; exit 1; }
5 |
6 | make -j4 video_streamer_bundlefusion_drone
7 |
8 | popd
9 |
10 |
--------------------------------------------------------------------------------
/plane_sweep_stereo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(
2 | include/
3 | ${PLANESWEEPLIB_INCLUDE_DIRS}
4 | )
5 |
6 | add_executable(plane_sweep_test
7 | src/plane_sweep_test.cpp
8 | ../stereo/src/stereo_calibration.cpp
9 | ../src/utilities.cpp
10 | )
11 | target_link_libraries(plane_sweep_test
12 | ${Boost_LIBRARIES}
13 | ${OpenCV_LIBRARIES}
14 | ${PLANESWEEPLIB_LIBRARIES}
15 | )
16 |
17 | add_executable(plane_sweep_zed
18 | src/plane_sweep_zed.cpp
19 | ../stereo/src/stereo_calibration.cpp
20 | ../src/utilities.cpp
21 | ../video/src/video_source.cpp
22 | ../video/src/video_source_zed.cpp
23 | )
24 | target_link_libraries(plane_sweep_zed
25 | ${Boost_LIBRARIES}
26 | ${OpenCV_LIBRARIES}
27 | ${PLANESWEEPLIB_LIBRARIES}
28 | ${ZED_LIBRARIES}
29 | ${CUDA_CUDA_LIBRARY} ${CUDA_CUDART_LIBRARY} ${CUDA_npp_LIBRARY}
30 | )
31 |
32 | add_executable(plane_sweep_test_orig
33 | src/plane_sweep_test_orig.cpp
34 | )
35 | target_link_libraries(plane_sweep_test_orig
36 | ${Boost_LIBRARIES}
37 | ${OpenCV_LIBRARIES}
38 | ${PLANESWEEPLIB_LIBRARIES}
39 | )
40 |
--------------------------------------------------------------------------------
/quad_flight/cfg/PositionController.cfg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | PACKAGE = "quad_flight"
4 |
5 | from dynamic_reconfigure.parameter_generator_catkin import *
6 |
7 | gen = ParameterGenerator()
8 |
9 | gen.add("gain_position_p", double_t, 0, "Proportional position gain", 2.0, 0.0, 10.0)
10 | gen.add("gain_orientation_p", double_t, 0, "Proportional orientation gain", 2.0, 0.0, 10.0)
11 | gen.add("gain_position_i", double_t, 0, "Integral position gain", 0.002, 0.0, 10.0)
12 | gen.add("gain_orientation_i", double_t, 0, "Integral orientation gain", 0.002, 0.0, 10.0)
13 | gen.add("position_error_integral_lim", double_t, 0, "Integral limit for position", 2.0, 0.0, 10.0)
14 | gen.add("orientation_error_integral_lim", double_t, 0, "Integral limit for position", 2.0, 0.0, 10.0)
15 |
16 | exit(gen.generate(PACKAGE, "quad_flight", "PositionController"))
17 |
18 |
--------------------------------------------------------------------------------
/quad_flight/config/gimbal_control.yaml:
--------------------------------------------------------------------------------
1 | quadrotor:
2 | # Publish all joint states -----------------------------------
3 | joint_state_controller:
4 | type: joint_state_controller/JointStateController
5 | publish_rate: 50
6 |
7 | # Position Controllers ---------------------------------------
8 | gimbal_yaw_controller:
9 | type: effort_controllers/JointPositionController
10 | joint: gimbal_yaw_joint
11 | pid: {p: 10, i: 0.01, d: 0}
12 | gimbal_pitch_controller:
13 | type: effort_controllers/JointPositionController
14 | joint: gimbal_pitch_joint
15 | pid: {p: 1, i: 0.0, d: 0.0}
16 |
--------------------------------------------------------------------------------
/quad_flight/launch/buildings_flight_gazebo.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/quad_flight/launch/buildings_world.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/quad_flight/launch/display_quad.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/quad_flight/launch/moveit_test.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/quad_flight/launch/outdoor_flight_gazebo.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/quad_flight/launch/position_controller.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/quad_flight/launch/position_controller_with_teleop.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/quad_flight/launch/position_teleop.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/quad_flight/launch/rolling_landscape_120m.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/quad_flight/launch/start_world.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/quad_flight/launch/velocity_teleop.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/quad_flight/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | quad_flight
4 | 0.0.0
5 | Quadrotor tools for flying
6 |
7 |
8 |
9 |
10 | Benjamin Hepp
11 |
12 |
13 |
14 |
15 |
16 | ALv2
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Benjamin Hepp
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | catkin
44 | roscpp
45 | gazebo_ros
46 | gazebo_plugins
47 | tf
48 | joy
49 | dynamic_reconfigure
50 | roscpp
51 | gazebo_ros
52 | gazebo_plugins
53 | tf
54 | joy
55 | dynamic_reconfigure
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/quad_flight/test/get_link_state.sh:
--------------------------------------------------------------------------------
1 | LINK="quadrotor::RGBD_gimbal_camera_link"
2 | REFERENCE="quadrotor::base_link"
3 |
4 | rosservice call /gazebo/get_link_state "{link_name: '${LINK}', reference_frame: '${REFERENCE}'}"
5 |
6 |
--------------------------------------------------------------------------------
/quad_flight/test/pub_control.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rostopic pub /quadrotor/gimbal_yaw_controller/command std_msgs/Float64 "{data: ${1}}"
4 | rostopic pub /quadrotor/gimbal_pitch_controller/command std_msgs/Float64 "{data: ${2}}"
5 |
6 |
--------------------------------------------------------------------------------
/quad_flight/test/set_link_state.sh:
--------------------------------------------------------------------------------
1 | LINK="quadrotor::RGBD_gimbal_camera_link"
2 | #LINK="quadrotor::RGBD_gimbal_yaw_link"
3 | REFERENCE="quadrotor::base_link"
4 |
5 | X=0.10
6 | Y=0.0
7 | Z=-0.1
8 |
9 | OX=0.0
10 | OY=0.0
11 | OZ=0.2
12 | OW=-0.95
13 |
14 | rosservice call /gazebo/set_link_state "{link_state: { link_name: '${LINK}', pose: { position: {x: ${X}, y: ${Y}, z: ${Z}}, orientation: {x: ${OX}, y: ${OY}, z: ${OZ}, w: ${OW}} }, reference_frame: '${REFERENCE}' } }"
15 |
16 |
--------------------------------------------------------------------------------
/quad_flight/urdf/depth_camera.urdf.xacro:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |