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

Unknown Frame error while running object adding node in moveit.

asked 2020-07-20 16:29:30 -0600

saztyga gravatar image

updated 2023-06-18 09:57:14 -0600

lucasw gravatar image

I am running demo.launch (/move_group/fake_controller_joint_states) , But whenever i run add_collision node(c++) moveit terminal throw Unknown frame: error.

i have successfully build my catkin environment .

int main(int argc, char **argv)

ros::init(argc, argv, "add_collision_objct");
ros::NodeHandle nh;

ros::AsyncSpinner spin(1);
spin.start();

moveit::planning_interface::PlanningSceneInterface current_scene;

sleep(5.0);
moveit_msgs::CollisionObject cylinder;

cylinder.id = "moveit_seven_dof";

shape_msgs::SolidPrimitive primitive;
primitive.type = primitive.CYLINDER;
primitive.dimensions.resize(3);
primitive.dimensions[0] = 0.6;
primitive.dimensions[1] = 0.2;


geometry_msgs::Pose pose;
pose.orientation.w = 1.0;
pose.position.x =  0.0;
pose.position.y = -0.1;
pose.position.z =  0.1;

cylinder.primitives.push_back(primitive);
cylinder.primitive_poses.push_back(pose);
cylinder.operation = cylinder.ADD;

std::vector<moveit_msgs::CollisionObject> collision_objects;
collision_objects.push_back(cylinder);

current_scene.addCollisionObjects(collision_objects);

ros::shutdown();

return 0;

}

Melodic ubantu 18.04.4 LTS 3.28.2

Plz Help me with this

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-07-20 17:50:22 -0600

saztyga gravatar image

I have figured it out, frame id should be there. cylinder.header.frame_id ="Your Frame"

edit flag offensive delete link more

Comments

cylinder.header.frame_id = "base_link";

飞天鸟 gravatar image 飞天鸟  ( 2022-09-27 20:20:04 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-20 16:29:30 -0600

Seen: 495 times

Last updated: Jul 20 '20