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

Moveit servo with Universal Robot UR5, don't want to move robot

asked 2021-05-12 09:30:52 -0500

EspenT gravatar image

Hi. i have struggled for a while now with implementing moveit servo on my UR-robot. When i try to publish a message to move the robot, I only get messages about halting for collision and Stale command(full log further down). I have confirmed that communication between ROS and UR CB-controller is working by running a path planning with moveit.

My configuration:

ROS melodic on Ubuntu 18.04 in WSL2

I use the Universal_Robots_ROS_Driver to communicate with controller

I have a virtual machine running the CB-controller

ros-melodic-moveit-servo is installed

Here is how I start my setup

roslaunch telecoffee bringup_ur.launch

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=false

roslaunch telecoffee servo.launch

After everything is booted up i switch controller with

rosservice call /controller_manager/switch_controller "start_controllers: ['joint_group_vel_controller']
stop_controllers: ['scaled_pos_joint_traj_controller']
strictness: 0
start_asap: false
timeout: 0.0"

and confirms that controller is running

name: "joint_group_vel_controller"
state: "running"
type: "velocity_controllers/JointGroupVelocityController"
claimed_resources:
  -
    hardware_interface: "hardware_interface::VelocityJointInterface"
    resources: [elbow_joint, shoulder_lift_joint, shoulder_pan_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]

This is servo.launch

<?xml version="1.0"?>

 <launch>
     <node name="servo_server" pkg="telecoffee" type="servo_server" output="screen" >
     <param name="parameter_ns" type="string" value="optional_parameter_namespace" />
     <rosparam ns="optional_parameter_namespace" command="load" file="$(find telecoffee)/config                                                               /ur_servo.yaml" />
     </node>
 </launch>

And this is my servo configuration file ur_servo.yaml

use_gazebo: false # Whether the robot is started in a Gazebo simulation environment
command_in_type: "speed_units" 
scale: # Scale parameters are only used if command_in_type=="unitless"
linear:  0.0006  
rotational:  0.003 
joint: 0.001 
low_pass_filter_coeff: 2.  # Larger --> trust the filtered data more, trust the measurements less.
publish_period: 0.01  # 1/Nominal publish rate [seconds]
publish_delay: 0.005  # Delay between calculation and execution start of command
command_out_type: std_msgs/Float64MultiArray
publish_joint_positions: false
publish_joint_velocities: true
publish_joint_accelerations: false
move_group_name:  manipulator  # Often 'manipulator' or 'arm'
planning_frame: world
ee_frame_name: wrist_3_link  
robot_link_command_frame:  base_link 
incoming_command_timeout:  1  # Stop servoing if X seconds elapse without a new command
num_outgoing_halt_msgs_to_publish: 0
lower_singularity_threshold:  17  
hard_stop_singularity_threshold: 30 # Stop when the condition number hits this
joint_limit_margin: 0.15 
cartesian_command_in_topic: delta_twist_cmds  # Topic for incoming Cartesian twist commands
joint_command_in_topic: delta_joint_cmds # Topic for incoming joint angle commands
joint_topic:  joint_states
status_topic: status # Publish status to this topic
command_out_topic: /joint_group_vel_controller/command # Publish outgoing commands here
check_collisions: true # Check collisions?
collision_check_rate: 40 # [Hz] Collision-checking can easily bog down a CPU if done too often.
collision_check_type: stop_distance
self_collision_proximity_threshold: 0.02 # Start decelerating when a self-collision is this far [m]
scene_collision_proximity_threshold: 0.05 # Start decelerating when a scene collision is this far [m]
collision_distance_safety_factor: 1000 
min_allowable_collision_distance: 0.02 # Stop if a collision is closer than this [m]

When everything is up and running, I try to publish

rostopic pub -r 125 -s /servo_server/delta_twist_cmds geometry_msgs/TwistStamped "header: auto
    twist:
      linear:
        x: 0.0
        y: 0.0
        z: 0.1
     angular:
        x: 0.0
        y: 0.0
        z: 0.0"

And the response I get from servo_server is

[ INFO] [1620828759.131166000]: Loading robot model 'ur5'...
[ WARN] [1620828759.132970700]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the  URDF frame 'world'
[ INFO] [1620828759.133301200]: No root/virtual joint specified ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-20 07:43:34 -0500

EspenT gravatar image

updated 2021-05-20 11:54:44 -0500

So I have gotten the robot to move with moveit servo(See further down in post how I fixed it), but there are still some stuff to figure out. The problem I have now, is that when i publish

 rostopic pub /servo_server/delta_twist_cmds geometry_msgs/TwistStamped "header: auto
twist:
  linear:
    x: 1
    y: 0.0
    z: 0.0
  angular:
    x: 0.0
    y: 0.0
    z: 0.0"

all joints of the robot goes as fast as possible straight to zero. If i publish something like this

rostopic pub -r 125 -s /servo_server/delta_twist_cmds geometry_msgs/TwistStamped "header: auto
twist:
  linear:
    x: 90
    y: -90
    z: 0.0
  angular:
    x: 0.0
    y: 0.0
    z: 0.0"

The robot also goes to all joint = 0, but takes a different route.

Does anyone have a clue how to fix this?

Changes made to get connection up and running

I have added

joint_group_position_controller:
  type: position_controllers/JointGroupPositionController
  joints: *robot_joints

to the ur5_controllers.yaml file that can be found in

Universal_Robots_ROS_Driver->ur_robot_driver/config,

And changed to

command_out_topic: /joint_group_position_controller/command

in the servo_config.yaml file

I have changed the controller that are launched in the ur5_bringup.launch file in

Universal_Robots_ROS_Driver->ur_robot_driver/launch

with this

<arg name="controllers" default="joint_state_controller 
                                 joint_group_position_controller 
                                 speed_scaling_state_controller 
                                 force_torque_sensor_controller" 
                                 doc="Controllers that are activated by default."/>
  <arg name="stopped_controllers" default="pos_joint_traj_controller joint_group_vel_controller scaled_pos_joint_traj_controller " doc="Controllers that are initally loaded, but not started."/>

To avoid that I have to change controller every time I launch the ur5_bringup.launch

Update

The final problem is solved and moveit servo are now working with Universal_Robots_ROS_driver.

The last change that needs to be done, is to change

publish_joint_positions: false
publish_joint_velocities: true

to

publish_joint_positions: true 
publish_joint_velocities: false

in the servo configuration file

My complete configuration file are

use_gazebo: false 
command_in_type: "speed_units" 
scale:
  linear:  0.6  
  rotational:  0.3 
  joint: 0.01 
low_pass_filter_coeff: 2.  .
publish_period: 0.08  
publish_delay: 0.005 
command_out_type: std_msgs/Float64MultiArray 
publish_joint_positions: true
publish_joint_velocities: false
publish_joint_accelerations: false
move_group_name:  manipulator  
planning_frame: base_link  
ee_frame_name: wrist_3_link  
robot_link_command_frame:  base_link  
incoming_command_timeout: 0.1  
num_outgoing_halt_msgs_to_publish: 0
lower_singularity_threshold:  17 
hard_stop_singularity_threshold: 30 
joint_limit_margin: 0.15 
cartesian_command_in_topic: delta_twist_cmds 
joint_command_in_topic: delta_joint_cmds 
joint_topic:  /joint_states
status_topic: status 
command_out_topic: /joint_group_position_controller/command
check_collisions: true 
collision_check_rate: 40 
collision_check_type: threshold_distance
self_collision_proximity_threshold: 0.0001 
scene_collision_proximity_threshold: 0.05
collision_distance_safety_factor: 1000 
min_allowable_collision_distance: 0.02
edit flag offensive delete link more

Comments

Github issue with all the details:

https://github.com/ros-planning/movei...

AndyZe gravatar image AndyZe  ( 2021-05-20 12:13:12 -0500 )edit

Probably nice to have a link to that one as well :)

EspenT gravatar image EspenT  ( 2021-05-20 12:14:36 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-05-12 09:30:52 -0500

Seen: 1,151 times

Last updated: May 20 '21