Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff_drive_controller fails to initialise and load #500

Closed
moshahin1 opened this issue Jul 25, 2020 · 4 comments
Closed

diff_drive_controller fails to initialise and load #500

moshahin1 opened this issue Jul 25, 2020 · 4 comments

Comments

@moshahin1
Copy link

moshahin1 commented Jul 25, 2020

Hi, I am trying to implement differential drive on my 4 Wheel robot similar to the Husky and Jackal however when I use the controller I get the following error:
Using Ubuntu 18.04, ROS Melodic

[ERROR] [1595701441.454646278, 0.449000000]: Robot description couldn't be retrieved from param server.
[ERROR] [1595701441.454815515, 0.449000000]: Failed to initialize the controller
[ERROR] [1595701441.455088288, 0.450000000]: Initializing controller 'differential_drive' failed
[ERROR] [1595701442.457054, 1.426000]: Failed to load differential_drive

I have looked across the internet for the solution and made sure of the following:

  1. Included the gazebo_ros_control gazebo plugin.
  2. Transmission includes hardware_interface/VelocityJointInterface
  3. Joint names match the YAML left_wheel and right_wheel parameters
  4. Namespace in the YAML file matches the launch file
  5. The args in the launch contain the name of the controllers in the YAML file.
  6. Checked the package is installed (it is) : diff_drive_controller /opt/ros/melodic/share/diff_drive_controller

So what am I missing or doing wrong? The joint_state_controller (and any other controller I add)
loads but the differential drive fails to load. I have even followed the Jackal files to see where I went wrong but still no idea. If you would like to look at the YAML, URDF and launch file: https://answers.ros.org/question/357979/diff_drive_controller-failing-to-launch/

I am new to ROS so I would like to thank you in advance for your help and apologies if this issue is on my behalf.

EDIT
I thought this problem was because I forgot to add the diff_drive_controller as a dependency for my package and went on to add the following (to the package.xml and CMakeLists.txt):

<build_depend>diff_drive_controller</build_depend> 
<build_export_depend>diff_drive_controller</build_export_depend> 
<exec_depend>diff_drive_controller</exec_depend>

find_package(catkin REQUIRED COMPONENTS
  controller_manager
  gazebo_ros
  joint_state_publisher
  robot_state_publisher
  diff_drive_controller
  rospy
  rviz
)

And It still did not solve anything. I still get the issue above.

@mateus-amarante
Copy link
Contributor

Let me try to help you.

You are getting into this condition:

if (!res || !root_nh.getParam(model_param_name,robot_model_str))
{
ROS_ERROR_NAMED(name_, "Robot description couldn't be retrieved from param server.");
return false;
}

Make sure you have your robot URDF model is loaded in "robot_description" param. The urdf tutorials might help you with that

@roboticlemon
Copy link

This is definitely a namespace issue. Unfortunately all throughout ROS these can sometimes crop up in ways that aren't intuitive.

Do a rosparam list and check that your robot_description param is there and it's not under another namespace.

@wxmerkt
Copy link
Contributor

wxmerkt commented Aug 25, 2020

I believe one solution would be to change the instantiation to support non-root-namespace robot_description parameters. See #245 and #503 - this would enable namespace/multi-robot support.

@moshahin1
Copy link
Author

After messing around, I do think it is a namespace issue. The issue occurs when I insert monsterborg:(name of my robot) at the top of the YAML file with therosparams for the diff_controller. I will also run the rosparam list command and check my robot_description is there. Would it be helpful to link the github repository with the code? I evantually want to spawn multiple robots so I want to use a different namespace for each one e.g. monsterborg1/ etc...

@wxmerkt I will look at those today and post the outcome ASAP. Thank you everyone!

@bmagyar bmagyar closed this as completed Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants