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

Revision history [back]

I managed to solve the problem!

The misleading bit was this message from Gazebo ros_control:

[ INFO] [1529903997.363384038, 0.360000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.

It turns out that because of namespacing tha gazebo_ros_control was looking for /dd_bot/robot_description, even though the above message said otherwise.

Once I made sure the namespacing was matching everything worked correctly. All of my updated files are in the mentioned in my question. Here are the highlights:

gazebo.launch: <launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
    <arg name="verbose" value="true"/>
  </include>

    <!-- Load the URDF into the ROS Parameter Server -->
    <param name="dd_bot/robot_description"
      command="$(find xacro)/xacro --inorder '$(find dd_bot)/urdf/dd_bot.urdf'" />

    <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
    <node name="urdf_spawner" pkg="gazebo_ros" ns="dd_bot" type="spawn_model" respawn="false" output="screen"
      args="-urdf -model dd_bot -param robot_description -R 3.14"/>

  <!-- convert joint states to TF transforms for rviz, etc -->
    <node name="robot_state_publisher" ns="dd_bot" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
      <!-- <remap from="/joint_states" to="/dd_bot/joint_states" /> -->
    </node>

  <!-- Run joint state publisher (Gets robot_description from parameter server)-->
<node pkg="joint_state_publisher"
    type="joint_state_publisher"
    name="joint_state_publisher" 
    ns="dd_bot">
    <param name="rate" value="50" />
</node>

</launch>

diff_drive.yaml:

dd_bot:
    joint_state_controller:
        type: joint_state_controller/JointStateController
        publish_rate: 50  

    mobile_base_controller:
        type: "diff_drive_controller/DiffDriveController"
        left_wheel: 'left_wheel_joint'
        right_wheel: 'right_wheel_joint'
        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]
        base_frame_id: base_link

        # Odometry fused with IMU is published by robot_localization, so
        # no need to publish a TF based on encoders alone.
        enable_odom_tf: false

        # Husky hardware provides wheel velocities
        estimate_velocity_from_position: false

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

        # Velocity and acceleration limits
        # Whenever a min_* is unspecified, default to -max_*
        linear:
            x:
                has_velocity_limits    : true
                max_velocity           : 1.0   # m/s
                has_acceleration_limits: true
                max_acceleration       : 3.0   # m/s^2
        angular:
            z:
                has_velocity_limits    : true
                max_velocity           : 2.0   # rad/s
                has_acceleration_limits: true
        max_acceleration       : 6.0 # rad/s^2

diff_drive.launch:

<launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find dd_bot)/config/diff_drive.yaml" command="load"/>

  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/dd_bot" args="joint_state_controller
    mobile_base_controller"/>

</launch>

Hope someone finds it useful in the future!