Skip to content

Commit d8f70c4

Browse files
authored
publishTrajectoryLine(): issue error when no end-effector tips are found (#129)
1 parent ac8b019 commit d8f70c4

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

.github/workflows/format.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
workflow_dispatch:
88
pull_request:
99
push:
10+
branches:
11+
- main
1012

1113
jobs:
1214
pre-commit:
1315
name: Format
14-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-20.04
1517
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18+
- uses: actions/checkout@v3
1819
- name: Install clang-format-10
1920
run: sudo apt-get install clang-format-10
2021
- name: Install catkin-lint
@@ -28,4 +29,4 @@ jobs:
2829
rosdep update
2930
sudo apt-get -q install catkin-lint
3031
export ROS_DISTRO=noetic
31-
- uses: pre-commit/action@v2.0.0
32+
- uses: pre-commit/action@v3.0.0

.github/workflows/industrial_ci_action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ jobs:
3131
name: "${{ matrix.env.ROS_DISTRO }} + ${{ matrix.env.ROS_REPO }}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}"
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
# The target directory cache doesn't include the source directory because
3636
# that comes from the checkout. See "prepare target_ws for cache" task below
3737
- name: cache target_ws
3838
if: ${{ ! matrix.env.CCOV }}
39-
uses: pat-s/always-upload-cache@v2.1.5
39+
uses: pat-s/always-upload-cache@v3
4040
with:
4141
path: ${{ env.BASEDIR }}/target_ws
4242
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
4343
restore-keys: |
4444
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
4545
- name: cache ccache
46-
uses: pat-s/always-upload-cache@v2.1.5
46+
uses: pat-s/always-upload-cache@v3
4747
with:
4848
path: ${{ env.CCACHE_DIR }}
4949
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 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.4.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: 22.3.0
37+
rev: 23.3.0
3838
hooks:
3939
- id: black
4040

src/moveit_visual_tools.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,14 @@ bool MoveItVisualTools::publishTrajectoryLine(const moveit_msgs::RobotTrajectory
13701370
const moveit::core::JointModelGroup* arm_jmg,
13711371
const rviz_visual_tools::colors& color)
13721372
{
1373+
if (!arm_jmg)
1374+
{
1375+
ROS_FATAL_STREAM_NAMED(LOGNAME, "arm_jmg is NULL");
1376+
return false;
1377+
}
1378+
13731379
std::vector<const moveit::core::LinkModel*> tips;
1374-
if (!arm_jmg->getEndEffectorTips(tips))
1380+
if (!arm_jmg->getEndEffectorTips(tips) || tips.empty())
13751381
{
13761382
ROS_ERROR_STREAM_NAMED(LOGNAME, "Unable to get end effector tips from jmg");
13771383
return false;
@@ -1398,8 +1404,14 @@ bool MoveItVisualTools::publishTrajectoryLine(const robot_trajectory::RobotTraje
13981404
const moveit::core::JointModelGroup* arm_jmg,
13991405
const rviz_visual_tools::colors& color)
14001406
{
1407+
if (!arm_jmg)
1408+
{
1409+
ROS_FATAL_STREAM_NAMED(LOGNAME, "arm_jmg is NULL");
1410+
return false;
1411+
}
1412+
14011413
std::vector<const moveit::core::LinkModel*> tips;
1402-
if (!arm_jmg->getEndEffectorTips(tips))
1414+
if (!arm_jmg->getEndEffectorTips(tips) || tips.empty())
14031415
{
14041416
ROS_ERROR_STREAM_NAMED(LOGNAME, "Unable to get end effector tips from jmg");
14051417
return false;

0 commit comments

Comments
 (0)