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

Humble #27

Draft
wants to merge 66 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
035fd76
setup
spelletier1996 Apr 16, 2024
c942992
Fixed headers
tmayoff Apr 16, 2024
1049ee3
More work commenting out things
tmayoff Apr 16, 2024
1f75d92
More commenting, Almost compiles, just need to translate subscribers …
tmayoff Apr 16, 2024
cd4dd6d
Merge pull request #1 from tmayoff/humble
spelletier1996 Apr 16, 2024
cb370d8
in progress
spelletier1996 Apr 16, 2024
0977645
in progress
spelletier1996 Apr 16, 2024
d78de54
builds
spelletier1996 Apr 16, 2024
e58192c
started converting params
spelletier1996 Apr 16, 2024
37617c4
Working on reverting CMake changes
tmayoff Apr 17, 2024
9d8dd0b
Cleaning up Cmake
tmayoff Apr 17, 2024
d26d8c6
Started readding tests
tmayoff Apr 17, 2024
263fc14
minor things
tmayoff Apr 17, 2024
f3daa57
Tests not working
tmayoff Apr 17, 2024
ecadaa4
added param declerations
spelletier1996 Apr 17, 2024
f63b098
re-added protected
spelletier1996 Apr 17, 2024
985f08f
params continued
spelletier1996 Apr 17, 2024
a18523b
finished get params
spelletier1996 Apr 17, 2024
326b237
added sphere msg, finished params
spelletier1996 Apr 17, 2024
aa0e486
Merge pull request #5 from spelletier1996/humble-dev
spelletier1996 Apr 17, 2024
8d0a370
Formatting (#7)
tmayoff Apr 18, 2024
3387ef6
clang format
spelletier1996 Apr 18, 2024
7487e3e
Robot Description Update ROS2 edition
spelletier1996 Apr 18, 2024
5176596
Merge branch 'humble' into humble
tmayoff Apr 18, 2024
4fb943a
Update main.yml
tmayoff Apr 18, 2024
64092d7
urdf model loading
spelletier1996 Apr 18, 2024
b03850a
adding watchdog to cmake
spelletier1996 Apr 18, 2024
b20b072
tfwatchdogport
spelletier1996 Apr 18, 2024
ba403ef
Switch to shared ptr for better portability between threads
spelletier1996 Apr 18, 2024
09b6400
Merge pull request #9 from tmayoff/patch-1
spelletier1996 Apr 18, 2024
46d7aac
error msgs and computeBoundingBox
spelletier1996 Apr 18, 2024
782eeb9
Merge pull request #8 from spelletier1996/publishers-and-subscribers
spelletier1996 Apr 18, 2024
c74a838
Merge branch 'humble' into humble
tmayoff Apr 19, 2024
d316ea2
Added more tests
tmayoff Apr 19, 2024
95bc2c7
Another test
tmayoff Apr 19, 2024
1117576
Fixed added pcl to package.xml, and allow CI to jobs to continue if o…
tmayoff Apr 19, 2024
eb4e75d
Add rosidl_default_generators to package.xml
tmayoff Apr 19, 2024
f185e5a
Merge pull request #3 from tmayoff/humble
spelletier1996 Apr 19, 2024
f6f479e
Fixed obb
tmayoff Apr 19, 2024
b9087ca
Merge pull request #10 from tmayoff/humble
tmayoff Apr 19, 2024
196cc83
Fixed more cmake stuff
tmayoff Apr 19, 2024
b33f9b0
Merge pull request #11 from spelletier1996/cmake
spelletier1996 Apr 19, 2024
ea4d12d
fixed warnings
spelletier1996 Apr 19, 2024
c1051b9
removed local obb files
spelletier1996 Apr 22, 2024
f286770
cmake tests
spelletier1996 Apr 23, 2024
fd09c31
include fix
spelletier1996 Apr 23, 2024
35a07e6
missing sources
spelletier1996 Apr 23, 2024
787487f
Mostly functional
spelletier1996 Apr 25, 2024
c31ede8
runs an entire update loop without getting stuck
spelletier1996 Apr 26, 2024
8002531
working kinda of
spelletier1996 Apr 29, 2024
d2ea7c7
removed debug msgs, fixed depends, parsing urdf
spelletier1996 May 1, 2024
098283f
cleanup, debug msgs
spelletier1996 May 1, 2024
dd5f664
working, geometric shapes problem
spelletier1996 May 2, 2024
238f2aa
disabling obb dependent code
spelletier1996 May 6, 2024
8e736e4
disabled obb related
spelletier1996 May 6, 2024
db88ebc
debug msgs cleanup
spelletier1996 May 6, 2024
57ec132
debug msgs
spelletier1996 May 6, 2024
7eff08e
cleanup
spelletier1996 May 6, 2024
feeaf38
fixed warnings
spelletier1996 May 7, 2024
6e8456a
Merge pull request #21 from Guidebolt/fixing-warnings
spelletier1996 May 7, 2024
cc8ec81
removed removing ros1 remenants
spelletier1996 May 7, 2024
e160d7b
Merge pull request #22 from Guidebolt/Fixing-build-errors
spelletier1996 May 7, 2024
ba58afe
Merge pull request #18 from Guidebolt/body-filter-debugging
spelletier1996 Jun 13, 2024
b19a591
Fixed header inclusion, at least for jazzy & onward
tmayoff Jul 17, 2024
d0d0cf3
Switched to just the .hpp file rather than the weird double directory…
tmayoff Jul 17, 2024
1b58912
Fixed build on jazzy (should also work on humble)
tmayoff Jul 29, 2024
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
16 changes: 16 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
BasedOnStyle: Google

ColumnLimit: 120
SortIncludes: Never
ReflowComments: false
ReferenceAlignment: Left
PointerAlignment: Left
FixNamespaceComments: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterStruct: true
BreakConstructorInitializers: AfterColon
PackConstructorInitializers: BinPack
---

6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on: [push, pull_request] # on all pushes and PRs

jobs:
industrial_ci:
continue-on-error: true

strategy:
matrix:
env:
- {ROS_DISTRO: melodic, ROS_REPO: testing}
- {ROS_DISTRO: noetic, ROS_REPO: testing}
- {ROS_DISTRO: humble, ROS_REPO: testing}
- {ROS_DISTRO: rolling, ROS_REPO: testing}
env:
CCACHE_DIR: /github/home/.ccache # Directory for ccache (and how we enable ccache in industrial_ci)
runs-on: ubuntu-latest
Expand Down
168 changes: 84 additions & 84 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,24 @@ else()
add_compile_options(-DROBOT_BODY_FILTER_USE_CXX_OPTIONAL=0)
endif()

set(THIS_PACKAGE_DEPS dynamic_reconfigure filters geometric_shapes laser_geometry moveit_core moveit_ros_perception roscpp sensor_msgs tf2 tf2_ros urdf visualization_msgs)
set(THIS_PACKAGE_DEPS backward_ros urdf urdf_parser_plugin filters geometric_shapes laser_geometry moveit_core moveit_ros_perception rclcpp sensor_msgs std_srvs pcl_conversions tf2 tf2_ros tf2_eigen tf2_sensor_msgs urdf visualization_msgs GLUT OpenCV)
set(MESSAGE_DEPS geometry_msgs std_msgs)

find_package(catkin REQUIRED COMPONENTS ${THIS_PACKAGE_DEPS} ${MESSAGE_DEPS} message_generation pcl_conversions tf2_eigen tf2_sensor_msgs)
find_package(PCL REQUIRED COMPONENTS common filters)
find_package(Threads REQUIRED)
find_package(ament_cmake REQUIRED)

find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBFCL_PC REQUIRED fcl)
# find *absolute* paths to LIBFCL_* paths
find_path(LIBFCL_INCLUDE_DIRS fcl/config.h HINTS ${LIBFCL_PC_INCLUDE_DIR} ${LIBFCL_PC_INCLUDE_DIRS})
set(LIBFCL_LIBRARIES)
foreach(_lib ${LIBFCL_PC_LIBRARIES})
find_library(_lib_${_lib} ${_lib} HINTS ${LIBFCL_PC_LIBRARY_DIRS})
list(APPEND LIBFCL_LIBRARIES ${_lib_${_lib}})
foreach(Dependency IN ITEMS ${THIS_PACKAGE_DEPS})
find_package(${Dependency} REQUIRED)
endforeach()

find_package(PCL REQUIRED COMPONENTS common filters)
find_package(Threads REQUIRED)

add_message_files(FILES OrientedBoundingBox.msg OrientedBoundingBoxStamped.msg Sphere.msg SphereStamped.msg)
generate_messages(DEPENDENCIES ${MESSAGE_DEPS})
find_package(PkgConfig REQUIRED)

catkin_package(
CATKIN_DEPENDS ${THIS_PACKAGE_DEPS} ${MESSAGE_DEPS} message_runtime
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} RayCastingShapeMask TFFramesWatchdog ${PROJECT_NAME}_utils
)
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}_msgs "msg/OrientedBoundingBox.msg" "msg/OrientedBoundingBoxStamped.msg" DEPENDENCIES ${MESSAGE_DEPS} LIBRARY_NAME ${PROJECT_NAME})

include_directories(SYSTEM ${LIBFCL_INCLUDE_DIRS})
include_directories(include ${catkin_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
include_directories(include include/${PROJECT_NAME} include/${PROJECT_NAME}/utils)

set(UTILS_SRCS
src/utils/bodies.cpp
Expand All @@ -48,100 +37,111 @@ set(UTILS_SRCS
src/utils/string_utils.cpp
src/utils/tf2_eigen.cpp
src/utils/tf2_sensor_msgs.cpp
src/utils/time_utils.cpp)

if (PCL_VERSION VERSION_LESS "1.10")
set(UTILS_SRCS ${UTILS_SRCS} src/utils/crop_box.cpp)
endif()

src/utils/time_utils.cpp
)
add_library(${PROJECT_NAME}_utils ${UTILS_SRCS})
target_link_libraries(${PROJECT_NAME}_utils ${catkin_LIBRARIES} ${LIBFCL_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_utils ${PCL_LIBRARIES})
ament_target_dependencies(${PROJECT_NAME}_utils ${THIS_PACKAGE_DEPS})
ament_export_libraries(${PROJECT_NAME}_utils)

add_library(tf2_sensor_msgs_rbf src/utils/tf2_sensor_msgs.cpp)
target_link_libraries(tf2_sensor_msgs_rbf PRIVATE ${PROJECT_NAME}_utils PUBLIC ${catkin_LIBRARIES})
add_dependencies(tf2_sensor_msgs_rbf ${catkin_EXPORTED_TARGETS})
target_link_libraries(tf2_sensor_msgs_rbf ${PROJECT_NAME}_utils)
ament_export_libraries(tf2_sensor_msgs_rbf)

add_library(RayCastingShapeMask src/RayCastingShapeMask.cpp)
target_link_libraries(RayCastingShapeMask ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
add_dependencies(RayCastingShapeMask ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(RayCastingShapeMask ${PROJECT_NAME}_utils)

add_library(TFFramesWatchdog src/TFFramesWatchdog.cpp)
target_link_libraries(TFFramesWatchdog ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
add_dependencies(TFFramesWatchdog ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(TFFramesWatchdog ${PROJECT_NAME}_utils)

add_library(${PROJECT_NAME} src/RobotBodyFilter.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME}
${PROJECT_NAME}_utils
tf2_sensor_msgs_rbf
TFFramesWatchdog
RayCastingShapeMask
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
ament_target_dependencies(${PROJECT_NAME} ${THIS_PACKAGE_DEPS})

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(DIRECTORY include/
DESTINATION include)

install(TARGETS ${PROJECT_NAME} TFFramesWatchdog RayCastingShapeMask ${PROJECT_NAME}_utils tf2_sensor_msgs_rbf
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

install(FILES laser_filters.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/)
install(TARGETS ${PROJECT_NAME} TFFramesWatchdog RayCastingShapeMask tf2_sensor_msgs_rbf ${PROJECT_NAME}_utils
EXPORT export_${PROJECT_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)

install(FILES rviz/debug.rviz
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/rviz)
DESTINATION share/rviz)

if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
if (BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)

catkin_add_gtest(test_set_utils test/test_set_utils.cpp)
target_link_libraries(test_set_utils ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
ament_add_gtest(test_set_utils test/test_set_utils.cpp)
target_link_libraries(test_set_utils ${PROJECT_NAME}_utils)
ament_target_dependencies(test_set_utils ${THIS_PACKAGE_DEPS})

catkin_add_gtest(test_shapes_rbf test/test_shapes.cpp)
target_link_libraries(test_shapes_rbf ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
ament_add_gtest(test_shapes_rbf test/test_shapes.cpp)
target_link_libraries(test_shapes_rbf ${PROJECT_NAME}_utils)
ament_target_dependencies(test_shapes_rbf ${THIS_PACKAGE_DEPS})

catkin_add_gtest(test_urdf_eigen test/test_urdf_eigen.cpp)
target_link_libraries(test_urdf_eigen ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_urdf_eigen test/test_urdf_eigen.cpp)
# target_link_libraries(test_urdf_eigen ${PROJECT_NAME}_utils)

catkin_add_gtest(test_time_utils test/test_time_utils.cpp)
target_link_libraries(test_time_utils ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_time_utils test/test_time_utils.cpp)
# target_link_libraries(test_time_utils ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

catkin_add_gtest(test_tf2_eigen test/test_tf2_eigen.cpp)
target_link_libraries(test_tf2_eigen ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_tf2_eigen test/test_tf2_eigen.cpp)
# target_link_libraries(test_tf2_eigen ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

catkin_add_gtest(test_string_utils test/test_string_utils.cpp)
target_link_libraries(test_string_utils ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_string_utils test/test_string_utils.cpp)
# target_link_libraries(test_string_utils ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

catkin_add_gtest(test_bodies test/test_bodies.cpp)
target_link_libraries(test_bodies ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_bodies test/test_bodies.cpp)
# ament_target_dependencies(test_bodies ${THIS_PACKAGE_DEPS})
# target_link_libraries(test_bodies ${PROJECT_NAME} ${PROJECT_NAME}_utils)

catkin_add_gtest(test_cloud test/test_cloud.cpp)
target_link_libraries(test_cloud ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_cloud test/test_cloud.cpp)
# target_link_libraries(test_cloud ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

catkin_add_gtest(test_tf2_sensor_msgs test/test_tf2_sensor_msgs.cpp)
target_link_libraries(test_tf2_sensor_msgs tf2_sensor_msgs_rbf ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_tf2_sensor_msgs test/test_tf2_sensor_msgs.cpp)
# target_link_libraries(test_tf2_sensor_msgs tf2_sensor_msgs_rbf ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

catkin_add_gtest(test_xmlrpc_traits test/test_xmlrpc_traits.cpp)
target_link_libraries(test_xmlrpc_traits ${PROJECT_NAME}_utils ${catkin_LIBRARIES})
# ament_add_gtest(test_xmlrpc_traits test/test_xmlrpc_traits.cpp)
# target_link_libraries(test_xmlrpc_traits ${PROJECT_NAME}_utils ${catkin_LIBRARIES})

add_rostest_gtest(test_filter_utils test/test_filter_utils.test test/test_filter_utils.cpp)
target_link_libraries(test_filter_utils ${PROJECT_NAME} ${catkin_LIBRARIES})
# ament_add_gtest(test_filter_utils test/test_filter_utils.test test/test_filter_utils.cpp)
# ament_target_dependencies(test_filter_utils ${THIS_PACKAGE_DEPS})
# target_link_libraries(test_filter_utils lib${PROJECT_NAME})

catkin_add_gtest(test_tf_frames_watchdog test/test_tf_frames_watchdog.cpp)
target_link_libraries(test_tf_frames_watchdog TFFramesWatchdog ${catkin_LIBRARIES})
# ament_add_gtest(test_tf_frames_watchdog test/test_tf_frames_watchdog.cpp)
# target_link_libraries(test_tf_frames_watchdog TFFramesWatchdog ${catkin_LIBRARIES})

catkin_add_gtest(test_ray_casting_shape_mask test/test_ray_casting_shape_mask.cpp)
target_link_libraries(test_ray_casting_shape_mask RayCastingShapeMask ${catkin_LIBRARIES})
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
target_compile_definitions(test_ray_casting_shape_mask PRIVATE RELEASE_BUILD=1)
else()
target_compile_definitions(test_ray_casting_shape_mask PRIVATE RELEASE_BUILD=0)
endif()
# ament_add_gtest(test_ray_casting_shape_mask test/test_ray_casting_shape_mask.cpp)
# target_link_libraries(test_ray_casting_shape_mask RayCastingShapeMask ${catkin_LIBRARIES})
# if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
# target_compile_definitions(test_ray_casting_shape_mask PRIVATE RELEASE_BUILD=1)
# else()
# target_compile_definitions(test_ray_casting_shape_mask PRIVATE RELEASE_BUILD=0)
# endif()

add_rostest_gtest(test_robot_body_filter test/test_robot_body_filter.test test/test_robot_body_filter.cpp)
target_link_libraries(test_robot_body_filter ${PROJECT_NAME} ${catkin_LIBRARIES})
target_compile_options(test_robot_body_filter PRIVATE -fno-var-tracking-assignments) # speed up build
endif()
# ament_add_gtest(test_robot_body_filter test/test_robot_body_filter.test test/test_robot_body_filter.cpp)
# target_link_libraries(test_robot_body_filter ${PROJECT_NAME} ${catkin_LIBRARIES})
# target_compile_options(test_robot_body_filter PRIVATE -fno-var-tracking-assignments) # speed up build

install(FILES test/box.dae test/triangle.dae
DESTINATION share/robot_body_filter/test)
endif()

ament_export_include_directories(include include/${PROJECT_NAME} include/${PROJECT_NAME}/utils)
ament_export_dependencies(${THIS_PACKAGE_DEPS} rosidl_default_runtime)
ament_export_libraries(${PROJECT_NAME} TFFramesWatchdog RayCastingShapeMask tf2_sensor_msgs_rbf ${PROJECT_NAME}_utils)
ament_export_targets(
export_${PROJECT_NAME}
)
ament_package()
57 changes: 57 additions & 0 deletions examples/body_filter_node.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import (
Command,
FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare

def generate_launch_description():
ld = LaunchDescription()
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[
FindPackageShare("body_filter_node"),
"examples",
"full_example.urdf",
]
),
" sim_mode:=",
LaunchConfiguration("sim_mode"),
]
)
config = os.path.join(
get_package_share_directory('ros2_tutorials'),
'config',
'params.yaml'
)

node = Node(
package="ros2_tutorials",
name="your_amazing_node",
executable="test_yaml_params",
parameters=[config],
)
robot_description = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
output="screen",
parameters=[
{"robot_description": robot_description_content},
],
)
ld.add_action(robot_description)
ld.add_action(node)
return ld
2 changes: 1 addition & 1 deletion include/robot_body_filter/RayCastingShapeMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <robot_body_filter/utils/bodies.h>
#include <robot_body_filter/utils/cloud.h>
#include <geometric_shapes/body_operations.h>
#include <ros/console.h>
// #include <ros/console.h>

namespace robot_body_filter
{
Expand Down
Loading