ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
co.mesh_poses[0].orientation.w= 0.0;
co.mesh_poses[0].orientation.x= 0.0;
co.mesh_poses[0].orientation.y= 3.14;
co.mesh_poses[0].orientation.z= -3.1415;

Poses in ROS are encoded as quaternions, not Euler angles. From your code snippet, I get the idea that you tried to assign Euler angle rotations around the Y and Z-axis. That won't work (as you noticed). If you want to continue using Euler angles, you can convert them to a quaternion before assigning them to the co.mesh_poses array elements.

co.mesh_poses[0].orientation.w= 0.0;
co.mesh_poses[0].orientation.x= 0.0;
co.mesh_poses[0].orientation.y= 3.14;
co.mesh_poses[0].orientation.z= -3.1415;

Poses in ROS are encoded as quaternions, not Euler angles. From your code snippet, I get the idea that you tried to assign Euler angle rotations around the Y and Z-axis. That won't work (as you noticed). If you want to continue using Euler angles, you can convert them to a quaternion before assigning them to the co.mesh_poses array elements.


Edit:

group.attachObject("Mounter", "ee_link");

It might also be an idea to attach your object to the tool0 link of the UR10 model, instead of ee_link. The tool0 link was recently introduced (universal_robot/pull#200) and is oriented in such a way that it corresponds to the default (all-zeros) toolframe of the UR10.

co.mesh_poses[0].orientation.w= 0.0;
co.mesh_poses[0].orientation.x= 0.0;
co.mesh_poses[0].orientation.y= 3.14;
co.mesh_poses[0].orientation.z= -3.1415;

Poses in ROS are preferably encoded as quaternions, not Euler angles. The moveit_msgs/CollisionObject message uses arrays of geometry_msgs/Pose messages to store those poses.

From your code snippet, I get the idea that you tried to assign Euler angle rotations around the Y and Z-axis. That won't work (as you noticed). If you want to continue using Euler angles, you can convert them to a quaternion before assigning them to the co.mesh_poses array elements.


Edit:

group.attachObject("Mounter", "ee_link");

It might also be an idea to attach your object to the tool0 link of the UR10 model, instead of ee_link. The tool0 link was recently introduced (universal_robot/pull#200) and is oriented in such a way that it corresponds to the default (all-zeros) toolframe of the UR10.


Edit2: see Transform Quaternion fi for some hints on how to perform the conversion.