Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1441

MoveIt Attach Object Error

$
0
0
Here is my node to add an object and attach it to the robot : #include #include #include using namespace Eigen; int main(int argc, char **argv) { ros::init(argc, argv, "add_workpiece_wall"); ros::NodeHandle nh; ros::AsyncSpinner spin(1); spin.start(); moveit::planning_interface::PlanningSceneInterface current_scene; sleep(2.0); Vector3d b(0.001, 0.001, 0.001); moveit_msgs::CollisionObject co; co.id = "workpiece_wall"; shapes::Mesh* m = shapes::createMeshFromResource("package://mitsubishi_rv6sd_support/meshes/workpiece_wall.stl",b); ROS_INFO("Workpiece Wall mesh loaded"); shape_msgs::Mesh mesh; shapes::ShapeMsg mesh_msg; shapes::constructMsgFromShape(m, mesh_msg); mesh = boost::get(mesh_msg); co.meshes.resize(1); co.mesh_poses.resize(1); co.meshes[0] = mesh; co.header.frame_id = "base_link"; co.mesh_poses[0].position.x = 0.560651; co.mesh_poses[0].position.y = 0.579113; co.mesh_poses[0].position.z = 0.0; co.mesh_poses[0].orientation.w= 0.0; co.mesh_poses[0].orientation.x= 0.0; co.mesh_poses[0].orientation.y= 0.0; co.mesh_poses[0].orientation.z= 0.0; co.meshes.push_back(mesh); co.mesh_poses.push_back(co.mesh_poses[0]); co.operation = co.ADD; std::vector abc; abc.push_back(co); ROS_INFO("Workpiece Wall added into the world"); current_scene.addCollisionObjects(abc); sleep(5.0); moveit::planning_interface::MoveGroup g("arm"); ROS_INFO("Attach Workpiece Wall to the robot"); g.attachObject(co.id); // Sleep to give Rviz time to show the object attached (different color). sleep(4.0); ros::shutdown(); return 0; } ---------- And the error I'm getting is this: terminate called after throwing an instance of 'std::runtime_error' what(): No Trajectory execution capability available. [add_workpiece_wall-7] process has died [pid 47204, exit code -6, cmd /home/sbr/mitsubishi/devel/lib/mitsubishi_rv6sd_support/add_workpiece_wall __name:=add_workpiece_wall __log:=/home/sbr/.ros/log/d1c6e840-9ac0-11e6-ba06-480fcf447f3c/add_workpiece_wall-7.log]. log file: /home/sbr/.ros/log/d1c6e840-9ac0-11e6-ba06-480fcf447f3c/add_workpiece_wall-7*.log ---------- From my [previous question](http://answers.ros.org/question/245995/adding-collision-object-in-moveit/) it is somewhat clear that the error is only because of these lines : moveit::planning_interface::MoveGroup g("arm"); ROS_INFO("Attach Workpiece Wall to the robot"); g.attachObject(co.id); // Sleep to give Rviz time to show the object attached (different color). sleep(4.0);

Viewing all articles
Browse latest Browse all 1441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>