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

connect real kuka to moveit

asked 2020-03-03 08:23:23 -0600

Markus gravatar image

Hey there,

I successfully connected my 30HA-KUKA robot using kuka_eki_hw_interface to my Ubuntu 18.04 melodic ROS PC.

I am now able to control the robot using rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller

Goal I would like to control the EE of the real Robot using MoveIt Plugin in Rviz.

Progress

  • I created a moveit_config package
  • If I start the moveit config package I can use the interactive markers to plan a trajectory
  • My moveit robot subscribes to the published joints of the real robot!
  • If I press execute in moveIt (to execute the plan), nothing happens with the real robot.

How do I tell moveIt to use my action server of the real robot(position_trajectory_controller) to execute a plan?

I have an action server running to control the real robot (that works!)

/joint_states
/position_trajectory_controller/command
/position_trajectory_controller/follow_joint_trajectory/cancel
/position_trajectory_controller/follow_joint_trajectory/feedback
/position_trajectory_controller/follow_joint_trajectory/goal
/position_trajectory_controller/follow_joint_trajectory/result
/position_trajectory_controller/follow_joint_trajectory/status
/position_trajectory_controller/state
/rosout
/rosout_agg
/tf

To start moveit_it I use:

<launch>

<!-- set to false otherwise robot not visible in gazbeo!!! -->
<include file="$(find kuka_30HA_moveit_config)/launch/planning_context.launch">
  <arg name="load_robot_description" value="true"/>
</include>

<include file="$(find kuka_30HA_moveit_config)/launch/move_group_mine.launch">
  <arg name="allow_trajectory_execution" value="true"/>
  <arg name="fake_execution" value="false"/>
  <arg name="info" value="true"/>
  <arg name="debug" value="false"/>
</include>

<include file="$(find kuka_30HA_moveit_config)/launch/kuka_30ha_moveit_controller_manager_mine.launch.xml"/>


<node name="rviz" pkg="rviz" type="rviz" args="-d $(find kuka_30HA_moveit_config)/config/moveit_real.rviz" required="true" />

</launch>
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-03-03 11:17:20 -0600

fvd gravatar image

If you can control your robot with rqt_joint_trajectory_controller, you need to make sure that MoveIt also knows to talk to those topics and to use the same joint names.

Look in the config folder of your robot's moveit_config package. Are the joints listed in ros_controllers.yaml the same that you see if you rostopic echo /joint_states topic, and when you control the robot at the moment? Does the topic of the controller near the bottom of the file match what you see in rqt_joint_trajectory_controller?

Please add the correct file/s to your question if that helps you sort it out.

edit flag offensive delete link more

Comments

Thanks that helped me. I had to look in ros_controllers.yaml and check that.

Markus gravatar image Markus  ( 2020-03-10 07:23:04 -0600 )edit

Great. Please add the corrected lines (and maybe the original ones) to the question for future readers.

fvd gravatar image fvd  ( 2020-03-10 08:13:48 -0600 )edit
1

answered 2020-08-22 22:23:59 -0600

Bhavin gravatar image

updated 2020-11-23 18:09:58 -0600

I had a similar problem like you. I am working with Kuka kr6 r700-2. I made the urdf file by my own as it is not added in the github link yet. Here is the steps that I followed to solve my problem:-

After creating the moveit package for the robot, go to

kuka_moveit_config package > config

And make a file named as controllers.yaml

and copy this code:-

controller_list:
  - name: ""
    action_ns: joint_trajectory_action
    type: FollowJointTrajectory
    joints: [joint_a1, joint_a2, joint_a3, joint_a4, joint_a5, joint_a6]

And make another file as controller_joint_names.yaml and copy this code :-

controller_joint_names: ["joint_a1", "joint_a2", "joint_a3", "joint_a4", "joint_a5", "joint_a6"]

Then edit this file:-

kuka_moveit_config package > launch > robot_moveit_controller_manager.launch.xml

as follows:- (don't forget to edit "Name_of_your_moveit_package" in the code to your moveit_package name)

<launch>


      <!-- loads moveit_controller_manager on the parameter server which is taken as argument 
        if no argument is passed, moveit_simple_controller_manager will be set -->
      <arg name="moveit_controller_manager" default="moveit_simple_controller_manager/MoveItSimpleControllerManager" />
      <param name="moveit_controller_manager" value="$(arg moveit_controller_manager)"/>

      <!-- loads ros_controllers to the param server -->
      <rosparam file="$(find <Name_of_your_moveit_package>)/config/controllers.yaml"/>
    </launch>

Now go to :

kuka_moveit_config package > launch

And create a launch file named as moveit_planning_execution.launch, copy paste the following code:- (don't forget to edit "Name_of_your_moveit_package" in the code to your moveit_package name)

Note: The below code is for EKI interface. For RSI interface, edit the line number 31 and include the robot_interface_streaming.launch from rsi package and you are good to go.

<launch>
  <!-- The planning and execution components of MoveIt! configured to run -->
  <!-- using the ROS-Industrial interface. -->

  <!-- Non-standard joint names:
       - Create a file [robot_moveit_config]/config/joint_names.yaml
           controller_joint_names: [joint_1, joint_2, ... joint_N] 
       - Update with joint names for your robot (in order expected by rbt controller)
       - and uncomment the following line: -->
  <rosparam command="load" file="$(find <Name_of_your_moveit_package>)/config/controller_joint_names.yaml"/> -->
 <arg name="debug" default="false" />
  <!-- the "sim" argument controls whether we connect to a Simulated or Real robot -->
  <!--  - if sim=false, a robot_ip argument is required -->
  <arg name="sim" default="true" />
  <arg name="robot_ip" unless="$(arg sim)" />

  <!-- load the robot_description parameter before launching ROS-I nodes -->
  <include file="$(find <Name_of_your_moveit_package>)/launch/planning_context.launch" >
    <arg name="load_robot_description" value="true" />
  </include>

  <!-- run the robot simulator and action interface nodes -->
  <group if="$(arg sim)">
    <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
  </group>

  <!-- run the "real robot" interface nodes -->
  <!--   - this typically includes: robot_state, motion_interface, and joint_trajectory_action nodes -->
  <!--   - replace these calls with appropriate robot-specific calls or launch files -->
  <group unless="$(arg sim)">
    <include file="$(find kuka_eki_hw_interface)/launch/robot_interface_streaming.launch" >
      <arg name="robot_ip" value="$(arg robot_ip)"/>
    </include>
  </group>

  <!-- publish the robot state (tf transforms) -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

  <include file="$(find <Name_of_your_moveit_package>)/launch/move_group.launch">
    <arg name="publish_monitored_planning_scene" value="true" />
  </include>

  <include file="$(find <Name_of_your_moveit_package>)/launch/moveit_rviz.launch">
     <arg ...
(more)
edit flag offensive delete link more

Comments

Can I use this method on rsi with krc2? And when opening moveit_planning_execution.launch, I need to open test_hardware_interface.launch first, right?

PRA008 gravatar image PRA008  ( 2022-06-17 03:46:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-03-03 08:23:23 -0600

Seen: 1,380 times

Last updated: Nov 23 '20