Skip to content

Commit f8fb133

Browse files
committed
Rebase from 'upstream'
1 parent 04928b0 commit f8fb133

19 files changed

+784
-86
lines changed

.github/workflows/build_and_test.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ jobs:
2020
CCOV: true
2121
- ROS_DISTRO: rolling
2222
ROS_REPO: testing
23-
- ROS_DISTRO: galactic
23+
- ROS_DISTRO: jazzy
2424
ROS_REPO: main
25-
- ROS_DISTRO: galactic
25+
- ROS_DISTRO: jazzy
2626
ROS_REPO: testing
27-
- ROS_DISTRO: foxy
27+
- ROS_DISTRO: humble
28+
ROS_REPO: main
29+
- ROS_DISTRO: humble
2830
ROS_REPO: testing
31+
2932
env:
33+
# Globally disable git security
34+
# https://github.blog/2022-04-12-git-security-vulnerability-announced
35+
BEFORE_SETUP_UPSTREAM_WORKSPACE: 'sudo apt-get -qq install -y --no-upgrade --no-install-recommends git && git config --global --add safe.directory "*"'
3036
UPSTREAM_WORKSPACE: geometric_shapes.repos
3137
AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src'
3238
AFTER_RUN_TARGET_TEST: ${{ matrix.env.CCOV && './.ci.prepare_codecov' || '' }}
@@ -40,43 +46,46 @@ jobs:
4046
name: "${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}${{ matrix.env.CCOV && ' + ccov' || ''}}"
4147
runs-on: ubuntu-latest
4248
steps:
43-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
4450
- name: cache upstream_ws
45-
uses: pat-s/always-upload-cache@v2.1.5
51+
uses: actions/cache@v4
4652
with:
53+
save-always: true
4754
path: ${{ env.BASEDIR }}/upstream_ws
48-
key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('moveit2.repos') }}-${{ github.run_id }}
55+
key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ github.run_id }}
4956
restore-keys: |
50-
upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('moveit2.repos') }}
57+
upstream_ws-${{ env.CACHE_PREFIX }}
5158
# The target directory cache doesn't include the source directory because
5259
# that comes from the checkout. See "prepare target_ws for cache" task below
5360
- name: cache target_ws
5461
if: ${{ ! matrix.env.CCOV }}
55-
uses: pat-s/always-upload-cache@v2.1.5
62+
uses: actions/cache@v4
5663
with:
64+
save-always: true
5765
path: ${{ env.BASEDIR }}/target_ws
5866
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
5967
restore-keys: |
6068
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
6169
- name: cache ccache
62-
uses: pat-s/always-upload-cache@v2.1.5
70+
uses: actions/cache@v4
6371
with:
72+
save-always: true
6473
path: ${{ env.CCACHE_DIR }}
6574
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
6675
restore-keys: |
6776
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
6877
ccache-${{ env.CACHE_PREFIX }}
6978
- name: industrial_ci
70-
uses: 'ros-industrial/industrial_ci@master'
79+
uses: ros-industrial/industrial_ci@master
7180
env: ${{ matrix.env }}
7281
- name: upload test artifacts (on failure)
73-
uses: actions/upload-artifact@v2
82+
uses: actions/upload-artifact@v4
7483
if: failure()
7584
with:
7685
name: test-results
7786
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
7887
- name: upload codecov report
79-
uses: codecov/codecov-action@v1
88+
uses: codecov/codecov-action@v4
8089
if: ${{ matrix.env.CCOV }}
8190
with:
8291
files: ${{ env.BASEDIR }}/coverage.info

.github/workflows/format.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
name: Format
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18-
- name: Install clang-format-10
19-
run: sudo apt-get install clang-format-10
20-
- uses: pre-commit/[email protected]
16+
- uses: actions/checkout@v4
17+
- name: Install clang-format-14
18+
run: sudo apt-get install clang-format-14
19+
- uses: pre-commit/[email protected]

.github/workflows/prerelease.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ name: pre-release
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
ROS_DISTRO:
10+
type: string
11+
required: true
12+
description: 'ROS distribution codename:'
13+
default: rolling
14+
15+
permissions:
16+
contents: read # to fetch code (actions/checkout)
817

918
jobs:
1019
default:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
distro: [foxy, galactic, rolling]
15-
1620
env:
17-
ROS_DISTRO: ${{ matrix.distro }}
21+
ROS_DISTRO: ${{ inputs.ROS_DISTRO }}
1822
PRERELEASE: true
1923
BASEDIR: ${{ github.workspace }}/.work
2024

21-
name: "${{ matrix.distro }}"
25+
name: "${{ inputs.ROS_DISTRO }}"
2226
runs-on: ubuntu-latest
2327
steps:
24-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2529
- name: industrial_ci
2630
uses: ros-industrial/industrial_ci@master

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
repos:
1616
# Standard hooks
1717
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v3.4.0
18+
rev: v4.6.0
1919
hooks:
2020
- id: check-added-large-files
2121
- id: check-case-conflict
@@ -34,7 +34,7 @@ repos:
3434
- id: trailing-whitespace
3535

3636
- repo: https://github.com/psf/black
37-
rev: 20.8b1
37+
rev: 24.8.0
3838
hooks:
3939
- id: black
4040

@@ -43,7 +43,7 @@ repos:
4343
- id: clang-format
4444
name: clang-format
4545
description: Format files with ClangFormat.
46-
entry: clang-format-10
46+
entry: clang-format-14
4747
language: system
4848
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
4949
args: ['-fallback-style=none', '-i']

CHANGELOG.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22
Changelog for package geometric_shapes
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.3.0 (2024-11-29)
6+
------------------
7+
* Install headers into subdirectory (`#253 <https://github.com/moveit/geometric_shapes/issues/253>`_)
8+
* Added bodies::Body::computeBoundingBox (oriented box version) (`#239 <https://github.com/moveit/geometric_shapes/issues/239>`_)
9+
* Improve padding of meshes using weighted vertex normals (`#240 <https://github.com/moveit/geometric_shapes/issues/240>`_)
10+
* Contributors: Kenji Brameld (TRACLabs), Robert Haschke, Sebastian Castro, Sebastian Pelletier, Tyler Mayoff
11+
12+
2.2.1 (2024-06-26)
13+
------------------
14+
* Use the system version of octomap (`#244 <https://github.com/ros-planning/geometric_shapes/issues/244>`_)
15+
* Contributors: Chris Lalancette
16+
17+
2.2.0 (2024-06-07)
18+
------------------
19+
* Jazzy Support (`#241 <https://github.com/moveit/geometric_shapes/issues/241>`_)
20+
* Update CI workflows to Rolling, Jazzy, Humble
21+
* Fix octomap dependency version to 1.9.7...<1.10.0
22+
* Fix Box::print (`#237 <https://github.com/moveit/geometric_shapes/issues/237>`_)
23+
* CI: Fix cache key (`#236 <https://github.com/moveit/geometric_shapes/issues/236>`_)
24+
* Switch to clang-format-14 (`#228 <https://github.com/moveit/geometric_shapes/issues/228>`_)
25+
* Add humble testing (`#221 <https://github.com/moveit/geometric_shapes/issues/221>`_)
26+
* Update black version (`#218 <https://github.com/moveit/geometric_shapes/issues/218>`_)
27+
* Contributors: Henning Kayser, Matthijs van der Burgh, Stephanie Eng, Vatan Aksoy Tezer, Robert Haschke, Jafar Abdi
28+
529
2.1.3 (2022-03-08)
630
------------------
731
* [jammy] Fix assimp linking and cmake error (`#215 <https://github.com/ros-planning/geometric_shapes/issues/215>`_)

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ find_package(console_bridge REQUIRED)
4343
find_package(console_bridge_vendor REQUIRED)
4444
find_package(eigen_stl_containers REQUIRED)
4545
find_package(geometry_msgs REQUIRED)
46-
find_package(OCTOMAP REQUIRED)
46+
# Enforce the system package version on Ubuntu jammy and noble which is also used by libfcl-dev
47+
# The version is fixed to prevent ABI conflicts with ros-octomap
48+
find_package(octomap 1.9.7...<1.10.0 REQUIRED)
4749
find_package(QHULL REQUIRED)
4850
find_package(random_numbers REQUIRED)
4951
find_package(rclcpp REQUIRED)
5052
find_package(resource_retriever REQUIRED)
5153
find_package(shape_msgs REQUIRED)
5254
find_package(visualization_msgs REQUIRED)
55+
find_package(fcl REQUIRED)
5356
include(ConfigExtras)
5457

5558
set(THIS_PACKAGE_EXPORT_DEPENDS
@@ -60,7 +63,7 @@ set(THIS_PACKAGE_EXPORT_DEPENDS
6063
console_bridge_vendor
6164
eigen_stl_containers
6265
geometry_msgs
63-
OCTOMAP
66+
octomap
6467
random_numbers
6568
rclcpp
6669
resource_retriever
@@ -71,20 +74,23 @@ set(THIS_PACKAGE_EXPORT_DEPENDS
7174
# Set VERSION from package.xml
7275
ament_package_xml()
7376

74-
include_directories(include)
75-
7677
add_library(${PROJECT_NAME} SHARED
7778
src/aabb.cpp
7879
src/bodies.cpp
7980
src/body_operations.cpp
8081
src/mesh_operations.cpp
82+
src/obb.cpp
8183
src/shape_extents.cpp
8284
src/shape_operations.cpp
8385
src/shape_to_marker.cpp
8486
src/shapes.cpp
8587
)
8688
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
8789
target_compile_options(${PROJECT_NAME} PRIVATE ${PROJECT_COMPILE_OPTIONS})
90+
target_include_directories(${PROJECT_NAME}
91+
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
92+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
93+
target_link_libraries(${PROJECT_NAME} fcl)
8894
ament_target_dependencies(${PROJECT_NAME}
8995
${THIS_PACKAGE_EXPORT_DEPENDS}
9096
)
@@ -112,7 +118,7 @@ install(
112118
RUNTIME DESTINATION bin
113119
INCLUDES DESTINATION include
114120
)
115-
install(DIRECTORY include/ DESTINATION include)
121+
install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
116122

117123
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
118124
ament_export_dependencies(${THIS_PACKAGE_EXPORT_DEPENDS})

include/geometric_shapes/bodies.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#define _USE_MATH_DEFINES
3535
#include "geometric_shapes/aabb.h"
36+
#include "geometric_shapes/obb.h"
3637
#include "geometric_shapes/shapes.h"
3738
#include <eigen_stl_containers/eigen_stl_containers.h>
3839
#include <random_numbers/random_numbers.h>
@@ -240,6 +241,10 @@ class Body
240241
pose. Scaling and padding are accounted for. */
241242
virtual void computeBoundingBox(AABB& bbox) const = 0;
242243

244+
/** \brief Compute the oriented bounding box for the body, in its current
245+
pose. Scaling and padding are accounted for. */
246+
virtual void computeBoundingBox(OBB& bbox) const = 0;
247+
243248
/** \brief Get a clone of this body, but one that is located at the pose \e pose */
244249
inline BodyPtr cloneAt(const Eigen::Isometry3d& pose) const
245250
{
@@ -307,6 +312,7 @@ class Sphere : public Body
307312
void computeBoundingSphere(BoundingSphere& sphere) const override;
308313
void computeBoundingCylinder(BoundingCylinder& cylinder) const override;
309314
void computeBoundingBox(AABB& bbox) const override;
315+
void computeBoundingBox(OBB& bbox) const override;
310316
bool intersectsRay(const Eigen::Vector3d& origin, const Eigen::Vector3d& dir,
311317
EigenSTL::vector_Vector3d* intersections = nullptr, unsigned int count = 0) const override;
312318

@@ -359,6 +365,7 @@ class Cylinder : public Body
359365
void computeBoundingSphere(BoundingSphere& sphere) const override;
360366
void computeBoundingCylinder(BoundingCylinder& cylinder) const override;
361367
void computeBoundingBox(AABB& bbox) const override;
368+
void computeBoundingBox(OBB& bbox) const override;
362369
bool intersectsRay(const Eigen::Vector3d& origin, const Eigen::Vector3d& dir,
363370
EigenSTL::vector_Vector3d* intersections = nullptr, unsigned int count = 0) const override;
364371

@@ -421,6 +428,7 @@ class Box : public Body
421428
void computeBoundingSphere(BoundingSphere& sphere) const override;
422429
void computeBoundingCylinder(BoundingCylinder& cylinder) const override;
423430
void computeBoundingBox(AABB& bbox) const override;
431+
void computeBoundingBox(OBB& bbox) const override;
424432
bool intersectsRay(const Eigen::Vector3d& origin, const Eigen::Vector3d& dir,
425433
EigenSTL::vector_Vector3d* intersections = nullptr, unsigned int count = 0) const override;
426434

@@ -483,6 +491,7 @@ class ConvexMesh : public Body
483491
void computeBoundingSphere(BoundingSphere& sphere) const override;
484492
void computeBoundingCylinder(BoundingCylinder& cylinder) const override;
485493
void computeBoundingBox(AABB& bbox) const override;
494+
void computeBoundingBox(OBB& bbox) const override;
486495
bool intersectsRay(const Eigen::Vector3d& origin, const Eigen::Vector3d& dir,
487496
EigenSTL::vector_Vector3d* intersections = nullptr, unsigned int count = 0) const override;
488497

include/geometric_shapes/body_operations.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ void mergeBoundingSpheres(const std::vector<BoundingSphere>& spheres, BoundingSp
6767
/** \brief Compute an axis-aligned bounding box to enclose a set of bounding boxes. */
6868
void mergeBoundingBoxes(const std::vector<AABB>& boxes, AABB& mergedBox);
6969

70+
/** \brief Compute an approximate oriented bounding box to enclose a set of bounding boxes. */
71+
void mergeBoundingBoxesApprox(const std::vector<OBB>& boxes, OBB& mergedBox);
72+
7073
/** \brief Compute the bounding sphere for a set of \e bodies and store the resulting sphere in \e mergedSphere */
7174
void computeBoundingSphere(const std::vector<const Body*>& bodies, BoundingSphere& mergedSphere);
7275
} // namespace bodies

0 commit comments

Comments
 (0)