Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fdc4c9c
Fixed location of GLUT framework on macOS
nkalupahana May 26, 2021
1831a6b
Update CMakeLists.txt
nkalupahana May 26, 2021
ed279a4
Update CMakeLists.txt
nkalupahana May 26, 2021
c5b597d
Update CMakeLists.txt
nkalupahana May 26, 2021
bcf5928
Update CMakeLists.txt
nkalupahana May 26, 2021
8bcef3b
Update CMakeLists.txt
nkalupahana May 27, 2021
1279415
Update gl_renderer.cpp
nkalupahana May 27, 2021
131a28a
Update gl_renderer.cpp
nkalupahana May 27, 2021
9de53f0
Revert include changes
nkalupahana May 27, 2021
391f6d2
glew/glut linking fixes (temp)
nkalupahana Jun 8, 2021
da802ab
stabilization for glut and glew for mac
nkalupahana Jun 8, 2021
51ded29
Merge branch 'ros-planning:main' into patch-1
nkalupahana Jun 8, 2021
84ad79a
mark dep for only apple
nkalupahana Jun 8, 2021
49c92ed
Merge branch 'patch-1' of https://github.com/nkalupahana/moveit2 into…
nkalupahana Jun 8, 2021
98afb1e
revert cmake version change
nkalupahana Jun 8, 2021
9addf97
Merge branch 'ros-planning:main' into patch-1
nkalupahana Jun 12, 2021
ae88ec8
Fix "ld can't link -lode" issue
nkalupahana Jun 13, 2021
6f8189b
Revert changes
nkalupahana Jun 13, 2021
e9e113d
Merge branch 'main' into patch-1
nkalupahana Jun 16, 2021
3dda2cf
formatting fixes
nkalupahana Jun 16, 2021
977fbc4
switch to one variable for glut and glew
nkalupahana Jun 17, 2021
4846050
Merge branch 'main' into patch-1
nkalupahana Jun 21, 2021
90ebdae
Merge branch 'main' into patch-1
nkalupahana Jun 22, 2021
7c9dc82
Merge branch 'main' into patch-1
nkalupahana Jun 28, 2021
76cbad4
Merge branch 'main' into patch-1
henningkayser Jun 28, 2021
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
9 changes: 8 additions & 1 deletion moveit_ros/perception/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ if(WITH_OPENGL)
endif()
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLUT REQUIRED)

set(gl_LIBS ${gl_LIBS} ${OPENGL_LIBRARIES})
if(APPLE)
find_package(FreeGLUT REQUIRED)
set(SYSTEM_GL_LIBRARIES ${GLEW_LIBRARIES} GLEW::GLEW FreeGLUT::freeglut)
else()
find_package(GLUT REQUIRED)
set(SYSTEM_GL_LIBRARIES ${GLEW_LIBRARIES} GLUT::GLUT)
endif()
set(perception_GL_INCLUDE_DIRS "mesh_filter/include" "depth_image_octomap_updater/include")
set(SYSTEM_GL_INCLUDE_DIRS ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using ament_target_dependencies doesn't work, I'd suggest adding a SYSTEM_GL_LIBRARIES variable like this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, did that!

endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ bool DepthImageOctomapUpdater::initialize(const rclcpp::Node::SharedPtr& node)
mesh_filter_->setShadowThreshold(shadow_threshold_);
mesh_filter_->setPaddingOffset(padding_offset_);
mesh_filter_->setPaddingScale(padding_scale_);
mesh_filter_->setTransformCallback(boost::bind(&DepthImageOctomapUpdater::getShapeTransform, this, _1, _2));
mesh_filter_->setTransformCallback(boost::bind(&DepthImageOctomapUpdater::getShapeTransform, this,
boost::placeholders::_1, boost::placeholders::_2));

// init rclcpp time default value
last_update_time_ = node_->now();
Expand All @@ -140,9 +141,11 @@ void DepthImageOctomapUpdater::start()

pub_filtered_label_image_ = filtered_label_transport_->advertiseCamera("filtered_label", 1);

sub_depth_image_ = image_transport::create_camera_subscription(
node_.get(), image_topic_, boost::bind(&DepthImageOctomapUpdater::depthImageCallback, this, _1, _2), "raw",
custom_qos);
sub_depth_image_ =
image_transport::create_camera_subscription(node_.get(), image_topic_,
boost::bind(&DepthImageOctomapUpdater::depthImageCallback, this,
boost::placeholders::_1, boost::placeholders::_2),
"raw", custom_qos);
}

void DepthImageOctomapUpdater::stop()
Expand Down
3 changes: 3 additions & 0 deletions moveit_ros/perception/lazy_free_space_updater/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ add_library(${MOVEIT_LIB_NAME} SHARED src/lazy_free_space_updater.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES LINK_FLAGS "${OpenMP_CXX_FLAGS}")
if(APPLE)
target_link_libraries(${MOVEIT_LIB_NAME} OpenMP::OpenMP_CXX)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try setting OpenMP with ament_target_dependencies?

Copy link
Contributor Author

@nkalupahana nkalupahana Jun 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, using ament_target_dependencies(${MOVEIT_LIB_NAME} OpenMP) leads to a linker error. https://github.com/nkalupahana/ros2-foxy-macos/runs/2841920686?check_suite_focus=true

target_link_libraries seems to be necessary. Is that okay?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henningkayser ament_target_dependencies and target_link_libraries do two different things. ament_target_dependencies adds those dependencies to the list that gets set in the export target, where-as target_link_libraries configures linking. In this case we might need both, I'm not sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjw ament_target_dependencies calls target_link_libraries internally and also configures include directories and other compile definitions. A well configured package should always work with ament_target_dependencies if the variables follow conventions. See https://github.com/ament/ament_cmake/blob/master/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake#L21

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine if OpenMP doesn't work here, though

endif()
ament_target_dependencies(${MOVEIT_LIB_NAME}
rclcpp
moveit_ros_occupancy_map_monitor
Expand Down
3 changes: 2 additions & 1 deletion moveit_ros/perception/mesh_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ ament_target_dependencies(${MOVEIT_LIB_NAME}
Eigen3
Boost
)
target_link_libraries(${MOVEIT_LIB_NAME} ${gl_LIBS} GLUT::GLUT ${GLEW_LIBRARIES})

target_link_libraries(${MOVEIT_LIB_NAME} ${gl_LIBS} ${SYSTEM_GL_LIBRARIES})

# TODO: Port to ROS2
# add_library(moveit_depth_self_filter SHARED
Expand Down
2 changes: 1 addition & 1 deletion moveit_ros/perception/mesh_filter/src/gl_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
#include <GL/glut.h>
#endif
#include <GL/freeglut.h>
#include <moveit/mesh_filter/gl_renderer.h>
#include <sstream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ bool PointCloudOctomapUpdater::initialize(const rclcpp::Node::SharedPtr& node)
tf_buffer_->setCreateTimerInterface(create_timer_interface);
tf_listener_.reset(new tf2_ros::TransformListener(*tf_buffer_));
shape_mask_.reset(new point_containment_filter::ShapeMask());
shape_mask_->setTransformCallback(boost::bind(&PointCloudOctomapUpdater::getShapeTransform, this, _1, _2));
shape_mask_->setTransformCallback(boost::bind(&PointCloudOctomapUpdater::getShapeTransform, this,
boost::placeholders::_1, boost::placeholders::_2));
last_update_time_ = node_->now();
return true;
}
Expand All @@ -104,13 +105,15 @@ void PointCloudOctomapUpdater::start()
{
point_cloud_filter_ = new tf2_ros::MessageFilter<sensor_msgs::msg::PointCloud2>(
*point_cloud_subscriber_, *tf_buffer_, monitor_->getMapFrame(), 5, node_);
point_cloud_filter_->registerCallback(boost::bind(&PointCloudOctomapUpdater::cloudMsgCallback, this, _1));
point_cloud_filter_->registerCallback(
boost::bind(&PointCloudOctomapUpdater::cloudMsgCallback, this, boost::placeholders::_1));
RCLCPP_INFO(LOGGER, "Listening to '%s' using message filter with target frame '%s'", point_cloud_topic_.c_str(),
point_cloud_filter_->getTargetFramesString().c_str());
}
else
{
point_cloud_subscriber_->registerCallback(boost::bind(&PointCloudOctomapUpdater::cloudMsgCallback, this, _1));
point_cloud_subscriber_->registerCallback(
boost::bind(&PointCloudOctomapUpdater::cloudMsgCallback, this, boost::placeholders::_1));
RCLCPP_INFO(LOGGER, "Listening to '%s'", point_cloud_topic_.c_str());
}
}
Expand Down