Skip to content

Commit 4dd2e89

Browse files
authored
Merge branch 'main' into update-docs
2 parents 16f5f2f + f546e3b commit 4dd2e89

File tree

11 files changed

+73
-51
lines changed

11 files changed

+73
-51
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Unreleased
1313
**Added**
1414

1515
* Added support for attached and non-attached collision mesh visualization to the ``Robot Visualize`` GH component.
16+
* Added a prefix to all GH components.
1617
* Added ``append`` to the operations of the ``Collision Mesh`` GH component.
1718

1819
**Changed**
@@ -22,6 +23,8 @@ Unreleased
2223
**Fixed**
2324

2425
* Fixed DH params for analytical IK solver of UR3e and UR10e.
26+
* Fixed Kinetic support on IK, FK, and motion planning calls.
27+
* Fixed ``Publish to topic`` Grasshopper component when the ``ros_client`` has been replaced (eg. disconnected and reconnected).
2528

2629
**Deprecated**
2730

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[tool.black]
2+
line-length = 180
3+
4+
[tool.pytest.ini_options]
5+
minversion = "6.0"
6+
testpaths = ["src", "tests"]
7+
python_files = [
8+
"test_*.py",
9+
"*_test.py",
10+
"tests.py"
11+
]
12+
addopts = "-ra --strict --doctest-glob=*.rst --tb=short"
13+
doctest_optionflags= "NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES"
14+
filterwarnings = "ignore::DeprecationWarning"
15+
16+
[tool.pydocstyle]
17+
convention = "numpy"
18+
add-ignore = ["D100"]
19+
20+
[tool.isort]
21+
force_single_line = true
22+
line_length = 180
23+
known_first_party = "compas_fab"
24+
default_section = "THIRDPARTY"
25+
forced_separate = "test_compas_fab"
26+
skip = ["__init__.py"]

requirements-dev.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
attrs>=19.3.0
2-
sphinx_compas_theme>=0.9
3-
sphinx>=1.6
4-
invoke>=0.14
2+
black
53
bump2version>=1.0
64
check-manifest>=0.36
75
flake8
8-
autopep8
6+
invoke>=0.14
7+
isort
98
pylint
10-
pytest>=4.6
119
pytest_mock
1210
pytest-cov
11+
pytest>=6.0
12+
sphinx_compas_theme>=0.9
13+
sphinx>=1.6
1314
sybil
14-
isort
1515
twine
1616
-e .

setup.cfg

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,3 @@ exclude =
1212
dist,
1313
src/compas_fab/backends/vrep/remote_api/*,
1414
src/compas_fab/ghpython/path_planning.py
15-
16-
[pydocstyle]
17-
convention = numpy
18-
add-ignore = D100
19-
20-
[tool:pytest]
21-
testpaths = src tests
22-
norecursedirs =
23-
migrations
24-
25-
python_files =
26-
test_*.py
27-
*_test.py
28-
tests.py
29-
addopts =
30-
-ra
31-
--strict
32-
--doctest-glob=\*.rst
33-
--tb=short
34-
doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES
35-
filterwarnings =
36-
ignore::DeprecationWarning
37-
38-
[isort]
39-
force_single_line = True
40-
line_length = 180
41-
known_first_party = compas_fab
42-
default_section = THIRDPARTY
43-
forced_separate = test_compas_fab
44-
skip = migrations, __init__.py
45-
46-
[coverage:run]
47-
branch = True

src/compas_fab/backends/ros/backend_features/move_it_forward_kinematics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def forward_kinematics_async(self, callback, errback,
8787
name=configuration.joint_names, position=configuration.joint_values, header=header)
8888
robot_state = RobotState(
8989
joint_state, MultiDOFJointState(header=header))
90+
robot_state.filter_fields_for_distro(self.ros_client.ros_distro)
9091

9192
def convert_to_frame(response):
9293
callback(response.pose_stamped[0].pose.frame)

src/compas_fab/backends/ros/backend_features/move_it_inverse_kinematics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def inverse_kinematics_async(self, callback, errback,
109109
name=start_configuration.joint_names, position=start_configuration.joint_values, header=header)
110110
start_state = RobotState(
111111
joint_state, MultiDOFJointState(header=header))
112+
start_state.filter_fields_for_distro(self.ros_client.ros_distro)
112113

113114
if options.get('attached_collision_meshes'):
114115
for acm in options['attached_collision_meshes']:

src/compas_fab/backends/ros/backend_features/move_it_plan_cartesian_motion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def plan_cartesian_motion_async(self, callback, errback,
109109
name=start_configuration.joint_names,
110110
position=start_configuration.joint_values)
111111
start_state = RobotState(joint_state, MultiDOFJointState(header=header), is_diff=True)
112+
start_state.filter_fields_for_distro(self.ros_client.ros_distro)
112113

113114
if options.get('attached_collision_meshes'):
114115
for acm in options['attached_collision_meshes']:

src/compas_fab/backends/ros/backend_features/move_it_plan_motion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def plan_motion_async(self, callback, errback,
114114
position=start_configuration.joint_values)
115115
start_state = RobotState(
116116
joint_state, MultiDOFJointState(header=header), is_diff=True)
117+
start_state.filter_fields_for_distro(self.ros_client.ros_distro)
117118

118119
if options.get('attached_collision_meshes'):
119120
for acm in options['attached_collision_meshes']:

src/compas_fab/backends/ros/messages/moveit_msgs.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ def from_msg(cls, msg):
189189
item) for item in msg['attached_collision_objects']]
190190
return cls(joint_state, multi_dof_joint_state, attached_collision_objects, msg['is_diff'])
191191

192+
def filter_fields_for_distro(self, ros_distro):
193+
"""To maintain backwards compatibility with older ROS distros,
194+
we need to make sure newly added fields are removed from the request."""
195+
# Remove the field `pose` for distros older than NOETIC
196+
if ros_distro in (RosDistro.KINETIC, RosDistro.MELODIC):
197+
for aco in self.attached_collision_objects:
198+
del aco.object.pose
199+
192200

193201
class PositionIKRequest(ROSmsg):
194202
"""https://docs.ros.org/kinetic/api/moveit_msgs/html/msg/PositionIKRequest.html
@@ -539,6 +547,14 @@ def from_msg(cls, msg):
539547

540548
return cls(collision_objects, octomap)
541549

550+
def filter_fields_for_distro(self, ros_distro):
551+
"""To maintain backwards compatibility with older ROS distros,
552+
we need to make sure newly added fields are removed from the request."""
553+
# Remove the field `pose` for distros older than NOETIC
554+
if ros_distro in (RosDistro.KINETIC, RosDistro.MELODIC):
555+
for co in self.collision_objects:
556+
del co.pose
557+
542558

543559
class PlanningScene(ROSmsg):
544560
"""https://docs.ros.org/melodic/api/moveit_msgs/html/msg/PlanningScene.html
@@ -568,11 +584,8 @@ def filter_fields_for_distro(self, ros_distro):
568584
"""To maintain backwards compatibility with older ROS distros,
569585
we need to make sure newly added fields are removed from the request."""
570586
# Remove the field `pose` for distros older than NOETIC
571-
if ros_distro in (RosDistro.KINETIC, RosDistro.MELODIC):
572-
for aco in self.robot_state.attached_collision_objects:
573-
del aco.object.pose
574-
for co in self.world.collision_objects:
575-
del co.pose
587+
self.robot_state.filter_fields_for_distro(ros_distro)
588+
self.world.filter_fields_for_distro(ros_distro)
576589

577590
@classmethod
578591
def from_msg(cls, msg):

src/compas_fab/ghpython/components/Cf_RosTopicPublish/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def RunScript(self, ros_client, topic_name, topic_type, msg):
2525
topic = st.get(key, None)
2626

2727
if ros_client and ros_client.is_connected:
28-
if not topic:
29-
topic = Topic(ros_client, topic_name, topic_type)
28+
if not topic or topic.ros != ros_client:
29+
topic = Topic(ros_client, topic_name, topic_type, reconnect_on_close=False)
3030
topic.advertise()
3131
time.sleep(0.2)
3232

0 commit comments

Comments
 (0)