Skip to content

Commit b3c4485

Browse files
committed
Sync with MoveIt's master branch up-to moveit/moveit@0d0a6a1
2 parents 68b2dc3 + 0d0a6a1 commit b3c4485

File tree

264 files changed

+4394
-914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+4394
-914
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ qtcreator-*
5858

5959
#gdb
6060
*.gdb
61+
62+
_build
63+
_autosummary

MIGRATION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ API changes in MoveIt releases
1717
- `CollisionRobot` and `CollisionWorld` are combined into a single `CollisionEnv` class. This applies for all derived collision checkers as `FCL`, `ALL_VALID`, `HYBRID` and `DISTANCE_FIELD`. Consequently, `getCollisionRobot[Unpadded] / getCollisionWorld` functions are replaced through a `getCollisionEnv` in the planning scene and return the new combined environment. This unified collision environment provides the union of all member functions of `CollisionRobot` and `CollisionWorld`. Note that calling `checkRobotCollision` of the `CollisionEnv` does not take a `CollisionRobot` as an argument anymore as it is implicitly contained in the `CollisionEnv`.
1818
- `RobotTrajectory` provides a copy constructor that allows a shallow (default) and deep copy of waypoints
1919
- Replace the redundant namespaces `robot_state::` and `robot_model::` with the actual namespace `moveit::core::`. The additional namespaces will disappear in the future (ROS2).
20+
- Moved the library `moveit_cpp` to `moveit_ros_planning`. The classes are now in namespace `moveit_cpp`, access via `moveit::planning_interface` is deprecated.
21+
- The joint states of `passive` joints must be published in ROS and the CurrentStateMonitor will now wait for them as well. Their semantics dictate that they cannot be actively controlled, but they must be known to use the full robot state in collision checks. (https://github.com/ros-planning/moveit/pull/2663)
22+
- Removed deprecated header `moveit/macros/deprecation.h`. Use `[[deprecated]]` instead.
23+
- All uses of `MOVEIT_CLASS_FORWARD` et. al. must now be followed by a semicolon for consistency (and to get -pedantic builds to pass for the codebase).
2024

2125
## ROS Melodic
2226

moveit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ find_package(ament_cmake REQUIRED)
44

55
if(BUILD_TESTING)
66
find_package(ament_lint_auto REQUIRED)
7+
set(ament_cmake_flake8_FOUND TRUE)
78
ament_lint_auto_find_test_dependencies()
89
endif()
910

moveit_commander/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>moveit_commander</name>
4-
<version>1.1.1</version>
4+
<version>1.1.5</version>
55
<description>Python interfaces to MoveIt</description>
66

77
<author email="[email protected]">Ioan Sucan</author>

moveit_commander/src/moveit_commander/move_group.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
MoveItErrorCodes,
4545
TrajectoryConstraints,
4646
PlannerInterfaceDescription,
47+
MotionPlanRequest,
4748
)
4849
from sensor_msgs.msg import JointState
4950
import rospy
@@ -532,12 +533,20 @@ def get_planning_time(self):
532533
""" Specify the amount of time to be used for motion planning. """
533534
return self._g.get_planning_time()
534535

536+
def set_planning_pipeline_id(self, planning_pipeline):
537+
""" Specify which planning pipeline to use when motion planning (e.g. ompl, pilz_industrial_motion_planner) """
538+
self._g.set_planning_pipeline_id(planning_pipeline)
539+
540+
def get_planning_pipeline_id(self, planning_pipeline):
541+
""" Get the current planning_pipeline_id (e.g. ompl, pilz_industrial_motion_planner) """
542+
self._g.get_planning_pipeline_id(planning_pipeline)
543+
535544
def set_planner_id(self, planner_id):
536-
""" Specify which planner to use when motion planning """
545+
""" Specify which planner of the currently selected pipeline to use when motion planning (e.g. RRTConnect, LIN) """
537546
self._g.set_planner_id(planner_id)
538547

539548
def get_planner_id(self):
540-
""" Get the current planner_id """
549+
""" Get the current planner_id (e.g. RRTConnect, LIN) of the currently selected pipeline """
541550
return self._g.get_planner_id()
542551

543552
def set_num_planning_attempts(self, num_planning_attempts):
@@ -629,6 +638,11 @@ def plan(self, joints=None):
629638
error_code,
630639
)
631640

641+
def construct_motion_plan_request(self):
642+
""" Returns a MotionPlanRequest filled with the current goals of the move_group_interface"""
643+
mpr = MotionPlanRequest()
644+
return mpr.deserialize(self._g.construct_motion_plan_request())
645+
632646
def compute_cartesian_path(
633647
self,
634648
waypoints,

moveit_commander/src/moveit_commander/planning_scene_interface.py

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@
5757

5858

5959
class PlanningSceneInterface(object):
60-
""" Simple interface to making updates to a planning scene """
60+
"""
61+
Python interface for a C++ PlanningSceneInterface.
62+
Uses both C++ wrapped methods and scene manipulation topics
63+
to manipulate the PlanningScene managed by the PlanningSceneMonitor.
64+
See wrap_python_planning_scene_interface.cpp for the wrapped methods.
65+
"""
6166

6267
def __init__(self, ns="", synchronous=False, service_timeout=5.0):
6368
""" Create a planning scene interface; it uses both C++ wrapped methods and scene manipulation topics. """
@@ -88,31 +93,27 @@ def __submit(self, collision_object, attach=False):
8893
else:
8994
self._pub_co.publish(collision_object)
9095

96+
def add_object(self, collision_object):
97+
""" Add an object to the planning scene """
98+
self.__submit(collision_object, attach=False)
99+
91100
def add_sphere(self, name, pose, radius=1):
92-
"""
93-
Add a sphere to the planning scene
94-
"""
101+
""" Add a sphere to the planning scene """
95102
co = self.__make_sphere(name, pose, radius)
96103
self.__submit(co, attach=False)
97104

98105
def add_cylinder(self, name, pose, height, radius):
99-
"""
100-
Add a cylinder to the planning scene
101-
"""
106+
""" Add a cylinder to the planning scene """
102107
co = self.__make_cylinder(name, pose, height, radius)
103108
self.__submit(co, attach=False)
104109

105110
def add_mesh(self, name, pose, filename, size=(1, 1, 1)):
106-
"""
107-
Add a mesh to the planning scene
108-
"""
111+
""" Add a mesh to the planning scene """
109112
co = self.__make_mesh(name, pose, filename, size)
110113
self.__submit(co, attach=False)
111114

112115
def add_box(self, name, pose, size=(1, 1, 1)):
113-
"""
114-
Add a box to the planning scene
115-
"""
116+
""" Add a box to the planning scene """
116117
co = self.__make_box(name, pose, size)
117118
self.__submit(co, attach=False)
118119

@@ -129,6 +130,10 @@ def add_plane(self, name, pose, normal=(0, 0, 1), offset=0):
129130
co.plane_poses = [pose.pose]
130131
self.__submit(co, attach=False)
131132

133+
def attach_object(self, attached_collision_object):
134+
""" Attach an object in the planning scene """
135+
self.__submit(attached_collision_object, attach=True)
136+
132137
def attach_mesh(
133138
self, link, name, pose=None, filename="", size=(1, 1, 1), touch_links=[]
134139
):
@@ -156,6 +161,11 @@ def attach_box(self, link, name, pose=None, size=(1, 1, 1), touch_links=[]):
156161
aco.touch_links = [link]
157162
self.__submit(aco, attach=True)
158163

164+
def clear(self):
165+
""" Remove all objects from the planning scene """
166+
self.remove_attached_object()
167+
self.remove_world_object()
168+
159169
def remove_world_object(self, name=None):
160170
"""
161171
Remove an object from planning scene, or all if no name is provided
@@ -166,13 +176,18 @@ def remove_world_object(self, name=None):
166176
co.id = name
167177
self.__submit(co, attach=False)
168178

169-
def remove_attached_object(self, link, name=None):
179+
def remove_attached_object(self, link=None, name=None):
170180
"""
171-
Remove an attached object from planning scene, or all objects attached to this link if no name is provided
181+
Remove an attached object from the robot, or all objects attached to the link if no name is provided,
182+
or all attached objects in the scene if neither link nor name are provided.
183+
184+
Removed attached objects remain in the scene as world objects.
185+
Call remove_world_object afterwards to remove them from the scene.
172186
"""
173187
aco = AttachedCollisionObject()
174188
aco.object.operation = CollisionObject.REMOVE
175-
aco.link_name = link
189+
if link is not None:
190+
aco.link_name = link
176191
if name is not None:
177192
aco.object.id = name
178193
self.__submit(aco, attach=True)
@@ -230,10 +245,18 @@ def get_attached_objects(self, object_ids=[]):
230245
aobjs[key] = msg
231246
return aobjs
232247

248+
def apply_planning_scene(self, planning_scene_message):
249+
"""
250+
Applies the planning scene message.
251+
"""
252+
return self._psi.apply_planning_scene(
253+
conversions.msg_to_string(planning_scene_message)
254+
)
255+
233256
@staticmethod
234257
def __make_existing(name):
235258
"""
236-
Create an empty Collision Object, used when the object already exists
259+
Create an empty Collision Object. Used when the object already exists
237260
"""
238261
co = CollisionObject()
239262
co.id = name

moveit_commander/src/moveit_commander/robot.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,25 @@ def get_root_link(self):
194194
"""Get the name of the root link of the robot model """
195195
return self._r.get_robot_root_link()
196196

197+
def get_active_joint_names(self, group=None):
198+
"""
199+
Get the names of all the movable joints that make up a group.
200+
If no group name is specified, all joints in the robot model are returned.
201+
Excludes fixed and mimic joints.
202+
"""
203+
if group is not None:
204+
if self.has_group(group):
205+
return self._r.get_group_active_joint_names(group)
206+
else:
207+
raise MoveItCommanderException("There is no group named %s" % group)
208+
else:
209+
return self._r.get_active_joint_names()
210+
197211
def get_joint_names(self, group=None):
198212
"""
199-
Get the names of all the movable joints that make up a group
200-
(mimic joints and fixed joints are excluded). If no group name is
201-
specified, all joints in the robot model are returned, including
202-
fixed and mimic joints.
213+
Get the names of all the movable joints that make up a group.
214+
If no group name is specified, all joints in the robot model are returned.
215+
Includes fixed and mimic joints.
203216
"""
204217
if group is not None:
205218
if self.has_group(group):

moveit_core/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ find_package(trajectory_msgs REQUIRED)
4949
find_package(visualization_msgs REQUIRED)
5050
find_package(common_interfaces REQUIRED)
5151
find_package(pluginlib REQUIRED)
52+
# TODO: Port python bindings
53+
# find_package(pybind11 REQUIRED)
5254

5355
# Set target file path for version.h
5456
set(VERSION_FILE_PATH ${CMAKE_BINARY_DIR}/include)
@@ -77,6 +79,8 @@ set(THIS_PACKAGE_INCLUDE_DIRS
7779
planning_request_adapter/include
7880
planning_scene/include
7981
profiler/include
82+
# TODO: Port python bindings
83+
# python/tools/include
8084
sensor_manager/include
8185
trajectory_processing/include
8286
utils/include
@@ -99,6 +103,8 @@ set(THIS_PACKAGE_LIBRARIES
99103
moveit_constraint_samplers
100104
moveit_planning_request_adapter
101105
moveit_profiler
106+
# TODO: Port python bindings
107+
# moveit_python_tools
102108
moveit_trajectory_processing
103109
moveit_distance_field
104110
moveit_collision_distance_field
@@ -183,6 +189,34 @@ else()
183189
install(FILES collision_detection_bullet/empty_description.xml DESTINATION share/${PROJECT_NAME} RENAME collision_detector_bullet_description.xml)
184190
endif()
185191

192+
# TODO: Port python bindings
193+
# add_subdirectory(python)
194+
# set(pymoveit_libs
195+
# moveit_collision_detection
196+
# moveit_kinematic_constraints
197+
# moveit_planning_scene
198+
# moveit_python_tools
199+
# moveit_robot_model
200+
# moveit_robot_state
201+
# moveit_transforms
202+
# )
203+
#
204+
# pybind_add_module(pymoveit_core
205+
# python/pymoveit_core.cpp
206+
# collision_detection/src/pycollision_detection.cpp
207+
# robot_model/src/pyrobot_model.cpp
208+
# robot_state/src/pyrobot_state.cpp
209+
# transforms/src/pytransforms.cpp
210+
# planning_scene/src/pyplanning_scene.cpp
211+
# kinematic_constraints/src/pykinematic_constraint.cpp
212+
# )
213+
# target_include_directories(pymoveit_core SYSTEM PRIVATE ${catkin_INCLUDE_DIRS})
214+
# target_link_libraries(pymoveit_core PRIVATE ${pymoveit_libs} ${catkin_LIBRARIES})
215+
#
216+
# #catkin_lint: ignore_once undefined_target (pymoveit_core is defined by pybind_add_module)
217+
# install(TARGETS pymoveit_core LIBRARY DESTINATION ${CATKIN_GLOBAL_PYTHON_DESTINATION})
218+
219+
186220
install(
187221
TARGETS ${THIS_PACKAGE_LIBRARIES}
188222
EXPORT export_${PROJECT_NAME}
@@ -202,6 +236,7 @@ if(BUILD_TESTING)
202236
set(ament_cmake_copyright_FOUND TRUE)
203237
set(ament_cmake_cppcheck_FOUND TRUE)
204238
set(ament_cmake_cpplint_FOUND TRUE)
239+
set(ament_cmake_flake8_FOUND TRUE)
205240
set(ament_cmake_uncrustify_FOUND TRUE)
206241
set(ament_cmake_lint_cmake_FOUND TRUE)
207242

moveit_core/collision_detection/include/moveit/collision_detection/collision_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
namespace collision_detection
4949
{
50-
MOVEIT_CLASS_FORWARD(AllowedCollisionMatrix) // Defines AllowedCollisionMatrixPtr, ConstPtr, WeakPtr... etc
50+
MOVEIT_CLASS_FORWARD(AllowedCollisionMatrix); // Defines AllowedCollisionMatrixPtr, ConstPtr, WeakPtr... etc
5151

5252
/** \brief The types of bodies that are considered for collision */
5353
namespace BodyTypes

moveit_core/collision_detection/include/moveit/collision_detection/collision_detector_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
namespace collision_detection
4343
{
44-
MOVEIT_CLASS_FORWARD(CollisionDetectorAllocator) // Defines CollisionDetectorAllocatorPtr, ConstPtr, WeakPtr... etc
44+
MOVEIT_CLASS_FORWARD(CollisionDetectorAllocator); // Defines CollisionDetectorAllocatorPtr, ConstPtr, WeakPtr... etc
4545

4646
/** \brief An allocator for a compatible CollisionWorld/CollisionRobot pair. */
4747
class CollisionDetectorAllocator

0 commit comments

Comments
 (0)