Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I finally find out why, the pose header was missing and the node need a sleep before adding box to scene otherwise it will skip it.

scene = moveit_commander.PlanningSceneInterface()
robot = moveit_commander.RobotCommander()

rospy.sleep(2)

p = PoseStamped()
p.header.frame_id = robot.get_planning_frame()
p.pose.position.x = 0.
p.pose.position.y = 0.
p.pose.position.z = 0.
scene.add_box("table", p, (0.5, 1.5, 0.6))