moveit2 icon indicating copy to clipboard operation
moveit2 copied to clipboard

An early call to `planning_scene_monitor_->getStateMonitor()->getCurrentState()` returns `nan` accelerations

Open AndyZe opened this issue 1 year ago • 2 comments

Description

As noticed in PR #2956. An early call to getCurrentRobotState() returns all-nan accelerations but seems to be fine after that.

KinematicState Servo::getCurrentRobotState() const
{
  bool have_current_state = false;
  while (rclcpp::ok() && !have_current_state)
  {
    have_current_state =
        planning_scene_monitor_->getStateMonitor()->waitForCurrentState(rclcpp::Clock(RCL_ROS_TIME).now(), ROBOT_STATE_WAIT_TIME /* s */);
    if (!have_current_state)
    {
      RCLCPP_WARN(logger_, "Waiting for the current state");
    }
  }
  moveit::core::RobotStatePtr robot_state = planning_scene_monitor_->getStateMonitor()->getCurrentState();
  return extractRobotState(robot_state, servo_params_.move_group_name);
}
.
.
KinematicState extractRobotState(const moveit::core::RobotStatePtr& robot_state, const std::string& move_group_name)
{
  ...
  // The accelerations here are all nan
  robot_state->copyJointGroupAccelerations(joint_model_group, current_state.accelerations);
  ...
}

AndyZe avatar Aug 08 '24 16:08 AndyZe

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

github-actions[bot] avatar Sep 23 '24 12:09 github-actions[bot]

This issue was closed because it has been stalled for 45 days with no activity.

github-actions[bot] avatar Nov 08 '24 12:11 github-actions[bot]