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

ndimick's profile - activity

2020-10-19 16:53:11 -0500 received badge  Famous Question (source)
2020-08-29 05:20:44 -0500 received badge  Famous Question (source)
2020-05-12 21:28:52 -0500 received badge  Notable Question (source)
2020-05-12 21:28:44 -0500 received badge  Notable Question (source)
2020-03-23 09:39:01 -0500 received badge  Popular Question (source)
2020-03-15 14:40:09 -0500 asked a question Diff drive controller publishing TFs and odometry with NANs

Diff drive controller publishing TFs and odometry with NANs In my launch file that I use to bring up my robot, I launch

2020-03-11 12:27:27 -0500 marked best answer Diff_drive_controller not subscribing to /cmd_vel

Hi, my team is working on a differential drive robot and trying to decide if the diff_drive_controller is a good fit for our project. We have been borrowing and adapting code from projects like My_ROS_mobile_robot, ros_control_boilerplate, and the hardware_interface tutorial.

Our problem right now is that when we launch all the nodes that we believe we need, there is no subscription to /cmd_vel as we would expect, given diff_drive_controller's documentation. I'll leave some snippets of our code below. Here is a link to our full repository, with relevant code to this problem located in the hw_interface and launch directories.

Here is our relevant code: diff_drive.launch:

<launch>
<!-- Hardware Interface -->
<node name='hardware_interface' type='hw_interface_node' pkg='hw_inter'/>
<!-- URDF -->
<arg name="urdf_file" default="$(find xacro)/xacro --inorder '$(find rover_4_core)/description/urdf/rover.urdf'" />
<param name="robot_description" command="$(arg urdf_file)" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<!-- Load controller config -->
<rosparam command="load" 
          file="$(find rover_4_core)/hw_interface/config/common.yaml"/>
<rosparam command="load" 
          file="$(find rover_4_core)/hw_interface/config/control.yaml"/>

<node name="controller_spawner" 
      pkg="controller_manager" 
      type="spawner" 
      output="screen" 
      ns="/"
      args="mobile_base_controller joint_state_controller leftWheel_effort_controller rightWheel_effort_controller"/>    
</launch>

control.yaml:

my_robot:
motor_commands:
    pwm_update_frequency: 50.0
    cmd_vel_topic:
      left:  "/cmd_vel"
      right: "/cmd_vel"
  # Publish all joint states -----------------------------------
  # Creates the /joint_states topic necessary in ROS
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  # Effort Controllers ---------------------------------------
  leftWheel_effort_controller:
    type: effort_controllers/JointEffortController
    joint: lwheel_to_base
    pid: {p: 100.0, i: 0.1, d: 10.0}
    #pid: {p: 50.0, i: 0.1, d: 0.0}
  rightWheel_effort_controller:
    type: effort_controllers/JointEffortController
    joint: rwheel_to_base
    pid: {p: 100.0, i: 0.1, d: 10.0}
    #pid: {p: 50.0, i: 0.1, d: 0.0}

common.yaml:

mobile_base_controller:
  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : 'left_wheel'
  right_wheel : 'right_wheel'
  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 : 0.026 # meters 
  wheel_radius : 0.0045    # meters

  # 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_link #default: base_link
  # Velocity and acceleration limits
  # Whenever a min_* is unspecified, default to -max_*
  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 1.15 #1.0  # m/s
      min_velocity           : -1.15 #-0.5 # m/s
      has_acceleration_limits: true
      max_acceleration       : 5.0 #0.8  # m/s^2
      min_acceleration       : -1.0 #-0.4 # m/s^2
      has_jerk_limits        : true
      max_jerk               : 5.0  # m/s^3
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 50.0 #1.7  # rad/s
      has_acceleration_limits: true
      max_acceleration       : 1.5  # rad/s^2
      has_jerk_limits        : true
      max_jerk               : 2.5  # rad/s^3

#Publish to TF directly or not
enable_odom_tf: true

#Name of frame to publish odometry in
odom_frame_id: odom

# Publish the velocity command to be executed. 
# It is to ...
(more)
2020-03-11 12:27:27 -0500 received badge  Scholar (source)
2020-03-11 12:15:38 -0500 received badge  Supporter (source)
2020-03-11 12:15:35 -0500 commented answer Diff_drive_controller not subscribing to /cmd_vel

Thank you! adding the ros::AsyncSpinner did the trick. Again, thanks for your time, help and additional insights.

2020-03-11 05:42:38 -0500 received badge  Famous Question (source)
2020-03-10 13:25:18 -0500 commented question Diff_drive_controller not subscribing to /cmd_vel

I've added the output of rosnode info hardware_interface to the original post. it is at the very bottom of the post. Ad

2020-03-10 13:20:27 -0500 commented question Diff_drive_controller not subscribing to /cmd_vel

I've added the output of rosnode info hardware_interface to the original post. it is at the very bottom of the post.

2020-03-10 13:17:11 -0500 edited question Diff_drive_controller not subscribing to /cmd_vel

Diff_drive_controller not subscribing to /cmd_vel Hi, my team is working on a differential drive robot and trying to dec

2020-03-10 13:17:11 -0500 received badge  Editor (source)
2020-03-09 20:11:30 -0500 commented question Diff_drive_controller not subscribing to /cmd_vel

Should the controller start automatically after it is spawned or does it have to be manually started inside of a node?

2020-03-05 12:12:47 -0500 received badge  Popular Question (source)
2020-03-05 11:27:15 -0500 commented question Diff_drive_controller not subscribing to /cmd_vel

launching using roslaunch --screen rover_4_core diff_drive.launch produced the same console output as before. No new

2020-03-05 01:55:40 -0500 received badge  Notable Question (source)
2020-03-04 17:19:05 -0500 received badge  Popular Question (source)
2020-03-04 16:09:04 -0500 commented question Diff_drive_controller not subscribing to /cmd_vel

Hi, @gvdhoorn, thanks for your help! I've edited the original question to include the console output at the bottom of th

2020-03-04 16:07:39 -0500 edited question Diff_drive_controller not subscribing to /cmd_vel

Diff_drive_controller not subscribing to /cmd_vel Hi, my team is working on a differential drive robot and trying to dec

2020-03-04 12:12:22 -0500 asked a question Diff_drive_controller not subscribing to /cmd_vel

Diff_drive_controller not subscribing to /cmd_vel Hi, my team is working on a differential drive robot and trying to dec

2020-03-02 19:36:49 -0500 received badge  Student (source)
2020-03-02 17:29:36 -0500 commented question Using diff_drive, problem with our hw_interface

@gvdhoorn Thanks for your answer! and you were right, controller_manager was missing from CMakeLists.txt. Follow up: w

2020-03-02 15:30:56 -0500 asked a question Using diff_drive, problem with our hw_interface

Using diff_drive, problem with our hw_interface Scenario: We (me and @pitosalas) have built a robot (basic diff_drive co