Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS2 - Humble #26

Merged
merged 40 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
98c249b
added assimp
amock May 16, 2023
1ff1a3e
integrated assimp transforms for scaled, moved, or rotated meshes
amock May 16, 2023
a84506e
added file filters for common mesh file types once assimp is available
amock May 16, 2023
1823ab8
added functionality to override rviz config with ros params
amock Sep 7, 2023
72881ee
ported hdf5_map_io to ros2 humple. COLCON_IGNORE are TODOs.
amock Nov 6, 2023
aee249c
ament_cmake to package xml
amock Nov 6, 2023
9070fe5
ported mesh_msgs to ros2 humble
amock Nov 7, 2023
6bfdd2d
c++17 for mesh_msgs and hdf5_map_io
amock Nov 7, 2023
5ac5f08
ported label_manager to ros2 humble
amock Nov 7, 2023
0187c1d
added params
amock Nov 7, 2023
af7f512
ported mesh_msgs_hdf5. fixed library install / export of hdf5_map_io
amock Nov 7, 2023
abc73b3
ported mesh_msgs_conversions to ros2 humble
amock Nov 8, 2023
7620635
added readmes and todos
amock Nov 8, 2023
32a2ae4
started to port rviz_map_plugin
amock Nov 8, 2023
5dafd89
added comment
amock Nov 9, 2023
b0d59ee
more fixes
amock Nov 9, 2023
9a79358
fixes
amock Nov 9, 2023
6e151f7
mesh display compiles?
amock Nov 9, 2023
f2ba4b1
figured out how to convert multithreaded spinning
amock Nov 9, 2023
69759d1
more changes
amock Nov 9, 2023
bfd0dac
mesh visual is compiling
amock Nov 9, 2023
ada9765
mesh display and mesh visual are compiling
amock Nov 9, 2023
b786ebd
fixed message filters for new rviz transfomer types. replaced hacky r…
amock Nov 9, 2023
79edf65
new name. map only can be confused with other map types
amock Nov 10, 2023
f9c8e1c
since there are more plugins than only mesh map I renamed it again
amock Nov 10, 2023
dd3ad2a
plugin xml is now equal to rviz_default_plugins
amock Nov 10, 2023
a7d94aa
ported RVizFileProperty. MeshPoseTool uses a lot of functions that ha…
amock Nov 10, 2023
71fd32a
passive visualizations are working now. interactions are still missin…
amock Nov 13, 2023
5eae862
added todos
amock Nov 13, 2023
d275a93
disabled cluster tool for none-h5 files
amock Nov 13, 2023
3ab0786
supporting vertex colors for assimp loading
amock Nov 13, 2023
8e96a98
mesh pose tool is working again. needed to replace raycasting operati…
amock Nov 13, 2023
e8017ed
fixed mesh pose tool
amock Nov 14, 2023
1d1969a
replaced assimp with rviz_assimp_vendor
amock Nov 14, 2023
a6c8f7a
moved raycasting operations to one file. better reusage
amock Nov 14, 2023
ea0a910
fixes. storing rviz config is not working
amock Nov 14, 2023
65a8736
ported mesh_msgs_transform
amock Nov 14, 2023
6d83bfb
added some prints. still segfault for cluster label tool
amock Nov 14, 2023
791b8c7
label tool for single clicks is working again
amock Nov 14, 2023
c6fd189
used rclcpp prints
amock Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 46 additions & 18 deletions hdf5_map_io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,76 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
project(hdf5_map_io)

set(CMAKE_CXX_STANDARD 14)
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(catkin REQUIRED)
# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(LVR2 REQUIRED)
find_package(MPI)
find_package(PkgConfig REQUIRED)

catkin_package(
INCLUDE_DIRS include
LIBRARIES hdf5_map_io
DEPENDS LVR2 MPI
)

# HighFive
set(HIGHFIVE_EXAMPLES FALSE)
set(HIGHFIVE_UNIT_TESTS FALSE)

find_library(LVR2_LIBRARY NAMES lvr2)


include_directories(
include
${LVR2_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME}
add_library(${PROJECT_NAME} SHARED
src/hdf5_map_io.cpp
)

find_library(LVR2_LIBRARY NAMES lvr2)
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} PUBLIC
${LVR2_LIBRARY}
${MPI_CXX_LIBRARIES}
rclcpp::rclcpp
)

target_compile_definitions(${PROJECT_NAME} PRIVATE "HDF5_MAP_IO_BUILDING_DLL")

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

install(DIRECTORY include/
DESTINATION include
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(${PROJECT_NAME})

# Export modern CMake targets
ament_export_targets(export_${PROJECT_NAME})

ament_export_dependencies(
rclcpp
)

ament_package()
12 changes: 10 additions & 2 deletions hdf5_map_io/package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>hdf5_map_io</name>
<version>1.1.0</version>
<description>The hdf5_map_io package</description>
Expand All @@ -8,8 +9,15 @@
<url type="website">http://wiki.ros.org/ros_mesh_tools/hdf5_map_io</url>
<author email="[email protected]">Sebastian Pütz</author>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
<depend>boost</depend>
<depend>lvr2</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
100 changes: 66 additions & 34 deletions label_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,84 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(label_manager)

find_package(catkin REQUIRED COMPONENTS
actionlib
actionlib_msgs
genmsg
mesh_msgs
message_generation
roscpp
sensor_msgs
std_msgs
tf
)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

add_service_files(FILES
DeleteLabel.srv
GetLabelGroups.srv
GetLabeledClusterGroup.srv
)
find_package(ament_cmake REQUIRED)

generate_messages(DEPENDENCIES
mesh_msgs
std_msgs

find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(actionlib_msgs REQUIRED)
find_package(mesh_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)

find_package(Boost COMPONENTS
system
filesystem
)

catkin_package(
CATKIN_DEPENDS
actionlib actionlib_msgs genmsg mesh_msgs message_generation message_runtime roscpp sensor_msgs std_msgs tf

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/DeleteLabel.srv"
"srv/GetLabelGroups.srv"
"srv/GetLabeledClusterGroup.srv"
DEPENDENCIES
mesh_msgs
std_msgs
ADD_LINTER_TESTS
)


include_directories(
include ${catkin_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
include
)


add_executable(${PROJECT_NAME}
add_executable(${PROJECT_NAME}_node
src/manager.cpp
src/manager_node.cpp)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}

add_dependencies(${PROJECT_NAME}_node
${PROJECT_NAME}
)

target_link_libraries(${PROJECT_NAME}_node
Boost::system
Boost::filesystem
)

ament_target_dependencies(${PROJECT_NAME}_node
rclcpp
rclcpp_action
rclcpp_components
actionlib_msgs
mesh_msgs
sensor_msgs
std_msgs
)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
install(TARGETS ${PROJECT_NAME}_node
ARCHIVE DESTINATION lib/${PROJECT_NAME}
LIBRARY DESTINATION lib/${PROJECT_NAME}
RUNTIME DESTINATION bin/${PROJECT_NAME}
)

rosidl_get_typesupport_target(cpp_typesupport_target
${PROJECT_NAME} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME}_node
"${cpp_typesupport_target}")


ament_export_dependencies(rosidl_default_runtime)
ament_package()

65 changes: 41 additions & 24 deletions label_manager/include/label_manager/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,63 @@
#define LABEL_MANAGER_H_

#include <vector>
#include <chrono>
#include <functional>
#include <memory>
#include <string>

#include "mesh_msgs/msg/mesh_face_cluster_stamped.hpp"
#include "mesh_msgs/srv/get_labeled_clusters.hpp"
#include "label_manager/srv/get_label_groups.hpp"
#include "label_manager/srv/get_labeled_cluster_group.hpp"
#include "label_manager/srv/delete_label.hpp"

#include "rclcpp/rclcpp.hpp"

#include <ros/ros.h>
#include <mesh_msgs/MeshFaceClusterStamped.h>
#include <mesh_msgs/GetLabeledClusters.h>
#include <label_manager/GetLabelGroups.h>
#include <label_manager/GetLabeledClusterGroup.h>
#include <label_manager/DeleteLabel.h>

namespace label_manager
{

class LabelManager
class LabelManager : public rclcpp::Node
{
public:
LabelManager(ros::NodeHandle& nodeHandle);
LabelManager(std::string handle_str = "");

private:
ros::NodeHandle nh;
ros::Subscriber clusterLabelSub;
ros::Publisher newClusterLabelPub;
ros::ServiceServer srv_get_labeled_clusters;
ros::ServiceServer srv_get_label_groups;
ros::ServiceServer srv_get_labeled_cluster_group;
ros::ServiceServer srv_delete_label;
// Subscriber
rclcpp::Subscription<mesh_msgs::msg::MeshFaceClusterStamped>::SharedPtr
clusterLabelSub;

// Publisher
rclcpp::Publisher<mesh_msgs::msg::MeshFaceCluster>::SharedPtr
newClusterLabelPub;

// Service (Servers)
rclcpp::Service<mesh_msgs::srv::GetLabeledClusters>::SharedPtr
srv_get_labeled_clusters;
rclcpp::Service<label_manager::srv::GetLabelGroups>::SharedPtr
srv_get_label_groups;
rclcpp::Service<label_manager::srv::GetLabeledClusterGroup>::SharedPtr
srv_get_labeled_cluster_group;
rclcpp::Service<label_manager::srv::DeleteLabel>::SharedPtr
srv_delete_label;

std::string folderPath;

void clusterLabelCallback(const mesh_msgs::MeshFaceClusterStamped::ConstPtr& msg);
void clusterLabelCallback(const mesh_msgs::msg::MeshFaceClusterStamped& msg);

bool service_getLabeledClusters(
mesh_msgs::GetLabeledClusters::Request& req,
mesh_msgs::GetLabeledClusters::Response& res);
const std::shared_ptr<mesh_msgs::srv::GetLabeledClusters::Request> req,
std::shared_ptr<mesh_msgs::srv::GetLabeledClusters::Response> res);
bool service_getLabelGroups(
label_manager::GetLabelGroups::Request& req,
label_manager::GetLabelGroups::Response& res);
const std::shared_ptr<label_manager::srv::GetLabelGroups::Request> req,
std::shared_ptr<label_manager::srv::GetLabelGroups::Response> res);
bool service_getLabeledClusterGroup(
label_manager::GetLabeledClusterGroup::Request& req,
label_manager::GetLabeledClusterGroup::Response& res);
const std::shared_ptr<label_manager::srv::GetLabeledClusterGroup::Request> req,
std::shared_ptr<label_manager::srv::GetLabeledClusterGroup::Response> res);
bool service_deleteLabel(
label_manager::DeleteLabel::Request& req,
label_manager::DeleteLabel::Response& res);
const std::shared_ptr<label_manager::srv::DeleteLabel::Request> req,
std::shared_ptr<label_manager::srv::DeleteLabel::Response> res);

bool writeIndicesToFile(const std::string& fileName, const std::vector<uint>& indices, const bool append);
std::vector<uint> readIndicesFromFile(const std::string& fileName);
Expand Down
50 changes: 24 additions & 26 deletions label_manager/package.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<package>
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>label_manager</name>
<description>
Serving and persisting label information
</description>
<version>1.1.0</version>
<description>Serving and persisting label information</description>
<maintainer email="[email protected]">Sebastian Pütz</maintainer>

<url type="website">http://wiki.ros.org/ros_mesh_tools/label_manager</url>
Expand All @@ -13,27 +13,25 @@

<license>BSD-3</license>

<build_depend>actionlib_msgs</build_depend>
<build_depend>actionlib</build_depend>
<build_depend>genmsg</build_depend>
<build_depend>mesh_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>tf</build_depend>

<run_depend>actionlib_msgs</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>genmsg</run_depend>
<run_depend>mesh_msgs</run_depend>
<run_depend>message_generation</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>tf</run_depend>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>rclcpp</depend>
<depend>rclcpp_action</depend>
<depend>rclcpp_components</depend>
<depend>actionlib_msgs</depend>
<depend>mesh_msgs</depend>
<depend>sensor_msgs</depend>
<depend>std_msgs</depend>


<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading
Loading