Skip to content

Commit dc9a14b

Browse files
author
David Conner
committed
set up additional tests with some minor fixes, but ignore common warnings
1 parent 87d768f commit dc9a14b

File tree

19 files changed

+105
-28
lines changed

19 files changed

+105
-28
lines changed

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[flake8]
2-
exclude = .git
2+
exclude = .git, build, install, dist
33
max-line-length = 130
4+
ignore = B902, W503, D100, D105, D107

flexbe_manipulation_states/.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
exclude = .git, build, install, dist
3+
max-line-length = 130
4+
ignore = B902, W503, D100, D101, D102, D104, D105, D107,
5+
D200, D201, D202, D205, D208, D210, D400, D401, D403,
6+
I100, I202, Q000

flexbe_manipulation_states/flexbe_manipulation_states/get_joints_from_srdf_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def __init__(self, move_group, robot_name=""):
8686

8787
def execute(self, userdata):
8888
""" execute the state """
89-
9089
if self._param_error:
9190
return 'param_error'
9291
robot = None

flexbe_manipulation_states/flexbe_manipulation_states/joint_state_to_moveit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ def on_enter(self, userdata):
145145
goal_constraints = Constraints()
146146
for i, jnt_name in enumerate(self._joint_names):
147147
goal_constraints.joint_constraints.append(JointConstraint(
148-
joint_name=jnt_name,
149-
position=self._joint_config[i],
150-
weight=1.0))
148+
joint_name=jnt_name,
149+
position=self._joint_config[i],
150+
weight=1.0))
151151
action_goal.request.goal_constraints.append(goal_constraints)
152152

153153
try:

flexbe_manipulation_states/flexbe_manipulation_states/moveit_to_joints_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def execute(self, userdata): # pylint: disable=R0911
9999

100100
if result.error_code.val == MoveItErrorCodes.CONTROL_FAILED:
101101
Logger.logwarn('Control failed for move action of group:'
102-
f' { self._move_group} (error code: {str(result.error_code)}')
102+
f' {self._move_group} (error code: {str(result.error_code)}')
103103
self._control_failed = True
104104
return 'control_failed'
105105

flexbe_manipulation_states/setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
('share/' + PACKAGE_NAME + "/launch", glob('tests/*.launch.py')),
2222
],
2323
install_requires=['setuptools'],
24+
extras_require={'test': ['pytest']},
2425
zip_safe=True,
25-
maintainer='phil',
26-
maintainer_email='philsplus@gmail.com',
27-
description='TODO: Package description',
28-
license='TODO: License declaration',
29-
tests_require=['pytest'],
26+
author='phil',
27+
author_email='philsplus@gmail.com',
28+
maintainer='David Conner',
29+
maintainer_email='robotics@cnu.edu',
30+
description='flexbe_manipulation_states provides a collection of robot-agnostic states'
31+
' related to manipulation and trajectory execution.',
32+
license='BSD',
3033
entry_points={
3134
'console_scripts': [
3235
],
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Run flake8 test."""
2+
import warnings
3+
from pathlib import Path
4+
5+
from ament_flake8.main import main
6+
7+
8+
def test_flake8():
9+
"""Run test using pytest."""
10+
repo_root = Path(__file__).resolve().parents[1]
11+
cfg = repo_root / '.flake8'
12+
with warnings.catch_warnings():
13+
warnings.filterwarnings('ignore', '.*multi-threaded.*fork.*')
14+
assert main(argv=['--config', str(cfg)]) == 0

flexbe_navigation_states/.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
exclude = .git, build, install, dist
3+
max-line-length = 130
4+
ignore = B902, W503, D100, D101, D102, D104, D105, D107,
5+
D200, D201, D202, D205, D208, D210, D400, D401, D403,
6+
I100, I202, Q000

flexbe_navigation_states/setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
('share/' + package_name, ['package.xml']),
1414
],
1515
install_requires=['setuptools'],
16+
extras_require={'test': ['pytest']},
1617
zip_safe=True,
17-
maintainer='phil',
18-
maintainer_email='philsplus@gmail.com',
19-
description='TODO: Package description',
20-
license='TODO: License declaration',
21-
tests_require=['pytest'],
18+
author='phil',
19+
author_email='philsplus@gmail.com',
20+
maintainer='David Conner',
21+
maintainer_email='robotics@cnu.edu',
22+
description='flexbe_navigation_states provides a collection of robot-agnostic '
23+
'states related to mobile robot navigation.',
24+
license='BSD',
2225
entry_points={
2326
'console_scripts': [
2427
],

flexbe_navigation_states/tests/run_tests.launch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
3737
from launch.substitutions import LaunchConfiguration
3838
from launch.launch_description_sources import PythonLaunchDescriptionSource
39+
3940
from ament_index_python.packages import get_package_share_directory
4041

4142

4243
def generate_launch_description():
43-
44+
"""Generate launch setup for tests."""
4445
flexbe_testing_dir = get_package_share_directory('flexbe_testing')
4546
flex_nav_states_test_dir = get_package_share_directory('flexbe_navigation_states')
4647

0 commit comments

Comments
 (0)