couldn't start diff drive controller: Could not find resource 'Joint1'
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 ...