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

Moveit & UR speed scaling: Controller is taking too long to execute trajectory

asked 2020-07-28 08:46:38 -0500

dschimpf gravatar image

updated 2020-07-28 10:27:55 -0500

Hello everyone,

I am using a UR robot and Moveit. I am using speed scaling to adjust the speed of the robot. This is the UR driver that I am using and this is my controllers.yaml:

controller_list:
  - name: ""
    action_ns: scaled_pos_traj_controller/follow_joint_trajectory
    type: FollowJointTrajectory
    joints: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]

Like mentioned in this question I added:

<param name="allowed_execution_duration_scaling" value="100.0"/>

but with a speed of 20% I still get the error:

Controller is taking too long to execute trajectory

Even though a allowed_execution_duration_scaling value of 5 should be enough for 20% of the speed.

With values over 50% I am not getting any error messages.

Do I have a wrong understanding of the function of the allowed_execution_duration_scaling?

What other ways are there to change the robot speed with moveit?

Thanks!

Daniel

edit retag flag offensive close merge delete

Comments

This should not be necessary, but it depends a bit on what exactly you are trying to do.

As a first step: please update your question to mention which driver you are using.

gvdhoorn gravatar image gvdhoorn  ( 2020-07-28 10:05:07 -0500 )edit

I updated my question. Please let me know if any other information may be helpful. Thank you!

dschimpf gravatar image dschimpf  ( 2020-07-28 10:28:59 -0500 )edit
1

Based on your update: this is a "know issue". MoveIt's trajectory execution manager is not aware of any scaling on the driver/robot controller side, so it will assume 100% of the joint limits are available for execution. This will cause timeouts when executing trajectories with a robot controller configured for a lower maximum scale.

I'm not aware of any work to fix this right now. Possible approaches:

  • update the trajectory execution manager to be able to deal with the concept of scaling (perhaps subscribe to the appropriate topic published by the driver)
  • use velocity an acceleration scaling on the MoveIt-side (ie: don't use full joint limits to parameterise trajectories)
gvdhoorn gravatar image gvdhoorn  ( 2020-07-28 10:45:49 -0500 )edit

Because moveit is not aware of any scaling thought I could use the allowed_execution_duration_scaling. And by setting it to 5 my task would be allowed to last 5 times as long before a timeout. Which should be enough when executing it at 20% of the speed. I'll look into the other things. Thank you!

dschimpf gravatar image dschimpf  ( 2020-07-28 11:26:20 -0500 )edit

@gvdhoorn Would I be able to send the planned cartesian trajectory with MoveIt through a different trajectory execution manager and then make use of the speed scaling? If so do you have some resources that show how to do this? Could I follow this tutorial (http://wiki.ros.org/Robots/TIAGo/Tuto...) to send the trajectory and be able to scale the speed? My main goal is to execute a cartesian trajectory (planned with MoveIt ) and be able to change the speed during the execution. I am ok with not using the MoveIt execution manager. Thanks!

dschimpf gravatar image dschimpf  ( 2021-03-02 13:57:12 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2020-07-28 13:16:22 -0500

dschimpf gravatar image

updated 2021-03-08 14:41:16 -0500

For anyone that wants to do the same thing: What I have decided to do now is changing the max_velocity in joint_limits.yaml (from moveit_config, created from setup assistant). I still need to have the set the speed scaling to 100%, but now the robot moves slower. In rviz under planning one can also set the velocity factor (from 0 - 1). That worked for plans created in rviz, but not through a C++ file.

Second option: Use /ur_hardware_interface/set_speed_slider topic to change speed scaling value. Use trajectory from MoveIt and convert it from moveit_msgs::RobotTrajector to control_msgs::FollowJointTrajectoryGoal.

moveit_msgs::RobotTrajectory trajectory;
trajectory_msgs::JointTrajectory joints_combined = trajectory.joint_trajectory;
control_msgs::FollowJointTrajectoryGoal goal;
goal.trajectory = joints_combined;
goal.goal_time_tolerance = ros::Duration(1.0);

This can then be send to robot via action client and won't stop because of slow execution.

actionlib::SimpleActionClient<control_msgs::FollowJointTrajectoryAction> ac("/scaled_pos_joint_traj_controller/follow_joint_trajectory", true);
 ac.sendGoal(goal);
edit flag offensive delete link more

Comments

Second option: Use /ur_hardware_interface/set_speed_slider topic to change speed scaling value

as long as it's clear you're changing the position of the slider on the TP, not setting the "speed scaling value" directly.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-09 02:30:48 -0500 )edit

Yes, from a node I am changing the position of the slider on the TP which changes the speed scaling value.

dschimpf gravatar image dschimpf  ( 2021-03-09 08:16:14 -0500 )edit
0

answered 2021-03-03 03:48:05 -0500

gvdhoorn gravatar image

updated 2021-03-03 03:52:50 -0500

Would I be able to send the [..] trajectory [..] through a different trajectory execution manager [..]

I'm not aware of any generically reusable trajectory execution managers.

Note also: trajectory execution manager is terminology specific to MoveIt. It's not a well known name for this concept necessarily.

Would I be able to send the planned cartesian trajectory with MoveIt

please note: as soon as you get the result back of MoveIt's computeCartesianPath(..) function (or any other MoveIt planning services), you're dealing with a trajectory in joint space. There isn't anything Cartesian about it any more.

be able to scale the speed?

before execution I believe the MoveIt terminology would be retiming, not scaling.

My main goal is to execute a cartesian trajectory (planned with MoveIt ) and be able to change the speed during the execution

That's something Universal_Robots_ROS_Driver already does, albeit indirectly via the scaling factor which comes from the UR CB controller. I'm not sure you can influence this programmatically without some additional work, but you could ask this on the Universal_Robots_ROS_Driver issue tracker.

Could I follow this tutorial (http://wiki.ros.org/Robots/TIAGo/Tuto...) to send the trajectory and be able to scale the speed?

the tutorial you link seems to show a Tiago-specific actionlib client to the FollowJointTrajectory server of ros_control. I'm not sure, but I don't believe that offers any special functionality.


You may be interested in fzi-forschungszentrum-informatik/cartesian_controllers and fzi-forschungszentrum-informatik/cartesian_ros_control.

The latter specifically models the concept of speed-scal[ing] trajectory execution. Whether that's compatible with what you're trying to do and the driver(s) you're attempting to use I can't say.

Also: MoveIt currently cannot be used directly with these controllers -- as it doesn't have the appropriate action client (so it can't "talk" to these controllers).

edit flag offensive delete link more

Comments

"That's something Universal_Robots_ROS_Driver already does, albeit indirectly via the scaling factor which comes from the UR CB controller." Yes, that is how I got the idea to do this, but I don't know how to execute a trajectory with something besides MoveIt. So I guess the question is how can I "talk" to the scaled_pos_traj_controller so that I can use speed scaling? Do you have an example (maybe some c++ code, or a node) that sends a trajectory to a UR robot in a way that the speed scaling works? (since it does not via moveit)

"before execution I believe the MoveIt terminology would be retiming, not scaling." Yeah I got that figured out and that way can change the speed of the trajectory before it is started, but I would like to make changes during the execution, based on some sensors.

I ran across the second one ...(more)

dschimpf gravatar image dschimpf  ( 2021-03-03 12:11:02 -0500 )edit

I think I should be able to convert the trajectory generated by MoveIt and send it out as in this example: https://github.com/UniversalRobots/Un... Hopefully that will allow for speed scaling.

I also asked on the Universal_Robots_ROS_Driver issue tracker if the speed scaling value can be set through ROS.

dschimpf gravatar image dschimpf  ( 2021-03-03 16:35:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-28 08:46:38 -0500

Seen: 2,037 times

Last updated: Mar 08 '21