Robotics StackExchange | Archived questions

Can't get robot arm's current pose with a error (Failed to fetch current robot state)

Hello, everyone.

Thank for looking this thread.

I want to get end-effector(linkt)'s pose using `moveit::planninginterface::MoveGroupInterface::getCurrentPose()`.

But, I could not get end-effector's pose and orientation like below( I wonder that frame_id is world).

header: 
  seq: 0
  stamp: 74.419000000
  frame_id: world
pose: 
  position: 
    x: 0
    y: 0
    z: 0
  orientation: 
    x: 0
    y: 0
    z: 0
    w: 1

I got following error (Failed to fetch current robot state)

robot@robot-NG:~$ rosrun sia20_control sequential_ik_solver 
Is start spinner? true
[ INFO] [1559035400.947083805]: Loading robot model 'sia20'...
[ WARN] [1559035401.013390105]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/sia20_arm/kinematics_solver_attempts' from your configuration.
[ INFO] [1559035402.311004825, 73.418000000]: Ready to take commands for planning group sia20_arm.
end effector name is 
[ INFO] [1559035403.314437642, 74.418000000]: Didn't received robot state (joint angles) with recent timestamp within 1 seconds.
Check clock synchronization if your are running ROS across multiple machines!
[ERROR] [1559035403.314531291, 74.419000000]: Failed to fetch current robot state
header: 
  seq: 0
  stamp: 74.419000000
  frame_id: world
pose: 
  position: 
    x: 0
    y: 0
    z: 0
  orientation: 
    x: 0
    y: 0
    z: 0
    w: 1

 [ INFO] [1559035404.314786192, 75.416000000]: Didn't received robot state (joint angles) with recent timestamp within 1 seconds.
Check clock synchronization if your are running ROS across multiple machines!
[ERROR] [1559035404.314857179, 75.417000000]: Failed to fetch current robot state
header: 
  seq: 0
  stamp: 75.417000000
  frame_id: world
pose: 
  position: 
    x: 0
    y: 0
    z: 0
  orientation: 
    x: 0
    y: 0
    z: 0
    w: 1

When I run following program.

#include <iostream>
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <trajectory_msgs/JointTrajectory.h>
#include <moveit/move_group_interface/move_group_interface.h>

int main(int argc, char* argv[])
{
    ros::init(argc, argv, "sequential_ik_solver");
    ros::NodeHandle node_handle;
    ros::AsyncSpinner spinner(3);
    spinner.start();
    std::cout << "Is start spinner? " << std::boolalpha << spinner.canStart() << std::endl;
    const std::string PLANNING_GROUP = "panda_arm";
    moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);
    //move_group.setEndEffectorLink("link_t");
     std::cout << "end effector name is " << move_group.getEndEffector() << std::endl;

    while (ros::ok()) {
        std::cout << move_group.getCurrentPose() << std::endl;
   }

   return 0;
   }

I found the cause, take a look following image. My program which try to get end-effector pose is sequenceiksolver. It subscribes /jointstates topic which is not published. And /sia20/jointstates topic which contains joints information is published from gazebo. I want /sequenceiksolver to subscribe /sia20/joint_states topic. How should I do?

https://imgur.com/llaTcPk

I'm glad if you know how to solve this problem it or come up with the cause, let me know it.

Thanks in advance.

[Additional information]

If you need additional information, feel free to tell me it.

Asked by harumo11 on 2019-05-28 04:56:13 UTC

Comments

Check clock synchronization if your are running ROS across multiple machines!

Have you investigated this message here? TF lookups between computers without syncing the clocks is a common problem.

Asked by PeteBlackerThe3rd on 2019-05-28 05:19:52 UTC

I'm glad to reply!

Yes, I did. But, I use single machine. Do you know other candidate of the cause?

Asked by harumo11 on 2019-05-28 23:25:43 UTC

Did you manage to solve this problem? I have the same issue

Asked by ThimoF on 2020-04-09 03:35:22 UTC

Hello. ThimoF, Yes. I did. Could you show me your the result of rqt_graph and launch file. If you just change topic name, you can use remap command in your launch file.

Asked by harumo11 on 2020-04-10 03:16:50 UTC

Hi! I'm running into the same error. It seems that move_group is subscribed to /joint_states, but I don't understand why It does not work. How did you managed to solve it?

Asked by lms95 on 2020-05-04 16:09:59 UTC

Thank you harumo11, my joint states where published under the /robot/joint_states topic. Remapping fixed the issue. lms95 maybe this works for you as well. Use "rqt_graph" or "rostopic list" to find the correct topic and use remapping in your launch file or as a rosrun argument

Asked by ThimoF on 2020-05-07 02:13:39 UTC

It may sound silly, in fact it is, and a bit embarrassing but my simulation was paused, that was the reason why I wasn't receiving data. Thank you for the reply anyways!

Asked by lms95 on 2020-05-07 10:42:49 UTC

Answers