Robotics StackExchange | Archived questions

getCurrentPose take too long time

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 [ INFO] [1597240523.426997661]: 1.068342 secs for getting pose.

Asked by Ceciliaxu on 2020-08-12 09:59:42 UTC

Comments

Answers

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.

Asked by fergs on 2020-08-18 08:55:54 UTC

Comments