Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Moveit PlanningSceneInterface addBox not showing in Rviz

My goal is to be able to add and remove object dynamically then do path planning. Even moving objects should be nice but I don't know if it's possible

I want to add box or meshes to my Planning scene to do path planning avoiding some object. The problem is that after adding object to the scene interface I don't have any visual feedback in RViz and if possible spawn this object in gazebo as well to be able to have physics.

This is what I do.

rospy.init_node('scene_test', anonymous=True)

scene = moveit_commander.PlanningSceneInterface()

p = PoseStamped()
p.pose.position.x = 0.
p.pose.position.y = 0.
p.pose.position.z = 0.
scene.add_box("table", p, (1, 1, 1))

rospy.sleep(10)

I don't know how to check the scene because the interface doesn't provide any method to do so, but nothing appear in RViz. I suspect something is missing to notice Rviz a new object is here but I can't find anything related to this issue.

Thank you for reading, any help will be much appreciated

Moveit PlanningSceneInterface addBox not showing in Rviz

My goal is to be able to add and remove object dynamically then do path planning. Even moving objects should be nice but I don't know if it's possible

I want to add box or meshes to my Planning scene to do path planning avoiding some object. The problem is that after adding object to the scene interface I don't have any visual feedback in RViz and if possible RViz. Later I would like to spawn this object in gazebo as well to be able to have physics.

This is what I do.

rospy.init_node('scene_test', anonymous=True)

scene = moveit_commander.PlanningSceneInterface()

p = PoseStamped()
p.pose.position.x = 0.
p.pose.position.y = 0.
p.pose.position.z = 0.
scene.add_box("table", p, (1, 1, 1))

rospy.sleep(10)

I don't know how to check the scene because the interface doesn't provide any method to do so, but nothing appear in RViz. I suspect something is missing to notice Rviz a new object is here but I can't find anything related to this issue.

Thank you for reading, any help will be much appreciated