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

moveit c++ interface- unexpected robot movement

$
0
0
Hello, I’m trying to implement pick and place with moveit and gazebo. i have gazebo simulated robot and i’m sending cartesian pose through moveit’s c++ interface. at initial stage i want my robot to approach the block, i have fetched the pose of the robot from gazebo by calling the service get_model_state, and i have fed it to the moveit c++ interface program. i expect robot to move to the object but robot moves in exact opposite direction. can anyone explain this behaviour and what i’m doing wrong? Below you will find: **Image of robot and object that i want to approach** ![image description](/upfiles/15507695819847137.png) **Pose retrieved from gazebo** position_x=0.871467 position_y=-0.076430 position_z=0.295392 orientation_x=0.002768 orientation_y=-0.003604 orientation_z=0.003009 orientation_w=0.999985 **below is the code i’m using** int main(int argc, char** argv) { ros::init(argc, argv, "moveit_interface"); ros::NodeHandle node_handle; ros::AsyncSpinner spinner(1); spinner.start(); static const std::string PLANNING_GROUP = "panda_arm"; moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP); //setting up movegroup class moveit::planning_interface::PlanningSceneInterface planning_scene_interface; const robot_state::JointModelGroup* joint_model_group = move_group.getCurrentState()->getJointModelGroup(PLANNING_GROUP); move_group.setPlanningTime(15); // Planning to a Pose goal // We can plan a motion for this group to a desired pose for the // end-effector. geometry_msgs::Pose target_pose1; target_pose1.orientation.x = 0.002768; target_pose1.orientation.y = -0.003604; target_pose1.orientation.z = 0.003009 ; target_pose1.orientation.w = 0.999985; target_pose1.position.x = 0.871467; target_pose1.position.y = -0.076430; target_pose1.position.z = 0.295392; move_group.setApproximateJointValueTarget(target_pose1, "panda_link7"); //move_group.setPoseTarget(target_pose1); //call the planer to plan the myplan moveit::planning_interface::MoveGroupInterface::Plan my_plan; //moving to pose goal move_group.move(); ros::shutdown(); return 0; } **Update 1** Reference frames of object and robot ![image description](/upfiles/1550773155743854.png) ![image description](/upfiles/15507731708430915.png)

Viewing all articles
Browse latest Browse all 1441

Trending Articles



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