0
$\begingroup$

Rosanswers logo

Hello developers!

I'm using Manipulator-H from Robotis github and I'm trying to create a go to goal in gazebo using moveit. By now I made:

  • Created with moveit setup assistant the package
  • Control it in RViz using Plan and Execute

But my problem is connect to moveit with gazebo. I'm trying to use FollowJointTrajectory without sucess... The ERRORS change between:

  • Failed to load mh_arm_controller

OR

  • Could not load controller 'mh_arm_controller' because the type was not specified. Did you load the controller configuration on the parameter server (namespace: '/robotis_manipulator_h/mh_arm_controller')?

PS: I listed those two errors most because when I solved one, the other appears.

I will present now the solutions that I tried:

I think the problem are between: namespace or FollowJointTrajectory most because the ROBOTIS provide a position controller that works properly (I tried to follow the codes model without sucess). I already install every single controller in ros even pr2 controller (I really don't know what is FollowJointTrajectory in google).

WHAT I MADE SO FAR (REMEMBER THAT I TRIED OTHERS FORMATS, BUT THIS IS THE MAIN PIPELINE THAT I TRIED 90% OF THE TIME):

1 - Create a package for manipulator-h in moveit, adding FollowJointTrajectory

2 - manipulator_h_description folder has the manipulator_h.gazebo that I did not change. You can find where the piece of code:

  <!-- ros_control plugin -->
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/robotis_manipulator_h</robotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
  </gazebo> 

3 - moveit setup assistant created

ros_controllers_yaml

robotis_manipulator_h:
# MoveIt-specific simulation settings
  moveit_sim_hw_interface:
    joint_model_group: controllers_initial_group_
    joint_model_group_pose: controllers_initial_pose_
# Settings for ros_control control loop
  generic_hw_control_loop:
    loop_hz: 300
    cycle_time_error_threshold: 0.01
# Settings for ros_control hardware interface
  hardware_interface:
    joints:
      - joint1
      - joint2
      - joint3
      - joint4
      - joint5
      - joint6
    sim_control_mode: 1  # 0: position, 1: velocity
# Publish all joint states
# Creates the /joint_states topic necessary in ROS
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50
  controller_list:
    - name: mh_arm_controller
      action_ns: follow_joint_trajectory
      default: True
      type: FollowJointTrajectory
      joints:
        - joint1
        - joint2
        - joint3
        - joint4
        - joint5
        - joint6
        - world_fixed

ros_controllers.launch

<?xml version="1.0"?>
<launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find manipulator_h_moveit)/config/ros_controllers.yaml" command="load"/>

  <!-- Load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="robotis_manipulator_h" args="mh_arm_controller "/>

  <!-- Convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="robotis_manipulator_h/joint_states" />
  </node>

</launch>

PS: In this launch, I just changed ns from robotis_manipulator_h to /robotis_manipulator_h.

4 - After this, in gazebo launch called manipulator_h_gazebo.launch I insert the controller as shown:

<?xml version="1.0" ?>
<launch>
  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="true"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find manipulator_h_gazebo)/worlds/empty.world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

  <!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find manipulator_h_description)/urdf/manipulator_h.xacro'" />

  <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
  <node pkg="gazebo_ros" type="spawn_model" name="urdf_spawner" respawn="false" output="screen"
          args="-urdf -model manipulator_h -param robot_description"/>

  <!-- ros_control robotis manipulator launch file -->
  <include file="$(find manipulator_h_moveit)/launch/ros_controllers.launch" />
  <!--include file="$(find manipulator_h_gazebo)/launch/position_controller.launch" /-->
  <!--<include file="$(find manipulator_h_gazebo)/launch/effort_controller.launch" />-->
</launch>

5 - launch the previous launch and get error!

PS: I commented both original controllers (position and effort) from robotis.

So my doubt are:

  • Where I can learn FollowJointTrajectory type (package? is a pr2 controller?)
  • Could be the namespace? where he is defined beside those files?

What can I try more to have sucess in my task?

Using ROS-KINETIC & UBUNTU 16.04


Originally posted by kaike_wesley_reis on ROS Answers with karma: 61 on 2019-06-02

Post score: 0


Original comments

Comment by harumo11 on 2019-06-10:
Could you change from ns="robotis_manipulator_h" to ns="/robotis_manipulator_h" in ros_controllers.launch ?

Comment by kaike_wesley_reis on 2019-06-13:
Hello harumo, I did this before and did not solved, but I al

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Actually I solve this problem. The steps was:

1 - Followed Exactly this tutorial: tutorial

2 - I realized that my demo.launch provided by Moveit! Setup Assistant have those commands that are not shown in ANY tutorial:

  <!-- By default, we do not start a database (it can be large) -->
  <arg name="db" default="false" />
  <!-- Allow user to specify database location -->
  <arg name="db_path" default="$(find manipulator_h_moveit)/default_warehouse_mongo_db" />

  <!-- By default, we are not in debug mode -->
  <arg name="debug" default="false" />

  <!--
  By default, hide joint_state_publisher's GUI

  MoveIt!'s "demo" mode replaces the real robot driver with the joint_state_publisher.
  The latter one maintains and publishes the current joint configuration of the simulated robot.
  It also provides a GUI to move the simulated robot around "manually".
  This corresponds to moving around the real robot without the use of MoveIt.
  -->
  <arg name="use_gui" default="false" />

  <!-- If database loading was enabled, start mongodb as well -->
  <include file="$(find manipulator_h_moveit)/launch/default_warehouse_db.launch" if="$(arg db)">
    <arg name="moveit_warehouse_database_path" value="$(arg db_path)"/>
  </include>

So I copied those commands and put in my moveit_planning_execution.launch and then Works finally!


Originally posted by kaike_wesley_reis with karma: 61 on 2019-06-13

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.