0
$\begingroup$

Rosanswers logo

Hey guys, im trying to add some simple collision objects in Python to my planning scene in RViz to plan some trajectories with my UR5 Robot. I tried something like

scene = moveit_commander.PlanningSceneInterface()
p.pose.position.x = 0.4
p.pose.position.y = -0.2
p.pose.position.z = 0.3
scene.add_box("table", p, (0.5, 1.5, 0.6))

but this didnt work. Unfortunately the MoveIt! Tutorial is missing this part for Python (only got it for C++). Can anyone help please?

Im running ROS Indigo on Ubuntu 14.04.


Originally posted by Rhemus on ROS Answers with karma: 79 on 2017-02-27

Post score: 1


Original comments

Comment by gvdhoorn on 2017-02-27:
p.pose.orientation.w is probably initialised to 0. That is not a valid quaternion. Try setting w to 1 and see if that changes anything.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Did you see this related question: #q209030 ? If that doesn't solve your problem: is this the complete code or just a small part? Also, did you see an error message of some sort?


Originally posted by rbbg with karma: 1823 on 2017-02-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Rhemus on 2017-02-28:
Thanks i found the solution in the related question!

Comment by gvdhoorn on 2017-02-28:
So what was the solution in the end?

Comment by Rhemus on 2017-02-28:
I was missing some parts of the code. Just look at the answer on the linked question, there is the completed code and it worked for me.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.