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

couldn't start diff drive controller: Could not find resource 'Joint1'

asked 2020-05-09 23:28:56 -0500

dinesh gravatar image

updated 2020-05-10 05:36:37 -0500

gvdhoorn gravatar image

while launching diff drive controller i'm getting this kind of erros:

[ INFO] [1589084721.702629598]: Allow mutiple cmd_vel publishers is enabled
[ INFO] [1589084721.704429523]: Base frame_id set to base_footprint
[ INFO] [1589084721.705299981]: Odometry frame_id set to odom
[ INFO] [1589084721.706741402]: Publishing to tf is enabled
[ INFO] [1589084721.722586910]: Odometry params : wheel separation 1, left wheel radius 0.3, right wheel radius 0.3
[ INFO] [1589084721.725901716]: Adding left wheel with joint name: Joint1 and right wheel with joint name: Joint2
[ERROR] [1589084721.726199477]: Exception thrown while initializing controller 'mobile_base_controller'.
Could not find resource 'Joint1' in 'hardware_interface::VelocityJointInterface'.
[ERROR] [1589084721.726287254]: Initializing controller 'mobile_base_controller' failed
Error when loading 'mobile_base_controller'
Started ['joint_state_controller'] successfully
[ERROR] [1589084721.743018591]: Could not start controller with name 'mobile_base_controller' because no controller with this name exists

launch file:

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

  <!-- GDB functionality -->
  <arg name="debug" default="false" />
  <arg unless="$(arg debug)" name="launch_prefix" value="" />
  <arg     if="$(arg debug)" name="launch_prefix" value="gdb --ex run --args" />

  <!-- Load example URDF -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find rrbot_description)/urdf/rrbot.xacro'" />

  <group ns="rrbot">

    <!-- Load hardware interface -->
    <node name="rrbot_hardware_interface" pkg="ros_control_boilerplate" type="sim_hw_main"
          output="screen" launch-prefix="$(arg launch_prefix)"/>

    <!-- Load controller settings -->
    <rosparam file="$(find ros_control_boilerplate)/rrbot_control/config/rrbot_controllers.yaml" command="load"/>

    <!-- Load controller manager -->
    <node name="ros_control_controller_manager" pkg="controller_manager" type="controller_manager" respawn="false"
      output="screen" args="spawn joint_state_controller mobile_base_controller" />

    <!-- Convert joint states to /tf tranforms -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

  </group>

</launch>

config file:

# ros_control_boilerplate Settings -----------------------
# 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
   sim_control_mode: 0 # 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

# Joint Trajectory Controller -------------------------------
# For detailed explanations of parameter see http://wiki.ros.org/joint_trajectory_controller
position_trajectory_controller:
   type: position_controllers/JointTrajectoryController
   # These joints can likely just be copied from the hardware_interface list above
   joints:
      - joint1
      - joint2
   constraints:
      goal_time: 5.0
      #stopped_position_tolerance: 0.4 # Defaults to 0.01
      joint1:
          trajectory: 0.60
          goal:       0.15
      joint2:
          trajectory: 0.60
          goal:       0.15
   # gains:
   #     joint1: {p: 2.0,  i: 0.0, d: 0.01, i_clamp: 1}
   #     joint2: {p: 2.0,  i: 0.0, d: 0.01, i_clamp: 1}

    # state_publish_rate:  50 # Defaults to 50
    # action_monitor_rate: 20 # Defaults to 20
    #hold_trajectory_duration: 0 # Defaults to 0.5

mobile_base_controller:
  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : 'Joint1'
  right_wheel : 'Joint2'
  publish_rate: 50.0               # default: 50
  pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

  # Wheel separation and diameter. These are both optional.
  # diff_drive_controller will attempt to read either one or both from the
  # URDF if not specified as a parameter
  wheel_separation : 1.0
  wheel_radius : 0.3

  # Wheel separation and radius multipliers
  wheel_separation_multiplier: 1.0 # default: 1.0
  wheel_radius_multiplier    : 1.0 # default: 1.0

  # Velocity ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-10 04:11:32 -0500

gvdhoorn gravatar image

updated 2020-05-10 04:13:11 -0500

The error is this:

[ERROR] [1589084721.726199477]: Exception thrown while initializing controller 'mobile_base_controller'.

Could not find resource 'Joint1' in 'hardware_interface::VelocityJointInterface'.

Note how it says: cannot find Joint1.

Your config file contains this (I've removed irrelevant lines):

hardware_interface:
   joints:
      - joint1
      - joint2

[..]

position_trajectory_controller:
   joints:
      - joint1
      - joint2

[..]

joint1_position_controller:
   joint: joint1
joint2_position_controller:
   joint: joint2

[..]

joint_position_controller:
   joints:
     - joint1
     - joint2

but then suddenly:

mobile_base_controller:
  left_wheel  : 'Joint1'
  right_wheel : 'Joint2'

It's likely the joints are actually called joint1 and joint2, not Joint1 and Joint2 (note the uppercase J).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-09 23:28:56 -0500

Seen: 802 times

Last updated: May 10 '20