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

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
1

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

Question Tools

1 follower

Stats

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

Seen: 211 times

Last updated: Aug 18 '20