ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

getCurrentPose take too long time

asked 2020-08-12 10:00:59 -0500

Ceciliaxu gravatar image

updated 2020-08-18 08:53:00 -0500

fergs gravatar image

I called moveit’s move_group::getCurrentPose() to get the position of the endeffector of a universal robot, but I found it takes more than 1 secs, Real-time performance can not meet the requirements. Is there any solution to improve the real-time of the API, or I just do the forward kinematics through tf will be okay. Here is part of my code

  ros::Time getpose_begin_time = ros::Time::now();
  static const std::string PLANNING_GROUP = "manipulator";
  moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);  
  current_pose = move_group.getCurrentPose().pose;
  double getpos_time = (ros::Time::now() - getpose_begin_time).toSec();
  ROS_INFO ("%f secs for getting pose.", getpos_time);

Here is the ourput ROS_INFO

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-08-18 08:55:54 -0500

fergs gravatar image

Two possible culprits:

  • My first guess is that the 1s is actually almost certainly from constructing a new MoveGroupInterface - which has to read all sorts of YAML files on the filesystem. Try moving the first call to ros::Time::now() after that to only measure the getCurrentPose() time.
  • A second possibility is that your TF is not up to date, if you're on multiple computers make sure the clocks are synced.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-08-12 09:59:42 -0500

Seen: 191 times

Last updated: Aug 18 '20