Robotics StackExchange | Archived questions

How to know/check/confirm/debug if a controller is controlling/working?

Hello everyone,

I am using ROS Melodic and the Gazebo 9. I have been struggling with the controllers for some time now. I have added the gazebo plugin, the intertia and the transmission elements to the urdf.xacro file to simulate the robot in the Gazebo. The problem is when I launch the test_gazebo.launch file the robot is spawned in the gazebo and the simulation is paused, after starting the simulation the robot model just falls down like there is not control whatsoever. It pulled down by the gravity, when I try with the gravity switched off it stays in the position.

my xacro looks like this (I have randomly chosen the fanuc model, it could have been any robot manipulator from the ROS industrial repository):

<?xml version="1.0" ?>

<!--Gazebo ROS Control -->
<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
        <robotNamespace>/</robotNamespace>
        <legacyModeNS>true</legacyModeNS>
  </plugin>
</gazebo>

<link name="${prefix}base_link">
  <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/base_link.stl"/>
        </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/base_link.stl"/>
        </geometry>
  </collision>
  <inertial>
        <origin xyz = "0.0 0.0 0.0" rpy = "0 0 0" /> 
        <mass value="4.0" />
        <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
   </inertial>
</link>
<link name="world"> 
</link>
<joint name="world-${prefix}base_link" type="fixed">
  <origin xyz="0 0 0.0" rpy="0 0 0"/>
  <parent link="world"/>
  <child link="${prefix}base_link"/>
</joint>

<link name="${prefix}base"> 
</link>
<joint name="${prefix}base_link-base" type="fixed">
  <origin xyz="0 0 0.525" rpy="0 0 0"/>
  <parent link="${prefix}base_link"/>
  <child link="${prefix}base"/>
</joint>

<link name="${prefix}link_1">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_1.stl"/>
    </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_1.stl"/>
    </geometry>
  </collision>
  <inertial>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    <mass value="4.0" />
    <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
   </inertial>
</link>
<joint name="${prefix}joint_1" type="revolute">
  <origin xyz="0 0 0.525" rpy="0 0 0"/>
  <parent link="${prefix}base_link"/>
  <child link="${prefix}link_1"/>
  <axis xyz="0 0 1"/>
  <limit effort="0" lower="-2.9671" upper="2.9671" velocity="2.8798" />
</joint>
<transmission name="${prefix}trans_joint_1">    <!-- name="trans_joint_1"-->
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_1">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_1_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<link name="${prefix}link_2">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_2.stl"/>
    </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_2.stl"/>
    </geometry>
  </collision>
  <inertial>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    <mass value="4.0" />
    <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
   </inertial>
</link>
<joint name="${prefix}joint_2" type="revolute">
  <origin xyz="0.150 0 0" rpy="0 0 0"/>
  <parent link="${prefix}link_1"/>
  <child link="${prefix}link_2"/>
  <axis xyz="0 1 0"/>
  <limit effort="0" lower="-1.5708" upper="2.7925" velocity="2.8798" />
</joint>
<transmission name="${prefix}trans_joint_2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_2">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_2_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<link name="${prefix}link_3">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_3.stl"/>
    </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_3.stl"/>
    </geometry>
  </collision>
  <inertial>
     <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    <mass value="4.0" />
    <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
  </inertial>
</link>
<joint name="${prefix}joint_3" type="revolute">
  <origin xyz="0 0 0.770" rpy="0 0 0"/>
  <parent link="${prefix}link_2"/>
  <child link="${prefix}link_3"/>
  <axis xyz="0 -1 0"/>
  <limit effort="0" lower="-2.9671" upper="5.0615" velocity="3.0543" />
</joint>
<transmission name="${prefix}trans_joint_3">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_3">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_3_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<link name="${prefix}link_4">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_4.stl"/>
    </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_4.stl"/>
    </geometry>
  </collision>
  <inertial>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    <mass value="4.0" />
     <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
   </inertial>
</link>
<joint name="${prefix}joint_4" type="revolute">
  <origin xyz="0 0 0.100" rpy="0 0 0"/>
  <parent link="${prefix}link_3"/>
  <child link="${prefix}link_4"/>
  <axis xyz="-1 0 0"/>
  <limit effort="0" lower="-3.4907" upper="3.4907" velocity="6.1087" />
</joint>
<transmission name="${prefix}trans_joint_4">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_4">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_4_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<link name="${prefix}link_5">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_5.stl"/>
    </geometry>
    <xacro:material_fanuc_yellow />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_5.stl"/>
    </geometry>
  </collision>
  <inertial>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    <mass value="4.0" />
    <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
   </inertial>
</link>
<joint name="${prefix}joint_5" type="revolute">
  <origin xyz="0.740 0 0" rpy="0 0 0"/>
  <parent link="${prefix}link_4"/>
  <child link="${prefix}link_5"/>
  <axis xyz="0 -1 0"/>
  <limit effort="0" lower="-2.4435" upper="2.4435" velocity="5.9341" />
</joint>
<transmission name="${prefix}trans_joint_5">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_5">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_5_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<link name="${prefix}link_6">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/visual/link_6.stl"/>
    </geometry>
    <xacro:material_fanuc_black />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <mesh filename="package://fanuc_m16ib_support/meshes/m16ib20/collision/link_6.stl"/>
    </geometry>
  </collision>
  <inertial>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
    <mass value="4.0" />
    <inertia ixx="0.00" iyy="0.00" izz="0.001" ixy="0.0" ixz="0.0" iyz="0.0" />
  </inertial>
</link>
<joint name="${prefix}joint_6" type="revolute">
  <origin xyz="0.100 0 0" rpy="0 0 0"/>
  <parent link="${prefix}link_5"/>
  <child link="${prefix}link_6"/>
  <axis xyz="-1 0 0"/>
  <limit effort="0" lower="-7.8540" upper="7.8540" velocity="9.0757" />
</joint>
<transmission name="${prefix}trans_joint_6">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}joint_6">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="${prefix}joint_6_motor">
        <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<!-- ROS-Industrial 'flange' frame: attachment point for EEF models -->
<link name="${prefix}flange" />
<joint name="${prefix}joint_6-flange" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="${prefix}link_6" />
  <child link="${prefix}flange" />
</joint>

<!-- ROS-Industrial 'tool0' frame: all-zeros tool frame -->
<link name="${prefix}tool0" />
<joint name="${prefix}link_6-tool0" type="fixed">
  <origin xyz="0 0 0" rpy="${pi} ${-pi/2.0} 0" />
  <parent link="${prefix}flange" />
  <child link="${prefix}tool0" />
</joint>

/xacro:macro

The launch file test_gazebo.launch looks like this:

<?xml version="1.0"?>
<launch>
    <!-- General args -->
<arg name="namespace"   value=""></arg>
<arg name="paused"      value="true"></arg>
<arg name="gazebo_gui"  value="true"></arg>
<arg name="use_sim_time"    value="true"></arg>
<arg name="use_gui"         value="true"></arg>
<arg name="robot_name"  value="fanuc_m16ib20"></arg>

<!-- URDF/XACRO path and spawn position -->
<arg name="urdf_path"       value="$(find fanuc_m16ib_support)/urdf/m16ib20.xacro"></arg>
<arg name="x"           value="0"></arg>
<arg name="y"           value="0"></arg>
<arg name="z"           value="0.1"></arg>

<!-- Controllers path-->
<arg name="joint_state_controller_path" value="$(find test_gazebo)/config/joint_state_controller.yaml"></arg>
<arg name="fanuc_arm_controller_path" value="$(find test_gazebo)/config/arm_controller.yaml"></arg>
<arg name="controller_list_path"        value="$(find test_gazebo)/config/controller_list.yaml"></arg>
<arg name="gazebo_pid_path"         value="$(find test_gazebo)/config/gazebo_pid.yaml"></arg>
<arg name="joint_names_path"        value="$(find test_gazebo)/config/joint_names_m16ib20.yaml"></arg>

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

<!-- <group ns="$(arg namespace)"> -->

<!-- Robot urdf to param server and spawn the robot description from the server to the Gazebo -->
<param command="xacro '$(arg urdf_path)' " name="robot_description" ></param>
<node   name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model  '$(arg robot_name)'  -x '$(arg x)' -y '$(arg y)' -z '$(arg z)' " respawn="false" output="screen"></node>             

<!-- 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>

<!-- Fake Calibration -->
<!-- <node pkg="rostopic" type="rostopic" name="fake_joint_calibration" args="pub /calibrated std_msgs/Bool true"></node> -->

<!-- Push controllers to the server, load and start controllers -->
<rosparam file="$(arg joint_state_controller_path)" command="load"/>
<rosparam file="$(arg fanuc_arm_controller_path)"command="load"/>
<rosparam file="$(arg controller_list_path)"        command="load"/>
<rosparam file="$(arg gazebo_pid_path)"         command="load"/>

<node name="fanuc_joint_state_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn joint_state_controller" respawn="false" output="screen"></node>
<node name="fanuc_arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn fanuc_arm_controller" respawn="false" output="screen"></node>

<!-- </group> -->

</launch>

Controllers .yaml files looks like this:

joint_state_controller.yaml

joint_state_controller:
  type: joint_state_controller/JointStateController
  publish_rate: 50

fanuc_arm_controller

fanuc_arm_controller:
    loop_hz: 50
    type: position_controllers/JointTrajectoryController
    joints:
        - joint_1
        - joint_2
        - joint_3
        - joint_4
        - joint_5
        - joint_6
    gains:
        joint_1:
            p: 100
            d: 1
            i: 1
            i_clamp: 1
        joint_2:
            p: 100
            d: 1
            i: 1
            i_clamp: 1
        joint_3:
            p: 100
            d: 1
            i: 1
            i_clamp: 1
        joint_4:
            p: 100
            d: 1
            i: 1
            i_clamp: 1
        joint_5:
            p: 100
            d: 1
            i: 1
            i_clamp: 1
        joint_6:
            p: 100
            d: 1
            i: 1
            i_clamp: 1

after launching the test_gazebo.launch file, in the terminal I do not have any kind of error, controllers are started successfully, the terminal output looks like this:

... logging to /home/melodic/.ros/log/9d09abea-2025-11ea-9b9b-000c29b4cf60/roslaunch-ubuntu-18981.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:42217/

SUMMARY
========

PARAMETERS
 * /controller_list: [{'default': True...
 * /fanuc_arm_controller/gains/joint_1/d: 1
 * /fanuc_arm_controller/gains/joint_1/i: 1
 * /fanuc_arm_controller/gains/joint_1/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_1/p: 100
 * /fanuc_arm_controller/gains/joint_2/d: 1
 * /fanuc_arm_controller/gains/joint_2/i: 1
 * /fanuc_arm_controller/gains/joint_2/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_2/p: 100
 * /fanuc_arm_controller/gains/joint_3/d: 1
 * /fanuc_arm_controller/gains/joint_3/i: 1
 * /fanuc_arm_controller/gains/joint_3/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_3/p: 100
 * /fanuc_arm_controller/gains/joint_4/d: 1
 * /fanuc_arm_controller/gains/joint_4/i: 1
 * /fanuc_arm_controller/gains/joint_4/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_4/p: 100
 * /fanuc_arm_controller/gains/joint_5/d: 1
 * /fanuc_arm_controller/gains/joint_5/i: 1
 * /fanuc_arm_controller/gains/joint_5/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_5/p: 100
 * /fanuc_arm_controller/gains/joint_6/d: 1
 * /fanuc_arm_controller/gains/joint_6/i: 1
 * /fanuc_arm_controller/gains/joint_6/i_clamp: 1
 * /fanuc_arm_controller/gains/joint_6/p: 100
 * /fanuc_arm_controller/joints: ['joint_1', 'join...
 * /fanuc_arm_controller/loop_hz: 50
 * /fanuc_arm_controller/type: position_controll...
 * /gazebo/enable_ros_network: True
 * /gazebo_ros_control/pid_gains/joint_1/d: 0
 * /gazebo_ros_control/pid_gains/joint_1/i: 0
 * /gazebo_ros_control/pid_gains/joint_1/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_1/p: 1
 * /gazebo_ros_control/pid_gains/joint_2/d: 0
 * /gazebo_ros_control/pid_gains/joint_2/i: 0
 * /gazebo_ros_control/pid_gains/joint_2/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_2/p: 1
 * /gazebo_ros_control/pid_gains/joint_3/d: 0
 * /gazebo_ros_control/pid_gains/joint_3/i: 0
 * /gazebo_ros_control/pid_gains/joint_3/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_3/p: 1
 * /gazebo_ros_control/pid_gains/joint_4/d: 0
 * /gazebo_ros_control/pid_gains/joint_4/i: 0
 * /gazebo_ros_control/pid_gains/joint_4/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_4/p: 1
 * /gazebo_ros_control/pid_gains/joint_5/d: 0
 * /gazebo_ros_control/pid_gains/joint_5/i: 0
 * /gazebo_ros_control/pid_gains/joint_5/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_5/p: 1
 * /gazebo_ros_control/pid_gains/joint_6/d: 0
 * /gazebo_ros_control/pid_gains/joint_6/i: 0
 * /gazebo_ros_control/pid_gains/joint_6/i_clamp: 1
 * /gazebo_ros_control/pid_gains/joint_6/p: 1
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 50.0
 * /robot_state_publisher/tf_prefix: 
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /use_sim_time: True

NODES
  /
    fanuc_arm_controller_spawner (controller_manager/controller_manager)
    fanuc_joint_state_controller_spawner (controller_manager/controller_manager)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_gazebo_model (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [18994]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 9d09abea-2025-11ea-9b9b-000c29b4cf60
process[rosout-1]: started with pid [19005]
started core service [/rosout]
process[gazebo-2]: started with pid [19012]
process[gazebo_gui-3]: started with pid [19017]
process[spawn_gazebo_model-4]: started with pid [19021]
process[robot_state_publisher-5]: started with pid [19023]
process[fanuc_joint_state_controller_spawner-6]: started with pid [19028]
process[fanuc_arm_controller_spawner-7]: started with pid [19030]
[ INFO] [1576515652.890191784]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1576515652.891933095]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1576515652.959596528]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1576515652.963552191]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[INFO] [1576515653.286190, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1576515653.294694, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1576515655.410146, 0.000000]: Calling service /gazebo/spawn_urdf_model
[INFO] [1576515655.666734, 0.000000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1576515655.720558662]: Loading gazebo_ros_control plugin
[ INFO] [1576515655.720880824]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1576515655.722264019]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[spawn_gazebo_model-4] process has finished cleanly
log file: /home/melodic/.ros/log/9d09abea-2025-11ea-9b9b-000c29b4cf60/spawn_gazebo_model-4*.log
[ INFO] [1576515656.038149793]: Loaded gazebo_ros_control.
Loaded 'joint_state_controller'
Started ['joint_state_controller'] successfully
[ INFO] [1576515662.924858306, 0.027000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1576515663.073880007, 0.119000000]: Physics dynamic reconfigure ready.
Loaded 'fanuc_arm_controller'
Started ['fanuc_arm_controller'] successfully
[fanuc_arm_controller_spawner-7] process has finished cleanly
log file: /home/melodic/.ros/log/9d09abea-2025-11ea-9b9b-000c29b4cf60/fanuc_arm_controller_spawner-7*.log
[fanuc_joint_state_controller_spawner-6] process has finished cleanly
log file: /home/melodic/.ros/log/9d09abea-2025-11ea-9b9b-000c29b4cf60/fanuc_joint_state_controller_spawner-6*.log

when I call the service rosservice call /controller_manager/list_controllers I can see the controllers are running: controller:

  - 
    name: "fanuc_arm_controller"
    state: "running"
    type: "position_controllers/JointTrajectoryController"
    claimed_resources: 
      - 
        hardware_interface: "hardware_interface::PositionJointInterface"
        resources: [joint_1, joint_2, joint_3, joint_4, joint_5, joint_6]
  - 
    name: "joint_state_controller"
    state: "running"
    type: "joint_state_controller/JointStateController"
    claimed_resources: 
      - 
        hardware_interface: "hardware_interface::JointStateInterface"
        resources: []

Am I missing something? In the terminal everything looks just fine, but the fanuc_arm_controller is not controlling these joints. How can I actually confirm or be sure that I the certain controller is controlling the certain joints, I could have more than one robot and controllers which are controlling the same joints on the another robot? In the robotdescription there are Transmissions with the PositionJointInterface and the `fanucarm_controllerhas thePositionJointInterface` and therefore it should work together. This way it seems like it has been started without an error but there is no interaction between controller and the model in gazebo.

How should I check which controller controls which robot/group of joints? Is there a way to confirm/debug the control is working?

any help is appreciated, thanks

19.12.2019 UPDATE:

I listed the topics and I have published some random message on the topic /fanuc_arm_controller/command using tab to automatically fill the message, in another terminal I was subscribed on the same topic and I got the message. In the terminal where I have launched the gazebo I got the error:

[ERROR] [1576777086.064482355, 54.302000000] [/gazebo] [ros.joint_trajectory_controller]: Cannot create trajectory from message. It does not contain the expected joints.

but the joints are with the correct names, the names are the same as in the xacro file, this means a controller doesn't understand which joint should affect? How do I get controller to understand which joints it should control, I have given joint names in the controller yaml file, isn't that enough?

Thanks

Asked by marko1990 on 2019-12-16 12:21:19 UTC

Comments

Can you clarify how this is related to #q338443?

Asked by gvdhoorn on 2019-12-16 12:26:06 UTC

Hello gvdhoorn thanks for attention, Here I have indentified the problem, it is not related to moveit, it is related to the control. I have tried this same launch file with the few different urdf/xacro descriptions and all of them are just not controlled. Sorry if it is duplicate, but I hope I have explained this one better, without additional unnecessary involving the info which is not related. Thanks

Asked by marko1990 on 2019-12-16 12:43:19 UTC

Ok. That would have been good to add to your question text.

Asked by gvdhoorn on 2019-12-16 12:50:35 UTC

Also I have been switching between the effort_controllers/JointTrajectoryController and position_controllers/JointTrajectoryController. But with the same result. That why I would like to know how can I make sure the certain controller is actually controlling or if the certain joints group

Asked by marko1990 on 2019-12-16 13:23:32 UTC

Answers

Hello Everyone,

the answer for this question and #q338443 How to know if the controllers are working/controlling? Spawned robot in gazebo is falling down/crushing to the floor.. It seems the position joint interface is still not working correctly in the Gazebo9(even though it looks like it works when in the rrbot urdf is interfaced as a position controller). Anyway, in a case of position controllers, everything is loaded without a problem, but when the simulation starts, the robot just falls down like there is nothing that controls it. So I do not know if there is a problem with the controller, but I wouldn't say that since the controller has been loaded and started successfully, there is also no problem in the Gazebo9, the problem is the communication/interface between those 2, looks like there is none of it. What I have done is changed the controller interface from the position to effort and added a value for the effort in the urdf, after that it worked. Does anyone knows what could it be wrong with the position controller, does it needs some additional configuration? I mean it wasn't complaining about anything, but it sure didn't work

Asked by marko1990 on 2019-12-21 10:01:27 UTC

Comments