how pos/vel_based_pos_traj_controller work?
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:
pos_based_pos_traj_controller:
type: position_controllers/JointTrajectoryController
joints:
- shoulder_pan_joint
- shoulder_lift_joint
- elbow_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
constraints:
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:=192.168.0.9
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:
controller_list:
- name: /vel_based_pos_traj_controller
action_ns: follow_joint_trajectory
type: FollowJointTrajectory
default: true
joints:
- shoulder_pan_joint
- shoulder_lift_joint
- elbow_joint
- wrist_1_joint
- wrist_2_joint
- wrist_3_joint
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.
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...)