Interacting with the Planning Scene
An integral part of planning motions in MoveIt Pro involves the concept of a Planning Scene. The Planning Scene is the source of truth of the environment for the robot to plan motions in. More information on the Planning Scene can be found here.
In MoveIt Pro, there are multiple Behaviors that interact with the Planning Scene. These Behaviors can add collision objects to the Planning Scene, introspect the Planning Scene, attach objects to the robot in the Planning Scene, and much more!
Behaviors that interact with the Planning Scene
Introspecting the Planning Scene
The following Behaviors are able to introspect and provide information about the Planning Scene.
GetCurrentPlanningScene
IsCollisionObjectInPlanningScene
IsAnyObjectAttached
WhichObjectIsAttached
Modifying the Planning Scene
The following Behaviors are used to modify the Planning Scene.
ResetPlanningSceneObjects
UpdatePlanningSceneService
ModifyObjectInPlanningScene
AddVirtualObjectToPlanningScene
RemoveCollisionObjectFromPlanningScene
The following Behaviors are used for the tool changing workflow. You can learn more about tool changing here.
AddToolToScene
AttachTool
DetachTool
RemoveToolFromScene
It is also possible to add keepout zones and save and load a Planning Scene through the UI. More information on that can be found here.
Modifying the Planning Scene via MTC
MoveIt Pro also has Behaviors which modify the Planning Scene via MTC stages. More information on motion planning and execution via MTC can be found here.
SetupMTCUpdateGroupCollisionRule
SetupMTCIgnoreCollisionsBetweenObjects
SetupMTCAttachObject
SetupMTCDetachObject
SetupMTCUpdateObjectCollisionRule
Interacting with the Planning Scene through the ROS 2 CLI
When MoveIt Pro launches, a move_group
node is launched which keeps track of the Planning Scene.
The move_group
node also advertises the /get_planning_scene
and /apply_planning_scene
services.
It is possible to call these services through the moveit_pro shell
command.
Below is an example of calling the /get_planning_scene
service and spawning a small box in the Planning Scene via the /apply_planning_scene
service.
$ moveit_pro shell
Launching an interactive Shell...
Sourcing Overlay workspace.
Sourcing User workspace.
user@🐙MoveIt Pro🐙:~/user_ws$ ros2 service call /get_planning_scene moveit_msgs/srv/GetPlanningScene
requester: making request: moveit_msgs.srv.GetPlanningScene_Request(components=moveit_msgs.msg.PlanningSceneComponents(components=0))
response:
<response-from-service-call>
user@🐙MoveIt Pro🐙:~/user_ws$ ros2 service call /apply_planning_scene moveit_msgs/srv/ApplyPlanningScene "{\
scene: {\
is_diff: true,\
world: { \
collision_objects: [ \
{ \
id: 'box1', \
header: { frame_id: 'world' }, \
primitives: [ { type: 1, dimensions: [0.05, 0.05, 0.05] } ], \
primitive_poses: [ \
{ \
position: { x: 0.5, y: 0.0, z: 1.025 }, \
orientation: { x: 0.0, y: 0.0, z: 0.0, w: 1.0 } \
} \
] \
} \
] \
} \
}\
}"