├── mesh_msgs
├── service
│ ├── GetUUID.srv
│ ├── GetLabeledClusters.srv
│ ├── GetGeometry.srv
│ ├── GetMaterials.srv
│ ├── GetTexture.srv
│ ├── GetVertexCosts.srv
│ └── GetVertexColors.srv
├── msg
│ ├── MeshFeatures.msg
│ ├── MeshVertexCosts.msg
│ ├── Feature.msg
│ ├── MeshVertexTexCoords.msg
│ ├── TriangleMeshStamped.msg
│ ├── MeshFaceCluster.msg
│ ├── MeshVertexColors.msg
│ ├── VectorField.msg
│ ├── VectorFieldStamped.msg
│ ├── MeshMaterial.msg
│ ├── TriangleIndices.msg
│ ├── MeshTexture.msg
│ ├── MeshGeometryStamped.msg
│ ├── MeshMaterialsStamped.msg
│ ├── MeshVertexColorsStamped.msg
│ ├── MeshGeometry.msg
│ ├── MeshVertexCostsStamped.msg
│ ├── MeshMaterials.msg
│ ├── MeshFaceClusterStamped.msg
│ └── TriangleMesh.msg
├── README.md
├── CHANGELOG.rst
├── package.xml
└── CMakeLists.txt
├── rviz_map_plugin
├── README.md
├── icons
│ └── classes
│ │ └── ClusterLabel.png
├── CHANGELOG.rst
├── package.xml
├── rviz_plugin.xml
├── CMakeLists.txt
├── include
│ ├── ClusterLabelPanel.hpp
│ ├── Types.hpp
│ ├── kernels
│ │ └── cast_rays.cl
│ ├── ClusterLabelVisual.hpp
│ ├── MapDisplay.hpp
│ ├── MeshDisplay.hpp
│ ├── ClusterLabelTool.hpp
│ ├── ClusterLabelDisplay.hpp
│ └── TexturedMeshVisual.hpp
└── src
│ ├── ClusterLabelPanel.cpp
│ ├── ClusterLabelVisual.cpp
│ └── MeshDisplay.cpp
├── label_manager
├── srv
│ ├── GetLabelGroups.srv
│ ├── DeleteLabel.srv
│ └── GetLabeledClusterGroup.srv
├── README.md
├── CHANGELOG.rst
├── launch
│ └── label_manager.launch
├── src
│ ├── manager_node.cpp
│ └── manager.cpp
├── CMakeLists.txt
├── package.xml
└── include
│ └── label_manager
│ └── manager.h
├── doc
└── rviz_triangle.png
├── .gitmodules
├── rviz_mesh_plugin
├── icons
│ └── classes
│ │ ├── MeshGoal.png
│ │ └── ClusterLabel.png
├── CHANGELOG.rst
├── rviz_plugin.xml
├── package.xml
├── CMakeLists.txt
└── src
│ ├── mesh_goal_tool.h
│ ├── mesh_pose_tool.h
│ ├── mesh_goal_tool.cpp
│ ├── face_selection_tool.h
│ ├── trianglemesh_display.h
│ ├── trianglemesh_visual.h
│ └── mesh_pose_tool.cpp
├── mesh_tools
├── CMakeLists.txt
├── CHANGELOG.rst
└── package.xml
├── hdf5_map_io
├── CHANGELOG.rst
├── .gitmodules
├── package.xml
├── CMakeLists.txt
└── include
│ └── hdf5_map_io
│ └── hdf5_map_io.h
├── mesh_msgs_hdf5
├── CHANGELOG.rst
├── package.xml
├── CMakeLists.txt
└── include
│ └── mesh_msgs_hdf5
│ └── mesh_msgs_hdf5.h
├── mesh_msgs_transform
├── CHANGELOG.rst
├── package.xml
├── CMakeLists.txt
├── include
│ └── mesh_msgs_transform
│ │ └── transforms.h
└── src
│ └── transforms.cpp
├── .github
└── workflows
│ └── main.yml
├── LICENSE
└── README.md
/mesh_msgs/service/GetUUID.srv:
--------------------------------------------------------------------------------
1 | ---
2 | string uuid
3 |
--------------------------------------------------------------------------------
/rviz_map_plugin/README.md:
--------------------------------------------------------------------------------
1 | Plugin for viewing and labeling HDF5 mesh maps
2 |
--------------------------------------------------------------------------------
/label_manager/srv/GetLabelGroups.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | string[] labels
4 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshFeatures.msg:
--------------------------------------------------------------------------------
1 | string map_uuid
2 | mesh_msgs/Feature[] features
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshVertexCosts.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | float32[] costs
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/Feature.msg:
--------------------------------------------------------------------------------
1 | geometry_msgs/Point location
2 | std_msgs/Float32[] descriptor
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshVertexTexCoords.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Type
2 | float32 u
3 | float32 v
4 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/TriangleMeshStamped.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 | mesh_msgs/TriangleMesh mesh
3 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetLabeledClusters.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | MeshFaceCluster[] clusters
4 |
--------------------------------------------------------------------------------
/doc/rviz_triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/mesh_tools/kinetic/doc/rviz_triangle.png
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshFaceCluster.msg:
--------------------------------------------------------------------------------
1 | #Cluster
2 | uint32[] face_indices
3 | #optional
4 | string label
5 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshVertexColors.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | std_msgs/ColorRGBA[] vertex_colors
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/VectorField.msg:
--------------------------------------------------------------------------------
1 | geometry_msgs/Point[] positions
2 | geometry_msgs/Vector3[] vectors
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/VectorFieldStamped.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 | mesh_msgs/VectorField vector_field
3 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshMaterial.msg:
--------------------------------------------------------------------------------
1 | uint32 texture_index
2 | std_msgs/ColorRGBA color
3 | bool has_texture
4 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/TriangleIndices.msg:
--------------------------------------------------------------------------------
1 | # Definition of a triangle's vertices
2 | uint32[3] vertex_indices
3 |
--------------------------------------------------------------------------------
/label_manager/srv/DeleteLabel.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | string label
3 | ---
4 | mesh_msgs/MeshFaceCluster cluster
5 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetGeometry.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | mesh_msgs/MeshGeometryStamped mesh_geometry_stamped
4 |
--------------------------------------------------------------------------------
/mesh_msgs/README.md:
--------------------------------------------------------------------------------
1 | # mesh_msgs
2 |
3 | This package contains various ROS message types to represent mesh data.
4 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetMaterials.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | mesh_msgs/MeshMaterialsStamped mesh_materials_stamped
4 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetTexture.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | uint32 texture_index
3 | ---
4 | mesh_msgs/MeshTexture texture
5 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetVertexCosts.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | mesh_msgs/MeshVertexCostsStamped mesh_vertex_costs_stamped
4 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshTexture.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | string uuid
3 | uint32 texture_index
4 | sensor_msgs/Image image
5 |
--------------------------------------------------------------------------------
/mesh_msgs/service/GetVertexColors.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | ---
3 | mesh_msgs/MeshVertexColorsStamped mesh_vertex_colors_stamped
4 |
--------------------------------------------------------------------------------
/label_manager/README.md:
--------------------------------------------------------------------------------
1 | # label_manager
2 |
3 | This package contains a ROS node for serving and persisting label information
4 |
--------------------------------------------------------------------------------
/label_manager/srv/GetLabeledClusterGroup.srv:
--------------------------------------------------------------------------------
1 | string uuid
2 | string labelGroup
3 | ---
4 | mesh_msgs/MeshFaceCluster[] clusters
5 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "hdf5_map_io/ext/HighFive"]
2 | path = hdf5_map_io/ext/HighFive
3 | url = https://github.com/BlueBrain/HighFive.git
4 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/icons/classes/MeshGoal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/mesh_tools/kinetic/rviz_mesh_plugin/icons/classes/MeshGoal.png
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshGeometryStamped.msg:
--------------------------------------------------------------------------------
1 | # Mesh Geometry Message
2 | std_msgs/Header header
3 | string uuid
4 | mesh_msgs/MeshGeometry mesh_geometry
5 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshMaterialsStamped.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | std_msgs/Header header
3 | string uuid
4 | mesh_msgs/MeshMaterials mesh_materials
5 |
--------------------------------------------------------------------------------
/mesh_tools/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(mesh_tools)
3 | find_package(catkin REQUIRED)
4 | catkin_metapackage()
5 |
--------------------------------------------------------------------------------
/rviz_map_plugin/icons/classes/ClusterLabel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/mesh_tools/kinetic/rviz_map_plugin/icons/classes/ClusterLabel.png
--------------------------------------------------------------------------------
/rviz_mesh_plugin/icons/classes/ClusterLabel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/mesh_tools/kinetic/rviz_mesh_plugin/icons/classes/ClusterLabel.png
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshVertexColorsStamped.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | std_msgs/Header header
3 | string uuid
4 | mesh_msgs/MeshVertexColors mesh_vertex_colors
5 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshGeometry.msg:
--------------------------------------------------------------------------------
1 | # Mesh Geometry Message
2 | geometry_msgs/Point[] vertices
3 | geometry_msgs/Point[] vertex_normals
4 | mesh_msgs/TriangleIndices[] faces
5 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshVertexCostsStamped.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | std_msgs/Header header
3 | string uuid
4 | string type
5 | mesh_msgs/MeshVertexCosts mesh_vertex_costs
6 |
--------------------------------------------------------------------------------
/hdf5_map_io/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package hdf5_map_io
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
--------------------------------------------------------------------------------
/mesh_msgs/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package mesh_msgs
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshMaterials.msg:
--------------------------------------------------------------------------------
1 | # Mesh Attribute Message
2 | mesh_msgs/MeshFaceCluster[] clusters
3 | mesh_msgs/MeshMaterial[] materials
4 | uint32[] cluster_materials
5 | mesh_msgs/MeshVertexTexCoords[] vertex_tex_coords
6 |
--------------------------------------------------------------------------------
/mesh_tools/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package ros_mesh_tools
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/label_manager/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package label_manager
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
9 |
--------------------------------------------------------------------------------
/mesh_msgs_hdf5/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package mesh_msgs_hdf5
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/MeshFaceClusterStamped.msg:
--------------------------------------------------------------------------------
1 | # header
2 | std_msgs/Header header
3 |
4 | # mesh uuid
5 | string uuid
6 |
7 | # Cluster
8 | MeshFaceCluster cluster
9 |
10 | # overwrite existing labeled faces
11 | bool override
12 |
--------------------------------------------------------------------------------
/rviz_map_plugin/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package rviz_map_plugin
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package rviz_mesh_plugin
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/hdf5_map_io/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "include/HighFive"]
2 | path = include/HighFive
3 | url = https://github.com/BlueBrain/HighFive.git
4 | [submodule "ext/HighFive"]
5 | path = ext/HighFive
6 | url = https://github.com/BlueBrain/HighFive.git
7 |
--------------------------------------------------------------------------------
/mesh_msgs_transform/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package mesh_msgs_transform
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.0 (2020-04-26)
6 | ------------------
7 | * release version 1.0.0
8 |
--------------------------------------------------------------------------------
/label_manager/launch/label_manager.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/label_manager/src/manager_node.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * manager_node.cpp
3 | *
4 | */
5 |
6 | #include
7 | #include "label_manager/manager.h"
8 |
9 | int main(int argc, char **argv)
10 | {
11 | ros::init(argc, argv, "label_manager");
12 | ros::NodeHandle nodeHandle("~");
13 |
14 | label_manager::LabelManager lm(nodeHandle);
15 |
16 | ros::spin();
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | industrial_ci:
7 | strategy:
8 | matrix:
9 | env:
10 | - {ROS_DISTRO: melodic, ROS_REPO: testing}
11 | - {ROS_DISTRO: melodic, ROS_REPO: main}
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v2
15 | with:
16 | submodules: recursive
17 | - uses: 'ros-industrial/industrial_ci@master'
18 | env: ${{matrix.env}}
19 |
--------------------------------------------------------------------------------
/hdf5_map_io/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | hdf5_map_io
4 | 1.0.0
5 | The hdf5_map_io package
6 | Sebastian Pütz
7 | BSD-3
8 | http://wiki.ros.org/ros_mesh_tools/hdf5_map_io
9 | Sebastian Pütz
10 |
11 | catkin
12 | boost
13 | libhdf5-dev
14 |
15 |
16 |
--------------------------------------------------------------------------------
/mesh_msgs/msg/TriangleMesh.msg:
--------------------------------------------------------------------------------
1 | ## Definition of a triangle mesh
2 |
3 | TriangleIndices[] triangles # list of triangles; the index values refer to positions in vertices (and vertex_normals, if given)
4 | geometry_msgs/Point[] vertices # the actual vertices that make up the mesh
5 | #optional:
6 | geometry_msgs/Point[] vertex_normals
7 | std_msgs/ColorRGBA[] vertex_colors
8 | std_msgs/ColorRGBA[] triangle_colors
9 | geometry_msgs/Point[] vertex_texture_coords
10 | mesh_msgs/MeshMaterial[] face_materials
11 | sensor_msgs/Image[] textures
12 | mesh_msgs/MeshFaceCluster[] clusters
13 |
--------------------------------------------------------------------------------
/mesh_msgs_hdf5/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mesh_msgs_hdf5
4 | 1.0.0
5 | Read and write mesh_msgs to and from hdf5
6 | Sebastian Pütz
7 | http://wiki.ros.org/ros_mesh_tools/mesh_msgs_hdf5
8 | BSD-3
9 | Sebastian Pütz
10 |
11 | mesh_msgs
12 | hdf5_map_io
13 | label_manager
14 |
15 | mesh_msgs
16 | hdf5_map_io
17 | label_manager
18 |
19 | catkin
20 |
21 |
22 |
--------------------------------------------------------------------------------
/mesh_tools/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mesh_tools
4 | 1.0.0
5 | The mesh_tools package
6 | Sebastian Pütz
7 | BSD-3
8 | http://wiki.ros.org/mesh_tools
9 | Sebastian Pütz
10 |
11 | hdf5_map_io
12 | mesh_msgs
13 | mesh_msgs_transform
14 | rviz_map_plugin
15 | rviz_mesh_plugin
16 | label_manager
17 |
18 | catkin
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/mesh_msgs_transform/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mesh_msgs_transform
4 | 1.0.0
5 | Methods to transform mesh_msgs
6 | Sebastian Pütz
7 | BSD-3
8 | http://wiki.ros.org/ros_mesh_tools/mesh_msgs_transform
9 | Sebastian Pütz
10 |
11 | tf
12 | mesh_msgs
13 | geometry_msgs
14 | eigen
15 |
16 | tf
17 | mesh_msgs
18 | geometry_msgs
19 | eigen
20 |
21 | catkin
22 |
23 |
24 |
--------------------------------------------------------------------------------
/mesh_msgs_transform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(mesh_msgs_transform)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | tf
6 | geometry_msgs
7 | mesh_msgs
8 | )
9 |
10 | find_package(Eigen3 REQUIRED)
11 |
12 | include_directories(
13 | include
14 | ${catkin_INCLUDE_DIRS}
15 | ${EIGEN3_INCLUDE_DIRS}
16 | )
17 |
18 | catkin_package(
19 | INCLUDE_DIRS include
20 | LIBRARIES mesh_msgs_transform
21 | CATKIN_DEPENDS tf geometry_msgs mesh_msgs
22 | )
23 |
24 | add_library(mesh_msgs_transform
25 | src/transforms.cpp
26 | )
27 |
28 | target_link_libraries(mesh_msgs_transform
29 | ${catkin_LIBRARIES}
30 | )
31 |
32 | add_dependencies(mesh_msgs_transform ${catkin_EXPORTED_TARGETS})
33 |
34 | install(TARGETS mesh_msgs_transform
35 | DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
36 | )
37 |
38 | install(DIRECTORY include/${PROJECT_NAME}/
39 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
40 | )
41 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/rviz_plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | Displays 'mesh_msgs/TriangleMesh' messages.
7 |
8 | mesh_msgs/TriangleMeshStamped
9 |
10 |
13 |
14 | Displays 'mesh_msgs' messages with textures.
15 |
16 |
17 |
20 |
21 | Pick Faces from a mesh from 'mesh_msgs' and get their IDs.
22 |
23 |
24 |
27 |
28 | Select a goal on a mesh.
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/mesh_msgs/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mesh_msgs
4 | 1.0.0
5 | Various Message Types for Mesh Data.
6 | Sebastian Pütz
7 | Sebastian Pütz
8 | Henning Deeken
9 | Jan Philipp Vogtherr
10 | Rasmus Diederichsen
11 | Christian Swan
12 |
13 | http://wiki.ros.org/ros_mesh_tools/mesh_msgs
14 | BSD-3
15 |
16 | catkin
17 |
18 | roscpp
19 | message_generation
20 | geometry_msgs
21 | sensor_msgs
22 | std_msgs
23 |
24 | roscpp
25 | message_runtime
26 | geometry_msgs
27 | sensor_msgs
28 | std_msgs
29 |
30 |
--------------------------------------------------------------------------------
/hdf5_map_io/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(hdf5_map_io)
3 |
4 | set(CMAKE_CXX_STANDARD 11)
5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
6 |
7 | find_package(catkin REQUIRED)
8 | find_package(HDF5 REQUIRED COMPONENTS C CXX HL)
9 |
10 | catkin_package(
11 | INCLUDE_DIRS include ext/HighFive/include
12 | LIBRARIES hdf5_map_io
13 | DEPENDS HDF5
14 | )
15 |
16 | # HighFive
17 | set(HIGHFIVE_EXAMPLES FALSE)
18 | set(HIGHFIVE_UNIT_TESTS FALSE)
19 | add_subdirectory(ext/HighFive)
20 | link_directories(${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
21 |
22 | include_directories(
23 | include
24 | ${HDF5_INCLUDE_DIRS}
25 | ext/HighFive/include
26 | )
27 |
28 | add_library(${PROJECT_NAME}
29 | src/hdf5_map_io.cpp
30 | )
31 |
32 | link_libraries(${PROJECT_NAME}
33 | ${HDF5_LIBRARIES}
34 | ${HDF5_C_LIBRARIES}
35 | )
36 |
37 | install(TARGETS ${PROJECT_NAME}
38 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
39 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
40 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
41 | )
42 |
43 | install(DIRECTORY include/${PROJECT_NAME}/
44 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
45 | FILES_MATCHING PATTERN "*.h"
46 | PATTERN ".svn" EXCLUDE
47 | )
48 |
49 |
--------------------------------------------------------------------------------
/label_manager/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(label_manager)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | actionlib
6 | actionlib_msgs
7 | genmsg
8 | mesh_msgs
9 | message_generation
10 | roscpp
11 | sensor_msgs
12 | std_msgs
13 | tf
14 | )
15 |
16 |
17 | add_service_files(FILES
18 | DeleteLabel.srv
19 | GetLabelGroups.srv
20 | GetLabeledClusterGroup.srv
21 | )
22 |
23 | generate_messages(DEPENDENCIES
24 | mesh_msgs
25 | std_msgs
26 | )
27 |
28 | catkin_package(
29 | INCLUDE_DIRS include
30 | CATKIN_DEPENDS
31 | actionlib actionlib_msgs genmsg mesh_msgs message_generation message_runtime roscpp sensor_msgs std_msgs tf
32 | )
33 |
34 | include_directories(
35 | include ${catkin_INCLUDE_DIRS}
36 | ${catkin_INCLUDE_DIRS}
37 | )
38 |
39 |
40 | add_executable(${PROJECT_NAME}
41 | src/manager.cpp
42 | src/manager_node.cpp)
43 | add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
44 | target_link_libraries(${PROJECT_NAME}
45 | ${catkin_LIBRARIES}
46 | )
47 |
48 | install(TARGETS ${PROJECT_NAME}
49 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
50 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
51 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
52 | )
53 |
54 |
--------------------------------------------------------------------------------
/mesh_msgs/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(mesh_msgs)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | geometry_msgs
6 | message_generation
7 | roscpp
8 | sensor_msgs
9 | std_msgs
10 | )
11 |
12 | add_message_files(
13 | FILES
14 | MeshFaceCluster.msg
15 | MeshFaceClusterStamped.msg
16 | Feature.msg
17 | MeshMaterial.msg
18 | MeshFeatures.msg
19 | MeshGeometry.msg
20 | MeshGeometryStamped.msg
21 | MeshMaterials.msg
22 | MeshMaterialsStamped.msg
23 | MeshVertexColors.msg
24 | MeshVertexColorsStamped.msg
25 | MeshVertexCosts.msg
26 | MeshVertexCostsStamped.msg
27 | MeshTexture.msg
28 | TriangleIndices.msg
29 | TriangleMesh.msg
30 | TriangleMeshStamped.msg
31 | VectorField.msg
32 | VectorFieldStamped.msg
33 | MeshVertexTexCoords.msg
34 | )
35 |
36 | add_service_files(
37 | DIRECTORY
38 | service
39 | FILES
40 | GetGeometry.srv
41 | GetLabeledClusters.srv
42 | GetMaterials.srv
43 | GetTexture.srv
44 | GetUUID.srv
45 | GetVertexColors.srv
46 | GetVertexCosts.srv
47 | )
48 |
49 | generate_messages(
50 | DEPENDENCIES
51 | geometry_msgs
52 | sensor_msgs
53 | std_msgs
54 | )
55 |
56 | catkin_package(
57 | INCLUDE_DIRS
58 | CATKIN_DEPENDS
59 | geometry_msgs
60 | message_runtime
61 | roscpp
62 | sensor_msgs
63 | std_msgs
64 | )
65 |
--------------------------------------------------------------------------------
/label_manager/package.xml:
--------------------------------------------------------------------------------
1 |
2 | label_manager
3 |
4 | Serving and persisting label information
5 |
6 | 1.0.0
7 | Sebastian Pütz
8 |
9 | http://wiki.ros.org/ros_mesh_tools/label_manager
10 |
11 | Sebastian Pütz
12 | Jan Philipp Vogtherr
13 |
14 | BSD-3
15 |
16 | actionlib_msgs
17 | actionlib
18 | genmsg
19 | mesh_msgs
20 | message_generation
21 | roscpp
22 | sensor_msgs
23 | std_msgs
24 | tf
25 |
26 | actionlib_msgs
27 | actionlib
28 | genmsg
29 | mesh_msgs
30 | message_generation
31 | message_runtime
32 | roscpp
33 | sensor_msgs
34 | std_msgs
35 | tf
36 |
37 | catkin
38 |
39 |
40 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/package.xml:
--------------------------------------------------------------------------------
1 |
2 | rviz_mesh_plugin
3 |
4 | RViz display types and tools for the mesh_msgs package.
5 |
6 | 1.0.0
7 | Sebastian Pütz
8 | Sebastian Pütz
9 | Henning Deeken
10 | Marcel Mrozinski
11 | Kristin Schmidt
12 | Jan Philipp Vogtherr
13 | catkin
14 |
15 | BSD-3
16 | http://wiki.ros.org/ros_mesh_tools/rviz_mesh_plugin
17 | qtbase5-dev
18 | roscpp
19 | rviz
20 | std_msgs
21 | mesh_msgs
22 | tf2_ros
23 | libqt5-core
24 | libqt5-gui
25 | libqt5-widgets
26 | roscpp
27 | rviz
28 | std_msgs
29 | mesh_msgs
30 | tf2_ros
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/rviz_map_plugin/package.xml:
--------------------------------------------------------------------------------
1 |
2 | rviz_map_plugin
3 |
4 | RViz display types and tools for the mesh_msgs package.
5 |
6 | 1.0.0
7 | Sebastian Pütz
8 | Sebastian Pütz
9 | Kristin Schmidt
10 | Jan Philipp Vogtherr
11 | catkin
12 |
13 | BSD-3
14 | http://ros.org/wiki/mash_tools/rviz_map_plugin
15 | qtbase5-dev
16 | roscpp
17 | rviz
18 | std_msgs
19 | mesh_msgs
20 | hdf5_map_io
21 | ocl-icd-opencl-dev
22 | opencl-headers
23 | libqt5-core
24 | libqt5-gui
25 | libqt5-widgets
26 | roscpp
27 | rviz
28 | std_msgs
29 | mesh_msgs
30 | hdf5_map_io
31 | ocl-icd-opencl-dev
32 | opencl-headers
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2020, Osnabrück University, Sebastian Pütz
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | * Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/rviz_map_plugin/rviz_plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
13 | A panel widget allowing creation of cluster labels.
14 |
15 |
16 |
19 |
20 | A tool allowing selection of clusters.
21 |
22 |
23 |
26 |
27 | Displays labeled clusters of a map. (Don't use without Map3D)
28 |
29 |
30 |
33 |
34 | Displays a map with labeled clusters.
35 |
36 |
37 |
40 |
41 | Displays the mesh of a map. (Don't use without Map3D)
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/mesh_msgs_hdf5/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.4.6)
2 |
3 | project(mesh_msgs_hdf5)
4 |
5 | set(PACKAGE_DEPENDENCIES
6 | mesh_msgs
7 | hdf5_map_io
8 | label_manager
9 | )
10 |
11 | find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})
12 | find_package(HDF5 REQUIRED COMPONENTS C CXX HL)
13 |
14 | ### compile with c++11
15 | if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
16 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
17 | set(CMAKE_CXX_FLAGS "--std=gnu++14 ${CMAKE_CXX_FLAGS}")
18 | endif ()
19 | else ()
20 | set(CMAKE_CXX_STANDARD 14)
21 | endif ()
22 |
23 | include_directories(
24 | include
25 | )
26 |
27 | include_directories(
28 | ${catkin_INCLUDE_DIRS}
29 | ${HDF5_INCLUDE_DIRS}
30 | )
31 |
32 | catkin_package(
33 | CATKIN_DEPENDS ${PACKAGE_DEPENDENCIES}
34 | INCLUDE_DIRS include
35 | DEPENDS HDF5
36 | LIBRARIES ${PROJECT_NAME}
37 | )
38 |
39 | add_library(${PROJECT_NAME}
40 | src/mesh_msgs_hdf5.cpp
41 | )
42 |
43 | link_directories(${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
44 |
45 | add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
46 |
47 | #add_executable(${PROJECT_NAME}_node src/hdf5_to_msg_node.cpp)
48 | #target_link_libraries(${PROJECT_NAME}_node
49 | # ${catkin_LIBRARIES}
50 | # ${HDF5_LIBRARIES}
51 | #)
52 |
53 | #install(
54 | # DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
55 | #)
56 |
57 | install(
58 | TARGETS ${PROJECT_NAME}# ${PROJECT_NAME}_node
59 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
60 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
61 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
62 | )
63 |
64 | install(
65 | DIRECTORY include/${PROJECT_NAME}/
66 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
67 | )
68 |
--------------------------------------------------------------------------------
/label_manager/include/label_manager/manager.h:
--------------------------------------------------------------------------------
1 | #ifndef LABEL_MANAGER_H_
2 | #define LABEL_MANAGER_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | namespace label_manager
14 | {
15 |
16 | class LabelManager
17 | {
18 | public:
19 | LabelManager(ros::NodeHandle& nodeHandle);
20 |
21 | private:
22 | ros::NodeHandle nh;
23 | ros::Subscriber clusterLabelSub;
24 | ros::Publisher newClusterLabelPub;
25 | ros::ServiceServer srv_get_labeled_clusters;
26 | ros::ServiceServer srv_get_label_groups;
27 | ros::ServiceServer srv_get_labeled_cluster_group;
28 | ros::ServiceServer srv_delete_label;
29 |
30 | std::string folderPath;
31 |
32 | void clusterLabelCallback(const mesh_msgs::MeshFaceClusterStamped::ConstPtr& msg);
33 | bool service_getLabeledClusters(
34 | mesh_msgs::GetLabeledClusters::Request& req,
35 | mesh_msgs::GetLabeledClusters::Response& res);
36 | bool service_getLabelGroups(
37 | label_manager::GetLabelGroups::Request& req,
38 | label_manager::GetLabelGroups::Response& res);
39 | bool service_getLabeledClusterGroup(
40 | label_manager::GetLabeledClusterGroup::Request& req,
41 | label_manager::GetLabeledClusterGroup::Response& res);
42 | bool service_deleteLabel(
43 | label_manager::DeleteLabel::Request& req,
44 | label_manager::DeleteLabel::Response& res);
45 |
46 | bool writeIndicesToFile(const std::string& fileName, const std::vector& indices, const bool append);
47 | std::vector readIndicesFromFile(const std::string& fileName);
48 | std::string getFileName(const std::string& uuid, const std::string& label);
49 | };
50 |
51 | }
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(rviz_mesh_plugin)
3 |
4 | set(CMAKE_CXX_STANDARD 11)
5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
6 |
7 |
8 | set(THIS_PACKAGE_ROS_DEPS
9 | roscpp
10 | rviz
11 | std_msgs
12 | mesh_msgs
13 | )
14 |
15 | find_package(catkin REQUIRED COMPONENTS
16 | ${THIS_PACKAGE_ROS_DEPS}
17 | )
18 |
19 | catkin_package(
20 | CATKIN_DEPENDS std_msgs mesh_msgs
21 | )
22 |
23 | include_directories(${catkin_INCLUDE_DIRS})
24 |
25 | ## This setting causes Qt's "MOC" generation to happen automatically.
26 | set(CMAKE_AUTOMOC ON)
27 |
28 | if(rviz_QT_VERSION VERSION_LESS "5")
29 | message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
30 | find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
31 | ## pull in all required include dirs, define QT_LIBRARIES, etc.
32 | include(${QT_USE_FILE})
33 | else()
34 | message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
35 | find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
36 | ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
37 | set(QT_LIBRARIES Qt5::Widgets)
38 | endif()
39 |
40 | add_definitions(-DQT_NO_KEYWORDS)
41 |
42 | set(SOURCE_FILES
43 | src/trianglemesh_display.cpp
44 | src/trianglemesh_visual.cpp
45 | src/textured_mesh_display.cpp
46 | src/textured_mesh_visual.cpp
47 | src/face_selection_tool.cpp
48 | src/mesh_pose_tool.cpp
49 | src/mesh_goal_tool.cpp
50 | )
51 |
52 | add_library(rviz_mesh_plugin ${SOURCE_FILES})
53 | target_link_libraries(rviz_mesh_plugin ${QT_LIBRARIES} ${catkin_LIBRARIES})
54 | add_dependencies(rviz_mesh_plugin ${catkin_EXPORTED_TARGETS})
55 |
56 | install(TARGETS rviz_mesh_plugin
57 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
58 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
59 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
60 | )
61 | install(FILES
62 | rviz_plugin.xml
63 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
64 |
65 | install(DIRECTORY icons/
66 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons)
67 |
--------------------------------------------------------------------------------
/mesh_msgs_transform/include/mesh_msgs_transform/transforms.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * transforms.h
41 | *
42 | * author: Sebastian Pütz
43 | */
44 |
45 |
46 | #ifndef MESH_MSGS_TRANSFORM__TRANSFORMS_H_
47 | #define MESH_MSGS_TRANSFORM__TRANSFORMS_H_
48 |
49 | #include
50 | #include
51 | #include
52 |
53 | namespace mesh_msgs_transform{
54 |
55 | bool transformTriangleMeshNoTime(
56 | const std::string& target_frame,
57 | const mesh_msgs::TriangleMeshStamped& mesh_in,
58 | const std::string& fixed_frame,
59 | mesh_msgs::TriangleMeshStamped& mesh_out,
60 | const tf::TransformListener& tf_listener
61 | );
62 |
63 | bool transformGeometryMeshNoTime(
64 | const std::string& target_frame,
65 | const mesh_msgs::MeshGeometryStamped& mesh_in,
66 | const std::string& fixed_frame,
67 | mesh_msgs::MeshGeometryStamped& mesh_out,
68 | const tf::TransformListener& tf_listener
69 | );
70 |
71 | bool transformTriangleMesh(
72 | const std::string& target_frame,
73 | const ros::Time& target_time,
74 | const mesh_msgs::TriangleMeshStamped& mesh_in,
75 | const std::string& fixed_frame,
76 | mesh_msgs::TriangleMeshStamped& mesh_out,
77 | const tf::TransformListener& tf_listener
78 | );
79 |
80 | }
81 |
82 | #endif /* transforms.h */
83 |
--------------------------------------------------------------------------------
/rviz_map_plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(rviz_map_plugin)
3 |
4 | set(CMAKE_CXX_STANDARD 11)
5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
6 |
7 | set(THIS_PACKAGE_ROS_DEPS
8 | roscpp
9 | rviz
10 | std_msgs
11 | mesh_msgs
12 | hdf5_map_io
13 | )
14 |
15 | find_package(catkin REQUIRED COMPONENTS
16 | ${THIS_PACKAGE_ROS_DEPS}
17 | )
18 |
19 | find_package(MPI REQUIRED)
20 | find_package(Boost REQUIRED COMPONENTS system)
21 | find_package(HDF5 REQUIRED COMPONENTS C CXX HL)
22 | find_package(OpenCL 2 REQUIRED)
23 |
24 | catkin_package(
25 | CATKIN_DEPENDS ${THIS_PACKAGE_ROS_DEPS}
26 | DEPENDS Boost OpenCL HDF5 OpenCL MPI
27 | )
28 |
29 | include_directories(
30 | include
31 | ${catkin_INCLUDE_DIRS}
32 | ${Boost_INCLUDE_DIRS}
33 | ${HDF5_INCLUDE_DIRS}
34 | ${OpenCL_INCLUDE_DIRS}
35 | ${MPI_INCLUDE_PATH}
36 | /usr/include
37 | )
38 |
39 | link_directories(${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
40 |
41 | ## This setting causes Qt's "MOC" generation to happen automatically.
42 | set(CMAKE_AUTOMOC ON)
43 |
44 | if("${rviz_QT_VERSION}" VERSION_LESS "5")
45 | message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
46 | find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
47 | ## pull in all required include dirs, define QT_LIBRARIES, etc.
48 | include(${QT_USE_FILE})
49 | else()
50 | message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
51 | find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
52 | ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
53 | set(QT_LIBRARIES Qt5::Widgets)
54 | endif()
55 |
56 | add_definitions(-DQT_NO_KEYWORDS)
57 |
58 | set(SOURCE_FILES
59 | src/ClusterLabelDisplay.cpp
60 | src/ClusterLabelPanel.cpp
61 | src/ClusterLabelTool.cpp
62 | src/ClusterLabelVisual.cpp
63 | src/MapDisplay.cpp
64 | src/MeshDisplay.cpp
65 | src/TexturedMeshVisual.cpp
66 | )
67 |
68 | set(HEADER_FILES
69 | include/ClusterLabelDisplay.hpp
70 | include/ClusterLabelPanel.hpp
71 | include/ClusterLabelVisual.hpp
72 | include/MapDisplay.hpp
73 | include/MeshDisplay.hpp
74 | include/TexturedMeshVisual.hpp
75 | include/ClusterLabelTool.hpp
76 | include/CLUtil.hpp
77 | )
78 |
79 | add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
80 |
81 | target_link_libraries(${PROJECT_NAME}
82 | ${QT_LIBRARIES}
83 | ${catkin_LIBRARIES}
84 | ${HDF5_LIBRARIES}
85 | ${HDF5_HL_LIBRARIES}
86 | ${OpenCL_LIBRARIES}
87 | ${MPI_C_LIBRARIES}
88 | )
89 |
90 | add_dependencies(${PROJECT_NAME}
91 | ${catkin_EXPORTED_TARGETS}
92 | ${HDF5_LIBRARIES}
93 | ${HDF5_HL_LIBRARIES}
94 | ${OpenCL_LIBRARIES}
95 | )
96 |
97 | install(TARGETS ${PROJECT_NAME}
98 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
99 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
100 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
101 | )
102 | install(FILES
103 | rviz_plugin.xml
104 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
105 |
106 | install(DIRECTORY icons/
107 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons)
108 |
109 | get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
110 | foreach(dir ${dirs})
111 | message(STATUS "dir='${dir}'")
112 | endforeach()
113 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/src/mesh_goal_tool.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * mesh_goal_tool.h
41 | *
42 | * author: Sebastian Pütz
43 | */
44 |
45 | #ifndef RVIZ_MESH_PLUGIN__MESH_GOAL_TOOL_H_
46 | #define RVIZ_MESH_PLUGIN__MESH_GOAL_TOOL_H_
47 |
48 | #include "mesh_pose_tool.h"
49 | #include
50 | #include
51 | #include
52 | #include
53 |
54 | #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
55 | #include
56 | #endif
57 |
58 | namespace rviz_mesh_plugin{
59 |
60 | /**
61 | * @class MeshGoalTool
62 | * @brief Tool for publishing a goal within a mesh
63 | */
64 | class MeshGoalTool : public MeshPoseTool{
65 | Q_OBJECT
66 | public:
67 |
68 | /**
69 | * @brief Constructor
70 | */
71 | MeshGoalTool();
72 |
73 | /**
74 | * @brief Callback that is executed when tool is initialized
75 | */
76 | virtual void onInitialize();
77 |
78 | private Q_SLOTS:
79 |
80 | /**
81 | * @brief Updates the topic on which the goal will be published
82 | */
83 | void updateTopic();
84 |
85 | protected:
86 |
87 | /**
88 | * @brief When goal is set, publish result
89 | * @param position Position
90 | * @param orientation Orientation
91 | */
92 | virtual void onPoseSet( const Ogre::Vector3& position, const Ogre::Quaternion& orientation );
93 |
94 | /// Property for the topic
95 | rviz::StringProperty* topic_property_;
96 | /// Switch bottom / top for selection
97 | rviz::BoolProperty* switch_bottom_top_;
98 | /// Publisher
99 | ros::Publisher pose_pub_;
100 | /// Node handle
101 | ros::NodeHandle nh_;
102 |
103 | };
104 |
105 | } /* namespace rviz_mesh_plugin */
106 |
107 | #endif /* mesh_goal_tool.h */
108 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/src/mesh_pose_tool.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * mesh_pose_tool.h
41 | *
42 | * author: Sebastian Pütz
43 | */
44 |
45 |
46 | #ifndef RVIZ_MESH_PLUGIN__MESH_POSE_TOOL_H_
47 | #define RVIZ_MESH_PLUGIN__MESH_POSE_TOOL_H_
48 |
49 | #include
50 | #include
51 | #include
52 | #include
53 |
54 | #include
55 | #include
56 | #include
57 | #include
58 |
59 | namespace rviz_mesh_plugin{
60 |
61 | class MeshPoseTool: public rviz::Tool{
62 | public:
63 | MeshPoseTool();
64 | virtual ~MeshPoseTool();
65 |
66 | virtual void onInitialize();
67 |
68 | virtual void activate();
69 | virtual void deactivate();
70 |
71 | virtual int processMouseEvent( rviz::ViewportMouseEvent& event );
72 |
73 | protected:
74 | virtual void onPoseSet( const Ogre::Vector3& position, const Ogre::Quaternion& orientation ) = 0;
75 |
76 | void getRawManualObjectData(
77 | const Ogre::ManualObject *mesh,
78 | const size_t sectionNumber,
79 | size_t& vertexCount,
80 | Ogre::Vector3*& vertices,
81 | size_t& indexCount,
82 | unsigned long*& indices);
83 |
84 | bool getPositionAndOrientation(
85 | const Ogre::ManualObject* mesh,
86 | const Ogre::Ray &ray,
87 | Ogre::Vector3& position,
88 | Ogre::Vector3& orientation);
89 |
90 | bool selectTriangle(
91 | rviz::ViewportMouseEvent& event,
92 | Ogre::Vector3& position,
93 | Ogre::Vector3& orientation);
94 |
95 | rviz::Arrow* arrow_;
96 | enum State
97 | {
98 | Position,
99 | Orientation
100 | };
101 | State state_;
102 | Ogre::Vector3 pos_;
103 | Ogre::Vector3 ori_;
104 | };
105 |
106 | } /* namespace rviz_mesh_plugin */
107 |
108 | #endif /* mesh_pose_tool.h */
109 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/src/mesh_goal_tool.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * mesh_goal_tool.cpp
41 | *
42 | * author: Sebastian Pütz
43 | */
44 |
45 |
46 | #include "mesh_goal_tool.h"
47 |
48 | #include
49 | PLUGINLIB_EXPORT_CLASS( rviz_mesh_plugin::MeshGoalTool, rviz::Tool )
50 |
51 | namespace rviz_mesh_plugin{
52 | MeshGoalTool::MeshGoalTool()
53 | {
54 | shortcut_key_ = 'm';
55 | topic_property_ = new rviz::StringProperty( "Topic", "goal",
56 | "The topic on which to publish the mesh navigation goals.",
57 | getPropertyContainer(), SLOT(updateTopic()), this);
58 |
59 | switch_bottom_top_ = new rviz::BoolProperty("Switch Bottom/Top",
60 | false, "Enable to stwich the bottom and top.",
61 | getPropertyContainer());
62 |
63 | }
64 |
65 | void MeshGoalTool::onInitialize()
66 | {
67 | MeshPoseTool::onInitialize();
68 | setName( "Mesh Goal" );
69 | updateTopic();
70 | }
71 |
72 | void MeshGoalTool::updateTopic()
73 | {
74 | pose_pub_ = nh_.advertise( topic_property_->getStdString(), 1 );
75 | }
76 |
77 | void MeshGoalTool::onPoseSet( const Ogre::Vector3& position, const Ogre::Quaternion& orientation ){
78 | geometry_msgs::PoseStamped msg;
79 | msg.pose.position.x = position.x;
80 | msg.pose.position.y = position.y;
81 | msg.pose.position.z = position.z;
82 |
83 | // ogreToRos(x,y,z) = (-z,-x,y)
84 |
85 | Ogre::Quaternion ros_orientation;
86 |
87 | if(switch_bottom_top_->getBool())
88 | {
89 | ros_orientation.FromAxes(
90 | -orientation.zAxis(),
91 | orientation.xAxis(),
92 | -orientation.yAxis()
93 | );
94 | }
95 | else
96 | {
97 | ros_orientation.FromAxes(
98 | -orientation.zAxis(),
99 | -orientation.xAxis(),
100 | orientation.yAxis()
101 | );
102 | }
103 |
104 | msg.pose.orientation.x = ros_orientation.x;
105 | msg.pose.orientation.y = ros_orientation.y;
106 | msg.pose.orientation.z = ros_orientation.z;
107 | msg.pose.orientation.w = ros_orientation.w;
108 |
109 | msg.header.stamp = ros::Time::now();
110 | msg.header.frame_id = context_->getFixedFrame().toStdString();
111 | pose_pub_.publish(msg);
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/mesh_msgs_hdf5/include/mesh_msgs_hdf5/mesh_msgs_hdf5.h:
--------------------------------------------------------------------------------
1 | #ifndef MESH_MSGS_HDF5_H_
2 | #define MESH_MSGS_HDF5_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 |
26 | namespace mesh_msgs_hdf5
27 | {
28 |
29 | class hdf5_to_msg
30 | {
31 |
32 | public:
33 | hdf5_to_msg();
34 |
35 | protected:
36 | // Mesh services
37 | bool service_getGeometry(
38 | mesh_msgs::GetGeometry::Request &req,
39 | mesh_msgs::GetGeometry::Response &res);
40 | bool service_getGeometryVertices(
41 | mesh_msgs::GetGeometry::Request &req,
42 | mesh_msgs::GetGeometry::Response &res);
43 | bool service_getGeometryFaces(
44 | mesh_msgs::GetGeometry::Request &req,
45 | mesh_msgs::GetGeometry::Response &res);
46 | bool service_getGeometryVertexnormals(
47 | mesh_msgs::GetGeometry::Request &req,
48 | mesh_msgs::GetGeometry::Response &res);
49 |
50 | bool service_getMaterials(
51 | mesh_msgs::GetMaterials::Request &req,
52 | mesh_msgs::GetMaterials::Response &res);
53 | bool service_getTexture(
54 | mesh_msgs::GetTexture::Request &req,
55 | mesh_msgs::GetTexture::Response &res);
56 | bool service_getUUID(
57 | mesh_msgs::GetUUID::Request &req,
58 | mesh_msgs::GetUUID::Response &res);
59 | bool service_getVertexColors(
60 | mesh_msgs::GetVertexColors::Request &req,
61 | mesh_msgs::GetVertexColors::Response &res);
62 |
63 | // Label manager services
64 | bool service_getLabeledClusters(
65 | mesh_msgs::GetLabeledClusters::Request &req,
66 | mesh_msgs::GetLabeledClusters::Response &res);
67 | bool service_getLabelGroups(
68 | label_manager::GetLabelGroups::Request &req,
69 | label_manager::GetLabelGroups::Response &res);
70 | bool service_getLabeledClusterGroup(
71 | label_manager::GetLabeledClusterGroup::Request &req,
72 | label_manager::GetLabeledClusterGroup::Response &res);
73 | bool service_deleteLabel(
74 | label_manager::DeleteLabel::Request &req,
75 | label_manager::DeleteLabel::Response &res);
76 |
77 | // Vertex costs
78 | bool service_getRoughness(
79 | mesh_msgs::GetVertexCosts::Request &req,
80 | mesh_msgs::GetVertexCosts::Response &res);
81 | bool service_getHeightDifference(
82 | mesh_msgs::GetVertexCosts::Request &req,
83 | mesh_msgs::GetVertexCosts::Response &res);
84 |
85 | void callback_clusterLabel(const mesh_msgs::MeshFaceClusterStamped::ConstPtr &msg);
86 |
87 | private:
88 |
89 | // Mesh message service servers
90 | ros::ServiceServer srv_get_geometry_;
91 | ros::ServiceServer srv_get_geometry_vertices_;
92 | ros::ServiceServer srv_get_geometry_faces_;
93 | ros::ServiceServer srv_get_geometry_vertex_normals_;
94 | ros::ServiceServer srv_get_materials_;
95 | ros::ServiceServer srv_get_texture_;
96 | ros::ServiceServer srv_get_uuid_;
97 | ros::ServiceServer srv_get_vertex_colors_;
98 | ros::ServiceServer srv_get_roughness_;
99 | ros::ServiceServer srv_get_height_difference_;
100 |
101 | // Label manager services and subs/pubs
102 | ros::Subscriber sub_cluster_label_;
103 | ros::Publisher pub_cluster_label_;
104 | ros::ServiceServer srv_get_labeled_clusters_;
105 | ros::ServiceServer srv_get_label_groups_;
106 | ros::ServiceServer srv_get_labeled_cluster_group_;
107 | ros::ServiceServer srv_delete_label_;
108 |
109 | // ROS
110 | ros::NodeHandle node_handle;
111 |
112 | // ROS parameter
113 | std::string inputFile;
114 |
115 | std::string mesh_uuid = "mesh";
116 |
117 | };
118 |
119 | } // end namespace
120 |
121 | #endif /* MESH_MSGS_HDF5_H_ */
122 |
--------------------------------------------------------------------------------
/rviz_map_plugin/include/ClusterLabelPanel.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * ClusterLabelPanel.hpp
41 | *
42 | *
43 | * authors:
44 | *
45 | * Kristin Schmidt
46 | * Jan Philipp Vogtherr
47 | */
48 |
49 | #pragma once
50 |
51 | #include
52 | #include
53 | #include
54 | #include
55 | #include
56 | #include
57 | #include
58 |
59 | // Forward declarations
60 | class QLineEdit;
61 | class QPushButton;
62 |
63 | namespace rviz
64 | {
65 | class Tool;
66 | }
67 |
68 | namespace rviz_map_plugin
69 | {
70 |
71 | /**
72 | * @class ClusterLabelPanel
73 | * @brief Panel for interacting with the label tool
74 | */
75 | class ClusterLabelPanel: public rviz::Panel
76 | {
77 |
78 | Q_OBJECT
79 |
80 | public:
81 |
82 | /**
83 | * @brief Constructor
84 | * @param parent This panel's parent, if available
85 | */
86 | ClusterLabelPanel(QWidget* parent = 0);
87 |
88 | /**
89 | * @brief RViz callback on inizialize
90 | */
91 | void onInitialize();
92 |
93 | /**
94 | * @brief Load a configuration
95 | * @input config The configuration
96 | */
97 | virtual void load(const rviz::Config& config);
98 |
99 | /**
100 | * @brief Save a configuration
101 | * @input config The configuration
102 | */
103 | virtual void save(rviz::Config config) const;
104 |
105 | public Q_SLOTS:
106 |
107 | /**
108 | * @brief Set the name under which the current cluster will be saved
109 | * @param clusterName The new name
110 | */
111 | void setClusterName(const QString& clusterName);
112 |
113 | /**
114 | * @brief Updates the current cluster name
115 | */
116 | void updateClusterName();
117 |
118 | /**
119 | * @brief Publishes the current cluster
120 | */
121 | void publish();
122 |
123 | /**
124 | * @brief Resets the current face selection state
125 | */
126 | void resetFaces();
127 |
128 | protected:
129 |
130 | /// Input for entering the cluster name
131 | QLineEdit* m_clusterNameEditor;
132 | /// Input for entering the output topic name
133 | QLineEdit* m_outputTopicEditor;
134 |
135 | /// Name of the cluster
136 | QString m_clusterName;
137 |
138 | /// Button for creating and publishing the cluster
139 | QPushButton* m_createClusterButton;
140 | /// Button for resetting the current faces in cluster
141 | QPushButton* m_resetFacesButton;
142 |
143 | /// Instance of the label tool from this package
144 | ClusterLabelTool* m_tool;
145 |
146 | /// Node handle
147 | ros::NodeHandle m_nodeHandle;
148 |
149 | };
150 |
151 | } // end namespace rviz_map_plugin
152 |
--------------------------------------------------------------------------------
/rviz_map_plugin/include/Types.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * Types.hpp
41 | *
42 | *
43 | * authors:
44 | *
45 | * Kristin Schmidt
46 | * Jan Philipp Vogtherr
47 | */
48 |
49 | #pragma once
50 |
51 | #include
52 | #include
53 | #include
54 | #include
55 |
56 | namespace rviz_map_plugin {
57 |
58 | using std::vector;
59 | using std::string;
60 | using std::array;
61 | using boost::optional;
62 |
63 | /// Struct for normals
64 | struct Normal
65 | {
66 | float x;
67 | float y;
68 | float z;
69 |
70 | Normal(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
71 | };
72 |
73 | /// Struct for texture coordinates
74 | struct TexCoords
75 | {
76 | float u;
77 | float v;
78 |
79 | TexCoords(float _u, float _v) : u(_u), v(_v) {}
80 | };
81 |
82 | /// Struct for clusters
83 | struct Cluster
84 | {
85 | string name;
86 | vector faces;
87 |
88 | Cluster(string n, vector f) : name(n), faces(f) {}
89 | };
90 |
91 | /// Struct for vertices
92 | struct Vertex
93 | {
94 | float x;
95 | float y;
96 | float z;
97 | };
98 |
99 | /// Struct for faces
100 | struct Face
101 | {
102 | array vertexIndices;
103 | };
104 |
105 | /// Struct for geometry
106 | struct Geometry
107 | {
108 | vector vertices;
109 | vector faces;
110 |
111 | Geometry()
112 | {}
113 |
114 | Geometry(vector v, vector f)
115 | {
116 | for (uint32_t i = 0; i < v.size() / 3; i++)
117 | {
118 | Vertex vertex;
119 | vertex.x = v[i * 3 + 0];
120 | vertex.y = v[i * 3 + 1];
121 | vertex.z = v[i * 3 + 2];
122 | vertices.push_back(vertex);
123 | }
124 |
125 | for (uint32_t i = 0; i < f.size() / 3; i++)
126 | {
127 | Face face;
128 | face.vertexIndices[0] = f[i * 3 + 0];
129 | face.vertexIndices[1] = f[i * 3 + 1];
130 | face.vertexIndices[2] = f[i * 3 + 2];
131 | faces.push_back(face);
132 | }
133 | }
134 | };
135 |
136 | /// Struct for colors
137 | struct Color
138 | {
139 | float r;
140 | float g;
141 | float b;
142 | float a;
143 |
144 | Color() {}
145 | Color(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {}
146 | };
147 |
148 | /// Struct for textures
149 | struct Texture
150 | {
151 | uint32_t width;
152 | uint32_t height;
153 | uint8_t channels;
154 | vector data;
155 | string pixelFormat;
156 | };
157 |
158 | /// Struct for materials
159 | struct Material
160 | {
161 | optional textureIndex;
162 | Color color;
163 | vector faceIndices;
164 | };
165 |
166 |
167 | } // namespace
168 |
--------------------------------------------------------------------------------
/rviz_map_plugin/include/kernels/cast_rays.cl:
--------------------------------------------------------------------------------
1 | //#pragma OPENCL EXTENSION cl_intel_printf : enable
2 |
3 | #define EPSILON 0.0000001
4 | #define PI 3.14159265
5 |
6 | typedef struct {
7 | bool intersects;
8 | float intersection;
9 | } intersection_result;
10 |
11 | typedef struct {
12 | float3 vertex0;
13 | float3 vertex1;
14 | float3 vertex2;
15 | } triangle_t;
16 |
17 | /**
18 | * Credits go to: https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
19 | */
20 | intersection_result ray_intersects_triangle(
21 | float3 ray,
22 | float3 ray_origin,
23 | triangle_t triangle
24 | )
25 | {
26 | float3 edge1, edge2, h, s, q;
27 | float a, f, u, v;
28 | intersection_result out;
29 |
30 | edge1 = triangle.vertex1 - triangle.vertex0;
31 | edge2 = triangle.vertex2 - triangle.vertex0;
32 | h = cross(ray, edge2);
33 | a = dot(edge1, h);
34 |
35 | if (a > -EPSILON && a < EPSILON)
36 | {
37 | out.intersects = false;
38 | return out;
39 | }
40 |
41 | f = 1/a;
42 | s = ray_origin - triangle.vertex0;
43 | u = f * dot(s, h);
44 |
45 | if (u < 0.0 || u > 1.0)
46 | {
47 | out.intersects = false;
48 | return out;
49 | }
50 |
51 | q = cross(s, edge1);
52 | v = f * dot(ray, q);
53 |
54 | if (v < 0.0 || u + v > 1.0)
55 | {
56 | out.intersects = false;
57 | return out;
58 | }
59 |
60 | float t = f * dot(edge2, q);
61 | if (t > EPSILON)
62 | {
63 | out.intersects = true;
64 | out.intersection = t;
65 | return out;
66 | }
67 |
68 | out.intersects = false;
69 | return out;
70 | }
71 |
72 |
73 | __kernel void cast_rays(
74 | __global float* vertices,
75 | __global float* ray,
76 | __global float* result
77 | )
78 | {
79 | int id = get_global_id(0);
80 |
81 | float3 rayOrigin = (float3)(ray[0], ray[1], ray[2]);
82 | float3 rayDirection = (float3)(ray[3], ray[4], ray[5]);
83 |
84 | // initialize result memory
85 | result[id] = -1;
86 |
87 | triangle_t triangle;
88 | triangle.vertex0 = (float3)(vertices[id * 9 + 0], vertices[id * 9 + 1], vertices[id * 9 + 2]);
89 | triangle.vertex1 = (float3)(vertices[id * 9 + 3], vertices[id * 9 + 4], vertices[id * 9 + 5]);
90 | triangle.vertex2 = (float3)(vertices[id * 9 + 6], vertices[id * 9 + 7], vertices[id * 9 + 8]);
91 |
92 | intersection_result i_result = ray_intersects_triangle(rayDirection, rayOrigin, triangle);
93 | if (i_result.intersects)
94 | {
95 | result[id] = i_result.intersection;
96 | }
97 | }
98 |
99 | __kernel void cast_sphere(
100 | __global float* vertices,
101 | __global float* sphere,
102 | __global float* result,
103 | float dist
104 | )
105 | {
106 | int id = get_global_id(0);
107 |
108 | float3 center = (float3)(sphere[0], sphere[1], sphere[2]);
109 |
110 | // initialize result memory
111 | result[id] = -1;
112 |
113 | // store each input vertex in a float4 to simplify access
114 | float3 vertex0 = (float3)(vertices[id * 9 + 0], vertices[id * 9 + 1], vertices[id * 9 + 2]);
115 | float3 vertex1 = (float3)(vertices[id * 9 + 3], vertices[id * 9 + 4], vertices[id * 9 + 5]);
116 | float3 vertex2 = (float3)(vertices[id * 9 + 6], vertices[id * 9 + 7], vertices[id * 9 + 8]);
117 |
118 | // calculate the distance to the center point for each vertex
119 | float dist0 = distance(center, vertex0);
120 | float dist1 = distance(center, vertex1);
121 | float dist2 = distance(center, vertex2);
122 |
123 | // if one of the vertices is closer to the center than the threshold, the triangle is hit
124 | if (dist0 <= dist || dist1 <= dist || dist2 <= dist)
125 | {
126 | result[id] = 1;
127 | }
128 |
129 | }
130 |
131 | __kernel void cast_box(
132 | __global float* vertices,
133 | __global float4* box,
134 | __global float* result
135 | )
136 | {
137 | int id = get_global_id(0);
138 |
139 | // store each input vertex in a float4 to simplify access
140 | float4 vertex0 = (float4)(vertices[id * 9 + 0], vertices[id * 9 + 1], vertices[id * 9 + 2], 1.0);
141 | float4 vertex1 = (float4)(vertices[id * 9 + 3], vertices[id * 9 + 4], vertices[id * 9 + 5], 1.0);
142 | float4 vertex2 = (float4)(vertices[id * 9 + 6], vertices[id * 9 + 7], vertices[id * 9 + 8], 1.0);
143 |
144 | // check for each vertex if it lies within the volume spanned by the box planes
145 | bool vertexInVolume0 = true;
146 | bool vertexInVolume1 = true;
147 | bool vertexInVolume2 = true;
148 | for (int planeId = 0; planeId < 6; planeId++)
149 | {
150 | float4 plane = box[planeId];
151 | vertexInVolume0 = vertexInVolume0 && dot(plane, vertex0) > 0;
152 | vertexInVolume1 = vertexInVolume1 && dot(plane, vertex1) > 0;
153 | vertexInVolume2 = vertexInVolume2 && dot(plane, vertex2) > 0;
154 | }
155 |
156 | // if one of the vertices was in the volume, set this triangle's result to hit
157 | if (vertexInVolume0 || vertexInVolume1 || vertexInVolume2)
158 | {
159 | result[id] = 1;
160 | }
161 | else
162 | {
163 | result[id] = -1;
164 | }
165 |
166 | }
167 |
168 |
--------------------------------------------------------------------------------
/rviz_map_plugin/src/ClusterLabelPanel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * ClusterLabelPanel.cpp
41 | *
42 | *
43 | * authors:
44 | *
45 | * Kristin Schmidt
46 | * Jan Philipp Vogtherr
47 | */
48 |
49 | #include
50 |
51 | #include
52 | #include
53 | #include
54 | #include
55 | #include
56 | #include
57 | #include
58 |
59 | #include
60 |
61 |
62 | namespace rviz_map_plugin
63 | {
64 |
65 | ClusterLabelPanel::ClusterLabelPanel(QWidget* parent)
66 | : rviz::Panel(parent)
67 | {
68 | QHBoxLayout* clusterNameLayout = new QHBoxLayout();
69 | clusterNameLayout->addWidget(new QLabel("Cluster Name:"));
70 | m_clusterNameEditor = new QLineEdit();
71 | clusterNameLayout->addWidget(m_clusterNameEditor);
72 |
73 | m_createClusterButton = new QPushButton("Create and Label Cluster");
74 |
75 | m_resetFacesButton = new QPushButton("Reset selected Faces");
76 |
77 | QVBoxLayout* layout = new QVBoxLayout();
78 | layout->addLayout(clusterNameLayout);
79 | layout->addWidget(m_createClusterButton);
80 | layout->addWidget(m_resetFacesButton);
81 | setLayout(layout);
82 |
83 | // Make signal/slot connections
84 | connect(m_clusterNameEditor, SIGNAL(editingFinished()), this, SLOT(updateClusterName()));
85 |
86 | connect(m_createClusterButton, SIGNAL(released()), this, SLOT(publish()));
87 | connect(m_resetFacesButton, SIGNAL(released()), this, SLOT(resetFaces()));
88 | }
89 |
90 | void ClusterLabelPanel::onInitialize()
91 | {
92 | // Check if the cluster label tool is already opened
93 | rviz::ToolManager* toolManager = vis_manager_->getToolManager();
94 | QStringList toolClasses = toolManager->getToolClasses();
95 | bool foundTool = false;
96 | for (int i = 0; i < toolClasses.size(); i++)
97 | {
98 | if (toolClasses.at(i).contains("ClusterLabel"))
99 | {
100 | m_tool = static_cast(toolManager->getTool(i));
101 | foundTool = true;
102 | break;
103 | }
104 | }
105 |
106 | if (!foundTool)
107 | {
108 | m_tool = static_cast(
109 | vis_manager_->getToolManager()->addTool("rviz_map_plugin/ClusterLabel")
110 | );
111 | }
112 | }
113 |
114 |
115 | void ClusterLabelPanel::setClusterName(const QString& clusterName)
116 | {
117 | m_clusterName = clusterName;
118 | Q_EMIT configChanged();
119 |
120 | // Gray out the create cluster button when the cluster name is empty
121 | m_createClusterButton->setEnabled(m_clusterName != "");
122 | }
123 |
124 | void ClusterLabelPanel::updateClusterName()
125 | {
126 | setClusterName(m_clusterNameEditor->text());
127 | }
128 |
129 | void ClusterLabelPanel::publish()
130 | {
131 | ROS_INFO("Label Panel: Publish");
132 | m_tool->publishLabel(m_clusterName.toStdString());
133 | }
134 |
135 | void ClusterLabelPanel::resetFaces()
136 | {
137 | ROS_INFO("Label panel: Reset");
138 | m_tool->resetFaces();
139 | }
140 |
141 | void ClusterLabelPanel::save(rviz::Config config) const
142 | {
143 | rviz::Panel::save(config);
144 | config.mapSetValue("ClusterName", m_clusterName);
145 | }
146 |
147 | void ClusterLabelPanel::load(const rviz::Config& config)
148 | {
149 | rviz::Panel::load(config);
150 | QString clusterName;
151 | if (config.mapGetString("ClusterName", &clusterName));
152 | {
153 | m_clusterNameEditor->setText(clusterName);
154 | updateClusterName();
155 | }
156 | }
157 |
158 | } // End namespace rviz_map_plugin
159 |
160 | #include
161 | PLUGINLIB_EXPORT_CLASS(rviz_map_plugin::ClusterLabelPanel, rviz::Panel)
162 |
--------------------------------------------------------------------------------
/rviz_map_plugin/include/ClusterLabelVisual.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * ClusterLabelVisual.hpp
41 | *
42 | *
43 | * authors:
44 | *
45 | * Kristin Schmidt
46 | */
47 |
48 | #pragma once
49 |
50 | #include
51 |
52 | #include
53 |
54 | #include
55 |
56 | #include
57 | #include
58 | #include
59 | #include
60 | #include
61 | #include
62 |
63 | #include
64 | #include
65 |
66 | namespace Ogre
67 | {
68 | // Forward declaration
69 | class SceneNode;
70 | class Mesh;
71 | } // End namespace Ogre
72 |
73 |
74 | namespace rviz_map_plugin
75 | {
76 |
77 | /**
78 | * @class ClusterLabelVisual
79 | * @brief Visual to show a labeled cluster
80 | */
81 | class ClusterLabelVisual
82 | {
83 | public:
84 |
85 | /**
86 | * @brief Constructor
87 | *
88 | * @param context The context that contains the display information.
89 | * @param labelId The label id (that has to be unique)
90 | */
91 | ClusterLabelVisual(
92 | rviz::DisplayContext* context,
93 | std::string labelId
94 | );
95 |
96 | /**
97 | * @brief Constructor
98 | *
99 | * @param context The context that contains the display information.
100 | * @param labelId The label id (that has to be unique)
101 | * @param geometry A shared pointer to the geometry to which the labels belong
102 | */
103 | ClusterLabelVisual(
104 | rviz::DisplayContext* context,
105 | std::string labelId,
106 | std::shared_ptr geometry
107 | );
108 |
109 | /**
110 | * @brief Destructor
111 | */
112 | ~ClusterLabelVisual();
113 |
114 | /**
115 | * @brief Disabling the copy constructor
116 | *
117 | * Each cluster label visual has a pointer to a SubMesh with a unique name,
118 | * when copying and then deleting one of the copies, the SubMesh would be deleted, thus the
119 | * pointers of the remaining copies would be invalid
120 | */
121 | ClusterLabelVisual(const ClusterLabelVisual&) = delete;
122 |
123 | /**
124 | * @brief Disabling the copy assignment operator
125 | *
126 | * explanation: see deleted copy constructor ClusterLabelVisual(const ClusterLabelVisual&)
127 | */
128 | ClusterLabelVisual& operator=(const ClusterLabelVisual&) = delete;
129 |
130 | /**
131 | * @brief Deletes the material
132 | */
133 | void reset();
134 |
135 | /**
136 | * @brief Sets the geometry
137 | *
138 | * @param geometry The geometry
139 | */
140 | void setGeometry(std::shared_ptr geometry);
141 |
142 | /**
143 | * @brief Sets the faces, that are in the shown cluster
144 | *
145 | * @param faces A vector containing the face ids
146 | */
147 | void setFacesInCluster(const std::vector& faces);
148 |
149 | /**
150 | * @brief Sets the color
151 | *
152 | * @param facesColor The color for the faces
153 | * @param alpha The opacity, defaults to 1.0f (fully opaque)
154 | */
155 | void setColor(Ogre::ColourValue facesColor, float alpha = 1.0f);
156 |
157 | /**
158 | * @brief Returns the faces
159 | *
160 | * @return A vector containing the face ids
161 | */
162 | std::vector getFaces()
163 | {
164 | return m_faces;
165 | };
166 |
167 | private:
168 |
169 | void initMaterial();
170 |
171 | rviz::DisplayContext* m_displayContext;
172 | Ogre::SceneNode* m_sceneNode;
173 | std::string m_labelId;
174 |
175 | Ogre::MeshPtr m_mesh;
176 | Ogre::SubMesh* m_subMesh;
177 | Ogre::MaterialPtr m_material;
178 |
179 | Ogre::ColourValue m_color;
180 |
181 | std::shared_ptr m_geometry;
182 | std::vector m_faces;
183 |
184 | };
185 |
186 | } // end namespace rviz_map_plugin
187 |
--------------------------------------------------------------------------------
/rviz_map_plugin/include/MapDisplay.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * MapDisplay.hpp
41 | *
42 | *
43 | * authors:
44 | *
45 | * Kristin Schmidt
46 | * Jan Philipp Vogtherr
47 | */
48 |
49 |
50 | #ifndef MAP_DISPLAY_HPP
51 | #define MAP_DISPLAY_HPP
52 |
53 | #include
54 |
55 | #include
56 | #include
57 | #include
58 | #include
59 | #include
60 | #include
61 |
62 | #include
63 | #include
64 | #include
65 |
66 | #include
67 | #include
68 | #include
69 |
70 | #include
71 | #include
72 | #include
73 | #include
74 | #include
75 | #include
76 |
77 | #include
78 | #include
79 | #include
80 |
81 | #include
82 | #include
83 | #include
84 |
85 | #include
86 | #include
87 | #include
88 | #include
89 | #include
90 | #include
91 | #include
92 | #include
93 | #include
94 |
95 | #include
96 |
97 | #ifndef Q_MOC_RUN
98 | #include
99 |
100 | #include
101 | #include
102 | #include
103 | #include
104 | #include
105 | #include
106 | #include
107 | #include
108 | #include
109 |
110 | #endif
111 |
112 | #include
113 | #include
114 |
115 | namespace rviz
116 | {
117 |
118 | // Forward declaration
119 | class BoolProperty;
120 | class ColorProperty;
121 | class FloatProperty;
122 | class IntProperty;
123 | class EnumProperty;
124 | class StringProperty;
125 |
126 | } // End namespace rviz
127 |
128 | namespace rviz_map_plugin
129 | {
130 |
131 | using std::shared_ptr;
132 | using std::unique_ptr;
133 | using std::string;
134 | using std::vector;
135 |
136 | /**
137 | * @class MapDisplay
138 | * @brief Master display for the Mesh- and Cluster- subdisplays. THis implementation uses HDF5 as it's data source
139 | */
140 | class MapDisplay: public rviz::Display
141 | {
142 | Q_OBJECT
143 |
144 | public:
145 | /**
146 | * @brief Constructor
147 | */
148 | MapDisplay();
149 |
150 | /**
151 | * @brief Destructor
152 | */
153 | ~MapDisplay();
154 |
155 | public Q_SLOTS:
156 |
157 | /**
158 | * @brief Saves a label to HDF5
159 | * @param cluster The cluster to be saved
160 | */
161 | void saveLabel(Cluster cluster);
162 |
163 | /**
164 | * @brief Get the geometry
165 | * @return The geometry
166 | */
167 | shared_ptr getGeometry();
168 |
169 | private Q_SLOTS:
170 |
171 | /**
172 | * @brief Update the map, based on the current data state
173 | */
174 | void updateMap();
175 |
176 | private:
177 |
178 | /**
179 | * @brief RViz callback on initialize
180 | */
181 | void onInitialize();
182 |
183 | /**
184 | * @brief RViz callback on enable
185 | */
186 | void onEnable();
187 |
188 | /**
189 | * @brief RViz callback on disable
190 | */
191 | void onDisable();
192 |
193 | /**
194 | * @brief Read all data from the HDF5 file and save it in the member variables
195 | * @return true, if successful
196 | */
197 | bool loadData();
198 |
199 | /// Geometry
200 | shared_ptr m_geometry;
201 | /// Materials
202 | vector m_materials;
203 | /// Textures
204 | vector m_textures;
205 | /// Colors
206 | vector m_colors;
207 | /// Vertex normals
208 | vector m_normals;
209 | /// Texture coordinates
210 | vector m_texCoords;
211 | /// Clusters
212 | vector m_clusterList;
213 |
214 | /// Path to map file
215 | rviz::StringProperty* m_mapFilePath;
216 |
217 | /// Subdisplay: ClusterLabel (for showing the clusters)
218 | rviz_map_plugin::ClusterLabelDisplay* m_clusterLabelDisplay;
219 | /// Subdisplay: MeshDisplay (for showing the mesh)
220 | rviz_map_plugin::MeshDisplay* m_meshDisplay;
221 |
222 | /**
223 | * @brief Create a RViz display from it's unique class_id
224 | * @param class_id The class ID
225 | * @return Pointer to RViz display
226 | */
227 | rviz::Display* createDisplay(const QString& class_id);
228 | };
229 |
230 | } // end namespace rviz_map_plugin
231 |
232 | #endif
233 |
--------------------------------------------------------------------------------
/rviz_mesh_plugin/src/face_selection_tool.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Software License Agreement (BSD License)
3 | *
4 | * Robot Operating System code by the University of Osnabrück
5 | * Copyright (c) 2015, University of Osnabrück
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions
10 | * are met:
11 | *
12 | * 1. Redistributions of source code must retain the above
13 | * copyright notice, this list of conditions and the following
14 | * disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above
17 | * copyright notice, this list of conditions and the following
18 | * disclaimer in the documentation and/or other materials provided
19 | * with the distribution.
20 | *
21 | * 3. Neither the name of the copyright holder nor the names of its
22 | * contributors may be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | *
40 | * face_selection_tool.h
41 | *
42 | * authors: Henning Deeken
43 | * Sebastian Pütz
44 | * Tristan Igelbrink
45 | * Johannes Heitmann
46 | * Marcel Mrozinski
54 | #include