0
$\begingroup$

Rosanswers logo

To start, I'm using ROS noetic with Gazebo11 on a dual boot Ubuntu 20.04 (kernel 5.8.0-59-generic) - Windows 10 system. I'm running all of my ROS related stuff on Ubuntu of course. I want to have MoveIt connected with Gazebo and have built my own .urdf with SolidWorks to use with the MoveIt setup assistant. Then, to have Gazebo ROS control, I followed this tutorial "http://gazebosim.org/tutorials/?tut=ros_control". The file that connects everything together is called "demo_gazebo.launch" which is located in my config directory generated by the MoveIt setup assistant. However, when I launch this file, plan and execute a movement, I get the following errors:

[ERROR] [1625248281.179031173, 12.602000000]: Unable to identify any set of controllers that can actuate the specified joints: [ accessor_rail arm_base forearm palm shoulder upper_arm wrist ]
[ERROR] [1625248281.179086593, 12.602000000]: Known controllers and their joints:

[ERROR] [1625248281.179182223, 12.602000000]: Apparently trajectory initialization failed

==================================================================================================

Here is everything upon launching, planning and executing a movement:

This code block was moved to the following github gist: https://gist.github.com/answers-se-migration-openrobotics/fdd3c72ddd30dd11cbd7814a8ee6346d

==================================================================================================

Here is what my workspace looks like:

Image of full workspace - "https://drive.google.com/file/d/1Qb80aXbPkTNtuAnRH7c8rAzDcphvdetS/view?usp=sharing"

Image of the SolidWorks .urdf directory - "https://drive.google.com/file/d/1ZqB-qHJ2_oPSvi2VEcZAvfn8q1Zy8Nh-/view?usp=sharing"

Image of the config directory - "https://drive.google.com/file/d/1xsfI4ph82nqc6xW1Rj_1dsQh7EaX8nn2/view?usp=sharing"

Image of the control directory - "https://drive.google.com/file/d/1u6kQqNLK8kvCOfAfoglpOgVD6I7Xyp2E/view?usp=sharing"

==================================================================================================

If there is any more information not provided but required to potentially solve the issue, then I will edit this post. Thank you to whoever's time I take.

EDIT:

ros_controllers.launch - 

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

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

  <!-- Load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/simulation_final" args="accessor_rail_position_controller arm_base_position_controller shoulder_position_controller upper_arm_position_controller forearm_position_controller wrist_position_controller palm_position_controller midfinger_1_position_controller topfinger_1_position_controller midfinger_2_position_controller topfinger_2_position_controller midfinger_3_position_controller topfinger_3_position_controller joint_state_controller"/>

</launch>

==================================================================================================

ros_controllers.yaml - 

simulation_final:
  # Simulation settings for using moveit_sim_controllers
  moveit_sim_hw_interface:
    joint_model_group: manipulator
    joint_model_group_pose: rest
  # Settings for ros_control_boilerplate control loop
  generic_hw_control_loop:
    loop_hz: 300
    cycle_time_error_threshold: 0.01
  # Settings for ros_control hardware interface
  hardware_interface:
    joints:
      - accessor_rail
      - arm_base
      - shoulder
      - upper_arm
      - forearm
      - wrist
      - palm
      - midfinger_1
      - topfinger_1
      - midfinger_2
      - topfinger_2
      - midfinger_3
      - topfinger_3
    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: manipulator_controller
      action_ns: follow_joint_trajectory
      default: True
      type: FollowJointTrajectory
      joints:
        - accessor_rail
        - arm_base
        - shoulder
        - upper_arm
        - forearm
        - wrist
        - palm
    - name: gripper_controller
      action_ns: follow_joint_trajectory
      default: True
      type: FollowJointTrajectory
      joints:
        - midfinger_1
        - topfinger_1
        - midfinger_2
        - topfinger_2
        - midfinger_3
        - topfinger_3

==================================================================================================

simulation_final_moveit_controller_manager.launch.xml - 

<launch>

  <!-- this argument is not used here, only necessary so that this launch file has the same args as fake_moveit_controller_manager.launch -->
  <arg name="execution_type" default="unused" />

  <!-- 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 simulation_final_config)/config/ros_controllers.yaml"/>
</launch>

==================================================================================================

demo_gazebo.launch - 

<launch>

  <!-- 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 simulation_final_config)/default_warehouse_mongo_db" />

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

  <!-- By default, we won't load or override the robot_description -->
  <arg name="load_robot_description" 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" />

  <!-- Gazebo specific options -->
  <arg name="gazebo_gui" default="true"/>
  <arg name="paused" default="false"/>
  <!-- By default, use the urdf location provided from the package -->
  <arg name="urdf_path" default="$(find simulation_final)/urdf/simulation_final.urdf"/>

  <!-- launch the gazebo simulator and spawn the robot -->
  <include file="$(find simulation_final_config)/launch/gazebo.launch" >
    <arg name="paused" value="$(arg paused)"/>
    <arg name="gazebo_gui" value="$(arg gazebo_gui)"/>
    <arg name="urdf_path" value="$(arg urdf_path)"/>
  </include>

  <!-- If needed, broadcast static tf for robot root -->
  

  <!-- We do not have a robot connected, so publish fake joint states -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" unless="$(arg use_gui)">
    <rosparam param="source_list">[move_group/controller_joint_states]</rosparam>
    <rosparam param="source_list">[/joint_states]</rosparam>
  </node>
  <node name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" if="$(arg use_gui)">
    <rosparam param="source_list">[move_group/controller_joint_states]</rosparam>
    <rosparam param="source_list">[/joint_states]</rosparam>
  </node>

  <!-- Given the published joint states, publish tf for the robot links -->
  <!--<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />-->

  <!-- Run the main MoveIt executable without trajectory execution (we do not have controllers configured by default) -->
  <include file="$(find simulation_final_config)/launch/move_group.launch">
    <arg name="allow_trajectory_execution" value="true"/>
    <arg name="fake_execution" value="false"/>
    <arg name="info" value="true"/>
    <arg name="debug" value="$(arg debug)"/>
    <arg name="load_robot_description" value="$(arg load_robot_description)"/>
  </include>

  <!-- Run Rviz and load the default config to see the state of the move_group node -->
  <include file="$(find simulation_final_config)/launch/moveit_rviz.launch">
    <arg name="rviz_config" value="$(find simulation_final_config)/launch/moveit.rviz"/>
    <arg name="debug" value="$(arg debug)"/>
  </include>

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

</launch>

==================================================================================================

simulation_final_control.launch - 

<launch>
  
  <param name="robot_description" command="cat $(find simulation_final)/urdf/simulation_final.urdf"/> <!-- "cat" gives sudo permission -->

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

  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/simulation_final" args="--timeout 0 accessor_rail_position_controller arm_base_position_controller shoulder_position_controller upper_arm_position_controller forearm_position_controller wrist_position_controller palm_position_controller midfinger_1_position_controller topfinger_1_position_controller midfinger_2_position_controller topfinger_2_position_controller midfinger_3_position_controller topfinger_3_position_controller joint_state_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="/simulation_final/joint_states" />
  </node>

</launch>

==================================================================================================

simulation_final_control.yaml - 

simulation_final:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  # Position Controllers ---------------------------------------
  accessor_rail_position_controller:
    type: effort_controllers/JointPositionController
    joint: accessor_rail
    pid: {p: 100.0, i: 0.01, d: 10.0}
  arm_base_position_controller:
    type: effort_controllers/JointPositionController
    joint: arm_base
    pid: {p: 100.0, i: 0.01, d: 10.0}
  shoulder_position_controller:
    type: effort_controllers/JointPositionController
    joint: shoulder
    pid: {p: 100.0, i: 0.01, d: 10.0}
  upper_arm_position_controller:
    type: effort_controllers/JointPositionController
    joint: upper_arm
    pid: {p: 100.0, i: 0.01, d: 10.0}
  forearm_position_controller:
    type: effort_controllers/JointPositionController
    joint: forearm
    pid: {p: 100.0, i: 0.01, d: 10.0}
  wrist_position_controller:
    type: effort_controllers/JointPositionController
    joint: wrist
    pid: {p: 100.0, i: 0.01, d: 10.0}
  palm_position_controller:
    type: effort_controllers/JointPositionController
    joint: palm
    pid: {p: 100.0, i: 0.01, d: 10.0}
  midfinger_1_position_controller:
    type: effort_controllers/JointPositionController
    joint: midfinger_1
    pid: {p: 100.0, i: 0.01, d: 10.0}
  topfinger_1_position_controller:
    type: effort_controllers/JointPositionController
    joint: topfinger_1
    pid: {p: 100.0, i: 0.01, d: 10.0}
  midfinger_2_position_controller:
    type: effort_controllers/JointPositionController
    joint: midfinger_2
    pid: {p: 100.0, i: 0.01, d: 10.0}
  topfinger_2_position_controller:
    type: effort_controllers/JointPositionController
    joint: topfinger_2
    pid: {p: 100.0, i: 0.01, d: 10.0}
  midfinger_3_position_controller:
    type: effort_controllers/JointPositionController
    joint: midfinger_3
    pid: {p: 100.0, i: 0.01, d: 10.0}
  topfinger_3_position_controller:
    type: effort_controllers/JointPositionController
    joint: topfinger_3
    pid: {p: 100.0, i: 0.01, d: 10.0}

Originally posted by CM on ROS Answers with karma: 1 on 2021-07-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The likely problem is that your launch configuration is incomplete (I don't mean just your .launch file.) Some possibilities are: you have not installed the correct vendor libraries to control the hardware, or you have not started some ros nodes, or you have not specified the correct plugins to the ros controller manager.


Originally posted by Mike Scheutzow with karma: 4903 on 2021-07-03

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by CM on 2021-07-03:
@Mike Scheutzow I updated my post with 6 files related to the controllers. Also, I installed the following packages:

sudo apt-get install ros-noetic-ros-control ros-noetic-joint-state-controller ros-noetic-effort-controllers ros-noetic-position-controllers ros-noetic-velocity-controllers ros-noetic-ros-controllers ros-noetic-gazebo-ros ros-noetic-gazebo-ros-control

I don't know if these relate to the hardware, but I have started the controller_spawner node with pkg controller_manager that should initialize the controllers, but I'm also unsure about how the connection works between my controller_list and hardware_interface in the ros_controllers.yaml and my demo_gazebo.launch. In fact, because I'm new to this, I don't know much about any of the connections at all.

$\endgroup$

Your Answer

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