4 from moveit_commander
import PlanningSceneInterface
5 from geometry_msgs.msg
import PoseStamped
9 rospy.init_node(
'scene_test')
10 self.
_psi = PlanningSceneInterface()
13 def add_box(self, name, size, pose, orientation=[0, 0, 0, 1]):
15 return self._psi.add_box(name, pose, size)
20 ps.pose.position.x = pose[0]
21 ps.pose.position.y = pose[1]
22 ps.pose.position.z = pose[2]
23 ps.pose.orientation.x = orientation[0]
24 ps.pose.orientation.y = orientation[1]
25 ps.pose.orientation.z = orientation[2]
26 ps.pose.orientation.w = orientation[3]
32 if __name__ ==
'__main__':
37 obj = si.add_box(
'wall1', [2, 0.05, 1.16], [2.0/2-0.65, -0.55, 1.16/2-0.32])
38 obj = si.add_box(
'wall2', [0.05, 3, 1.16], [-0.65, 3.0/2-0.55, 1.16/2-0.32])
39 obj = si.add_box(
'arm_mount1', [1, 0.2, 0.32], [0, 0, -0.32/2])
40 obj = si.add_box(
'arm_mount2', [1, 0.2, 0.32], [0, 0.81, -0.32/2])
41 obj = si.add_box(
'camera_mount1', [0.19, 0.19, 0.2], [-0.45, 0.2, -0.2/2])
42 obj = si.add_box(
'camera_mount2', [0.19, 0.19, 0.2], [-0.45, 0.61, -0.2/2])
43 obj = si.add_box(
'roomba', [0.45, 0.50, 0.23], [0, 0.40, 0.23/2-0.32])
44 obj = si.add_box(
'floor', [2, 3, 0.01], [1-0.65, 3.0/2-0.55, -0.3205])
def add_box(self, name, size, pose, orientation=[0)
def make_pose(self, pose, orientation)