Ask Your Question
0

waitForServer issue

asked 2019-08-06 11:09:59 -0600

mt gravatar image

Hi,

System: Virtualbox VM Linux: Ubuntu 16.04 ROS: Kinetic

I am working on manipulator jogging using the jog_control package. I've posted this on the github issues page already but I thought I'd try here as well.

I am trying to set this package up to use the Kuka KR16 arm but am having some problems with the controllers which is giving me the following warning:

Waiting for arm_controller/follow_joint_trajectory server...

as it is waiting on the TrajClient's waitForServer method.

I have been trying to replicate the contents of the launch files in the example given in the readme for the UR5 arm but am still coming up short. I am not sure how the follow_joint_trajectory server is being created in the UR5 packages and I have not been able to find a tutorial or guide that explains the follow_joint_trajectory controller.

I don't want to make the post too long so I will only include my launch files for now and if need be, I can include other info later as required.

This first launch file, kr16.launch, launches Gazebo, Rviz, MoveIt! and loads the arm and controllers.

<?xml version="1.0"?>
<launch>
  <arg name="limited" default="false"  doc="If true, limits joint range [-PI, PI] on all joints." />
  <arg name="paused" default="false" doc="Starts gazebo in paused mode" />
  <arg name="gui" default="false" doc="Starts gazebo gui" />
  <arg name="sim" default="false" doc="If true, use the simulated joint controllers"/>
  <arg name="use_moveit" default="true"/>
  <arg name="use_rviz" default="true"/>

  <!-- startup simulated world -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" default="worlds/empty.world"/>
    <arg name="paused" value="$(arg paused)"/>
    <arg name="gui" value="$(arg gui)"/>
  </include>

  <!-- send robot urdf to param server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find kuka_kr16_support)/urdf/kr16_2.xacro'" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot -z 0.0" respawn="false" output="screen" />

  <!-- spawn the joint_state_controller and joint_trajectory_controller-->
  <rosparam file="$(find kr16_moveit_config)/config/ros_controllers.yaml" command="load"/>
  <node name="arm_controller_spawner" pkg="controller_manager" type="spawner" ns="kuka_kr16_2" args="joint_state_controller arm_controller" respawn="false" output="screen"/>

  <!-- Remap joint_states -->
  <remap from="/joint_states" to="/kuka_kr16_2/joint_states"/>

  <!-- Robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="50.0" />
    <param name="tf_prefix" type="string" value="" />

  </node>

  <!-- Launch rviz -->
  <node if="$(arg use_rviz)"
    name="rviz" pkg="rviz" type="rviz"
    args="-d $(find jog_launch)/launch/jog.rviz"/>


  <!-- Remap follow_joint_trajectory -->
  <remap if="$(arg sim)" from="/follow_joint_trajectory" to="/kuka_kr16_2/arm_controller/follow_joint_trajectory"/>

  <!-- Launch MoveIt! -->
  <include if="$(arg use_moveit)"
       file="$(find kr16_moveit_config)/launch/move_group.launch"/>

</launch>

This file gives the following notable fatal error when launched:

[FATAL] [1565103003.906290212]: Parameter '~moveit_controller_manager' not ...
(more)
edit retag flag offensive close merge delete

Comments

1

I've posted this on the github issues page already but I thought I'd try here as well.

please do not cross-post questions like this.

Give the developers/maintainers of the package a chance to respond.

gvdhoorn gravatar imagegvdhoorn ( 2019-08-06 11:28:33 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-08-28 08:04:37 -0600

mt gravatar image

After trawlling through various tutorials and vidoes on ROS control, I found a solution to the problem. It was a problem of namespaces betwen Gazebo and ROS.

I went back and did the MoveIt! config setup again for the robot arm. I then removed all references to namespaces. So no namespace in the URDF for Gazebo, removed the namespace from the MoveIt! generated controller files and any namespaces in launch files.

The following is based on my understanding of ROS control so may not be totally accurate. So I then figured out that in the error message:

Waiting for arm_controller/follow_joint_trajectory server...

The arm_controller refers to the actual controller and follow_joint_trajectory is the action server (really not sure how this works). So in my controllers.yaml file, I changed the following:

Previous:

joint_state_controller:
  type: joint_state_controller/JointStateController
  publish_rate: 50
controller_list:
  - name: "arm_controller"
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    joints:
      - joint_a1
      - joint_a2
      - joint_a3
      - joint_a4
      - joint_a5
      - joint_a6
arm_position_controller:
  type: position_controllers/JointTrajectoryController
  joints:
    - joint_a1
    - joint_a2
    - joint_a3
    - joint_a4
    - joint_a5
    - joint_a6
  ...(controller gains etc...)

Now:

joint_state_controller:
  type: joint_state_controller/JointStateController
  publish_rate: 50
controller_list:
  - **name: ""**
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    joints:
      - joint_a1
      - joint_a2
      - joint_a3
      - joint_a4
      - joint_a5
      - joint_a6
arm_position_controller:
  type: position_controllers/JointTrajectoryController
  joints:
    - joint_a1
    - joint_a2
    - joint_a3
    - joint_a4
    - joint_a5
    - joint_a6

Removing the name field from controller_list meant that ROS would now be looking for an action server on the /follow_joint_trajectory topic. I then remapped the topic /follow_joint_trajectory to [controller_name]/follow_joint_trajectory so in my case I added the follwing to my launch file:

 <!-- Remap follow_joint_trajectory -->
  <remap if="$(arg sim)" from="/follow_joint_trajectory" to="/arm_position_controller/follow_joint_trajectory"/>

This led to the controller being found and loaded correctly.

I hope this is of help to others and I would appreciate anyone more knowlegable improving the answer and my understanding of ROS control.

edit flag offensive delete link more
0

answered 2019-08-13 08:26:04 -0600

longjie0723 gravatar image

updated 2019-08-13 11:36:33 -0600

jayess gravatar image

Hi, Please check if your gazebo setup can launch all of the joint controllers correctly.

  • Your setting should control the robot joints in gazebo viewer
  • The controller should publish joint_states and accept FollowJointTrajectory action
  • This have nothing to do with jog_control packages

I'm afraid the URDF in kuka_experimental/kuka_kr16_support need more descriptions for gazebo simulation at a glance. Please refer to ur_gazebo package in which you can easily start the system as:

roskaunch ur_gazebo ur5.launch

The alternative is to use fake_joint package instead of gazebo. I believe it is much easier if it fit your needs. And please notice the example in jog_control/jog_launch are all using fake_joint_driver, not gazebo.

In any ways, you need to confirm your robot can be controlled using MoveIt! before proceeding to jog_control. I recommend to check it step by step modifying the sample files.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-08-06 11:09:59 -0600

Seen: 155 times

Last updated: Aug 28 '19