Ask Your Question

how pos/vel_based_pos_traj_controller work?

asked 2018-06-25 10:57:32 -0500

enrico gravatar image

updated 2018-06-27 10:12:36 -0500

Hi all,

I am trying to control a real UR5 using the position based controller of ur_modern_driver package, but I have a little problem: when i plan and execute a trajectory through MoveIt the robot achieves the goal not in a clean way (the end-effector passes over the goal and reaches it in a second moment after few oscillations).

  • What should I do in order to improve this situation? I know there are some parameters that could be set in the ur5_controllers.yaml file (ur_modern_driver -> config -> ur5_controllers.yaml) but the PID parameters can be set only for velocity_based controller, which I don't use because when I try to use it the robot doesn't move at all! Then here comes another question:

  • how can I use vel_based_pos_traj_controller from ur_modern_driver package?

At the moment I am using pos_based_pos_traj_controller, but I don't know how to setup it. Here I copy its yaml code:

type: position_controllers/JointTrajectoryController
     - shoulder_pan_joint
     - shoulder_lift_joint
     - elbow_joint
     - wrist_1_joint
     - wrist_2_joint
     - wrist_3_joint
      goal_time: 0.6
      stopped_velocity_tolerance: 0.05
      shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}
      shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}
      elbow_joint: {trajectory: 0.1, goal: 0.1}
      wrist_1_joint: {trajectory: 0.1, goal: 0.1}
      wrist_2_joint: {trajectory: 0.1, goal: 0.1}
      wrist_3_joint: {trajectory: 0.1, goal: 0.1}
   stop_trajectory_duration: 0.5
   state_publish_rate:  125 
   action_monitor_rate: 10

   # state_publish_rate:  50 # Defaults to 50
   # action_monitor_rate: 20 # Defaults to 20
   #hold_trajectory_duration: 0.0 # Defaults to 0.5

The commands I run in order to communicate with real hardware are the followings:

roslaunch ur_modern_driver ur5_ros_control.launch robot_ip:=

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

my ubuntu version: 16.04 Ros Kinetic

Thanks in advance to anyone who will help. -Enrico

Edit: this is the error when using /vel_based_pos_traj_controller:

[ WARN] [1530109956.151695655]: Controller /vel_based_pos_traj_controller failed with error code PATH_TOLERANCE_VIOLATED

[ WARN] [1530109956.151808590]: Controller handle /vel_based_pos_traj_controller reports status ABORTED

[ INFO] [1530109956.170454938]: Completed trajectory execution with status ABORTED ...

[ INFO] [1530109956.170689596]: Execution completed: ABORTED

(Actually I have the same kind of error when running pos_based controller, but the execution is done anyway)

this is my controller.yaml when using vel_based_controller:

  - name: /vel_based_pos_traj_controller
    action_ns: follow_joint_trajectory 
    type: FollowJointTrajectory
    default: true
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint
edit retag flag offensive close merge delete


This is probably an issue with the specific driver and how it uses the external interfaces of the UR controller, and not necessarily something to do with the parameters. It could still be the case that those parameters influence this, but just thought I'd mention this.

gvdhoorn gravatar image gvdhoorn  ( 2018-06-25 11:15:46 -0500 )edit

In that case what would you suggest? Or alternatively, do you have an idea on how I could implement the vel_based controller instead of the pos_based one? (if you've ever experienced it...)

enrico gravatar image enrico  ( 2018-06-25 11:32:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-26 10:23:36 -0500

Fiddle gravatar image

Are you already using the ur_modern_driver package? The velocity controller is loaded then by default - then those oscillations are occurring because of bad PID values. If you want to be sure that you use the controller that you want you need to edit the moveit controllers config (everything is in the ur_modern_driver repository). Also, I see that the position controller has its own PID, so changing those values might help.

edit flag offensive delete link more


Yes I'm using ur_modern_driver package, but if I don't switch from velocity_controller to position_controller I am not able to plan and execute a trajectory. In the piece of code of pos_controller I pasted above I can't see PID values... are you referring to another file?

enrico gravatar image enrico  ( 2018-06-26 13:44:26 -0500 )edit

Ah, sorry, I looked at the wrong piece of code. Anyway, I was fine with using the velocity controller, only I had to change the PID values (you have to experiment with them). Also, I've played with action_monitor_rate. What are your logs when using velocity controller?

Fiddle gravatar image Fiddle  ( 2018-06-27 09:08:26 -0500 )edit

I edited the question. Another thing is that I read about ros_control and ros_controllers packages but I haven't installed them already. Did you install them?

enrico gravatar image enrico  ( 2018-06-27 09:39:33 -0500 )edit

Sorry for responding so late, and yes, I have ros_control and ros_controllers installed

Fiddle gravatar image Fiddle  ( 2018-07-03 04:43:09 -0500 )edit

I installed them, but still bad result in the trajectory execution. Did you modify them in some way?

enrico gravatar image enrico  ( 2018-07-03 10:06:05 -0500 )edit

The only thing I changed are PID values that I found somewhere on the web: {p: 18.0, i: 270.0, d: 0.0001, i_clamp: 20.14} for all joints. This of course needs to changed further, but it worked enough for my usage at the time.

Fiddle gravatar image Fiddle  ( 2018-07-04 05:37:28 -0500 )edit

can you paste here your ur5_ros_control.launch file please?

enrico gravatar image enrico  ( 2018-07-04 08:57:20 -0500 )edit

Its the same as here the only difference is <arg name="max_velocity" default="3.14"/> edit: thinking about it, this is a different fork of ur_modern_driver, maybe you should try it

Fiddle gravatar image Fiddle  ( 2018-07-04 09:02:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-06-25 10:57:32 -0500

Seen: 375 times

Last updated: Jun 27 '18