Skip to content

issue with three joints #55

Description

@roboticsai

I have 2 joints as right and left wheels of a diff drive controller and 1 joint as joint poisition controller. but somehow the diff drive commands are comming properly inside the hardware interface but the joint position controller command is not comming. This is my configuration:

# 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:
      - wheel_left_joint
      - wheel_right_joint
      - camera_joint
   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

# Position Controllers ---------------------------------------
turtlebot3_waffle_head_controller:
  type: effort_controllers/JointPositionController
  joint: camera_joint
  pid: {p: 100.0, i: 0.01, d: 10.0}

base_controller:
  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : 'wheel_left_joint'
  right_wheel : 'wheel_right_joint'
  publish_rate: 50.0               # default: 50
  enable_odom_tf: True
  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 : 0.35
  wheel_radius : 0.085
  # Wheel separation and radius multipliers
  wheel_separation_multiplier: 1.0 # default: 1.0
  wheel_radius_multiplier    : 1.0 # default: 1.0

  # Velocity commands timeout [s], default 0.5
  cmd_vel_timeout: 0.25

  # Base frame_id
  base_frame_id: base_footprint #default: base_link

  # Velocity and acceleration limits
  # Whenever a min_* is unspecified, default to -max_*
  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 0.5  # m/s
      min_velocity           : -0.5 # m/s
      has_acceleration_limits: false
      max_acceleration       : 0.2  # m/s^2
      min_acceleration       : -0.2 # m/s^2
      has_jerk_limits        : false
      max_jerk               : 0.01  # m/s^3
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 1.75 # rad/s
      has_acceleration_limits: false
      max_acceleration       : 0.5  # rad/s^2
      has_jerk_limits        : false
      max_jerk               : 0.01  # rad/s^3

And this is my launch file which loads this controllers along with the hardware interface:

<?xml version="1.0"?>
<launch>
    <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" />
    <arg name="serial_port" default="/dev/ttyUSB0"/>

    <param name="robot_description" command="$(find xacro)/xacro '$(find turtlebot3_description)/urdf/turtlebot3_waffle.urdf.xacro'" />
  
    <!--include file="$(find robot_vision)/launch/robot_vision.launch"/>
    <include file="$(find robot_vision)/launch/depthimage_to_laserscan.launch"/>
    <include file="$(find rplidar_ros)/launch/rplidar.launch"/-->

    <remap from="base_controller/odom" to="odom"/>	
    <remap from="base_controller/cmd_vel" to="cmd_vel"/>	
    <node name="medicbot_hw_interface" pkg="medicbot_control" type="medicbot_hw_main"
          output="screen" launch-prefix="$(arg launch_prefix)"/>

    <rosparam file="$(find medicbot_control)/config/medicbot_diff_drive_controller.yaml" command="load"/>

    <node name="ros_control_controller_manager" pkg="controller_manager" type="controller_manager" respawn="false"
	    output="screen" args="spawn 
	        joint_state_controller 
	    	base_controller
	    	turtlebot3_waffle_head_controller" />

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
      <param name="publish_frequency" type="double" value="50.0" />
    </node>
</launch>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions