moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
983 stars 493 forks source link

MGI getCurrentPose() duration #2826

Closed fzoric8 closed 1 month ago

fzoric8 commented 1 month ago

MGI getCurrentPose() + unable to fetch robot state

Hi,

I'm trying to enable MGI for my arm. But I'm encountering several issues. My biggest issue is related to fetching robot state. I've put use_sim_time true to every node that's launched, I'm subscribing to correct joint_states topic. however, I'm still not able to fetch current robot state, with following message:

Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 107.048000, but latest received state has time 107.044000.

My latest received time is always smaller than requested time.

Besides that, duration of the mGI->getCurrentPose(EE_LINK_NAME) is around 1 second, which to me sounds really long. Especially compared to the old MoveIt!.

Duration of the mGI->getCurrentState() is also around 1 second. So if I put both of those methods into my run function (to refersh) end effector pose on the topic, duration of the run method is about 2 seconds...

I've tried chaning MGI to SingleExecutorThread as mentioned in several issues with same problem, however, everything stays same. I'm running MGI as follows:

auto executor = std::make_unique<rclcpp::executors::MultiThreadedExecutor>();
    rclcpp::Rate loop_rate(1000);
    while (rclcpp::ok())
    {
        executor->spin_node_once(node);
        loop_rate.sleep();
    }

Your environment

Expected behaviour

Robot should be able to fetch end effector pose so I can publish it on a topic fast (less than 0.1 sec).

fzoric8 commented 1 month ago

Managed to solve the problem with the help of #496 .