Simple diff_drive_controller info/help

2,421 views
Skip to first unread message

Chris Crippen

unread,
Nov 30, 2014, 5:39:09 AM11/30/14
to ros-sig-ro...@googlegroups.com
Hello,

I am currently working on a project that is taking an electric wheelchair base, and making it into a general mobile project platform. I am currently trying to get the differential drive controller working with with my gazebo simulation model, the urdf file that I have attached was generated from a solidworks model that I created/hacked together from a grabcad wheelchair that looked close to the one I am using. I had success creating (using) a simple effort position controller, and the velocity controller's JointVelocityController, which should let you know that I do have the basic ideas of adding the transmissions, plugins, and other <gazebo> tags </gazebo> to the urdf and I am beginning to think my problem is something very simple that I just cant seem to notice.

For the diff drive controller, I am not trying to do anything fancy (yet), just simply loading and running the controller through the use of basic rostopics and rosservices to be sure everything is loaded and interacting properly. I am using the example minimal yaml config file that is in the ros_controllers github and am just trying to simply get the controller to load manually using rosservice calls.

I would like to mention, I kept in all the random items that I have tried and commented out so you might be able to see a few of the things that I have tried, I started off trying to load the diff drive controller through a launch file, and after trying to launch all the controllers using a single yaml file, I eventually split them into the velocity controller, and diff drive controller yaml files that you see attached (there is much unneeded code in them).

When I attempt to load the diff_drive_controller using the rosservice call,  I get these errors bellow,  I also have attached a screenshot with my terminal displaying the rosparam list command, showing the "robot description" being in the param server, and I was able to get that parameter and display it also.

[ERROR] [1417338350.580091510, 1122.203000000]: Robot descripion couldn't be retrieved from param server.
[ERROR] [1417338350.580215810, 1122.203000000]: Failed to initialize the controller
[ERROR] [1417338350.580286582, 1122.203000000]: Initializing controller '/diff_drive_controller' failed

From everything I have read, and from all the different examples I have looked at (including the following; segbot, labrob, pr2)  it seems like the plugin tag directly within the urdf should be sufficient to start using the cmd_vel topic to control the wheel chair model but that does not appear to be the case through my current experience. I have not really dissected my urdf file since the other controller's seem to function properly.

here are a couple specific questions that I have, in the diff_drive_controller_plugin.xml it says 
"The DiffDriveController tracks velocity commands. It expects 2 VelocityJointInterface type of hardware interfaces"

is that referring to the joint information within the transmission element of the urdf?
 <joint name="left_rear_wheel_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
    </joint>

In this post, you mention that that the diff drive controller is not a "node" is my assumption correct, that the urdf plugin tag should be all that is needed to make the diff drive controller work? also your presentation did help clear a few things up about the general functionality of the ros_controllers package.



I read over this email/post a few times, I think it makes something close to a coherent thought (it is very late... early?) and sorry if it doesn't.
Any help or advice would be much appreciated please let me know if more information or clarification is needed.

Chris Crippen






wheelchair.URDF
wheelchair_diff_control.yaml
wheelchair_control.yaml
Screenshot from 2014-11-30 04:30:38.png

Chris Crippen

unread,
Dec 1, 2014, 3:03:22 AM12/1/14
to ros-sig-ro...@googlegroups.com
I wanted to let you guys know that I was evidently over complicating things entirely... I took a few steps back, and also found this  nice tutorial. Things I have learned: The most simple solution is most often the correct solution...

I also thought it would be good to give a full update, in case this information helps someone else.

I asked this question
in the diff_drive_controller_plugin.xml it says 
"The DiffDriveController tracks velocity commands. It expects 2 VelocityJointInterface type of hardware interfaces"

is that referring to the joint information within the transmission element of the urdf?
 <joint name="left_rear_wheel_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
    </joint>

it turns out that (and I had known this) that the effort joint interface is of type HWinterface, and is the velocity controller that the diff drive plugin is looking for
<joint name="left_rear_wheel_joint">
<hardwareInterface>EffortJointInterface</hardwareInterface>
</joint>

I asked this question also
In this post, you mention that that the diff drive controller is not a "node" is my assumption correct, that the urdf plugin tag should be all that is needed to make the diff drive controller work? also your presentation did help clear a few things up about the general functionality of the ros_controllers package.

I was indeed correct, the diff drive plugin not only starts up by "itself" without a launch file, but does not even require the effort controllers to be launched.

I attached my yaml, control.launch and urdf again hoping it might help someone else at some point. 
now on to move it, navigation, and all the fun things! I might be posting here again in the next couple weeks as I try to incorporate all these new plugins / packages into the simulation and then migrate it all to the actual robot hardware.

on a side not thank you for what you are doing here with this ros_controllers package, it is actually really simple to use once you get use to the urdf, yaml, launch.
  
thanks again!

On Sunday, November 30, 2014 5:39:09 AM UTC-5, Chris Crippen wrote:
Hello,






wheelchair_control.launch
wheelchair_control.yaml
wheelchair.URDF

Adolfo Rodríguez Tsouroukdissian

unread,
Dec 1, 2014, 3:37:32 AM12/1/14
to Chris Crippen, ros-sig-ro...@googlegroups.com


On Mon, Dec 1, 2014 at 9:03 AM, Chris Crippen <chri...@gmail.com> wrote:

Hello Chris,

It seems like you have things running, which is good, but I think some comments would be useful.

You might not know this, but there are two implementations of a diff-drive controller you could be using:
- There's a Gazebo plugin, which only works in the Gazebo simulator
- There's a ros_control  plugin, which can work with Gazebo and real hardware.

Both might do what you want, but it's important that you know which one you're using. From your URDF, you seem to be using the former (libgazebo_ros_diff_drive.so), which is why things are working for you with effort-controlled wheels.

If you wanted to use ros_control's implementation, you'd need to:
- Load the gazebo_ros_control Gazebo plugin (you already do so)
- Expose your wheels as velocity-controlled joints. Note that you're missing the 'hardware_interface' namespace, it should read
  <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
- Load a controller config for the diff-drive into the param server (typically from a yaml file,as you already do for other controllers)
- Load+start the controller (e.g., as you already do with a controller spawner in a launch file)

Although your current setup does have a running gazebo_ros_control plugin, and you are starting two single-joint velocity controllers, I think you're not using them at all.

One last thing. In your first post, the robot_description was not being found. For this, make sure that you're loading your UR DF to the same namespace you specify in the <robotNamespace> element when loading the gazebo_ros_control plugin. If your robot description param lives in the root namespace (i.e., /robot_description), then don't specify the <robotNamespace> element, which is what you're doing now (it's commented-out).

I hope the above clarifies things a bit.

Best,

Adolfo.

--
You received this message because you are subscribed to the Google Groups "ROS/Orocos Robot Control Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-robot-co...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adolfo Rodríguez Tsouroukdissian
Senior robotics engineer
adolfo.r...@pal-robotics.com
http://www.pal-robotics.com

PAL ROBOTICS S.L
c/ Pujades 77-79, 4º4ª
08005 Barcelona, Spain.
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
Skype: adolfo.pal-robotics
Facebook - Twitter - PAL Robotics YouTube Channel

AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited.  If you have received this e-mail in error, please immediately notify the sender at the above e-mail address.

Chris Crippen

unread,
Dec 26, 2014, 9:22:54 PM12/26/14
to ros-sig-ro...@googlegroups.com, chri...@gmail.com, adolfo.r...@pal-robotics.com

This last post is to Complete this thread, I only replied to Adolfo when responding through Email. I left out any information that was not directly related to the problem at hand to make this final message flow a bit better.

I responded:
Thank you for the response! That does in fact clear up much, if not all the confusion I was having. I had gotten the Gazebo diff drive controller working, I will look at and expand on that information tomorrow when I return to school. There seems to be many redundant packages. Robot state publisher, joint state publisher, tf broadcaster (I do know or at least think this one is for rvis/moveit ). I have read a lot into ROS, but there is a lot of information to sift through out there about old packages and releases that sometimes only partially apply still. 
Once again thank you for the feed back, it clarified quite a bit.
(from mobile device)


From Adolfo:
To clear this one up. They are not redundant, but complementary:
- The joint_state_publisher and joint_state_controller are packages that publish the state of your robot's *joints* in a sensor_msgs/JointState topic (typically /joint_states). The former is a 'dummy' publisher and has an optional UI, while the latter is a ros_control plugin that publishes the actual state of a running robot (simulation or real).

- The robot_state_publisher takes a sensor_msgs/JointState topic and your robot model (URDF) as input, and broadcasts tf transformations for your robot's links.

- A tf broadcaster broadcasts any tf transform, other than what the robot_state_publisher might be already broadcasting, such as the location of detected landmarks or objects, for instance.

Rviz plugins and MoveIt! rely on joint state and transform information to reason about the robot and its environment, and to display visualizations that depend on it. I don't know if there's a wiki resource that summarizes these common practices


I later Responded:
Adolfo,

I figured I would take a moment to give you an update on how things have gone so far, I have the diff drive plugin working (diff_drive_controller) and am able to publish to the cmd_vel topic just fine.
the the transmission type and hardware interface was slightly different than you mention but no problem at all.
  <transmission name="left_rear_wheel_trans">
    <type>hardware_interface</type>
    <joint name="left_rear_wheel_joint">
 <hardwareInterface>VelocityJointInterface</hardwareInterface>
    </joint>
    <actuator name="left_rear_wheel_motor"/>
    <mechanicalReduction>1</mechanicalReduction>
    <motorTorqueConstant>1</motorTorqueConstant>
  </transmission>



I was wondering if you might be able to recommend any particular packaged or plugin that would allow general control of the robot either through Rvis or some other motion planning package, I briefly looked into moveit! but it seems that that is generally geared more for arm robots with 3D path planning. Eventually (next semester for my "advanced robotics class")  I will be integrating either a kinetic or a xtion for a low cost alternative to laser sensors, and working towards a full slam system with the navigation stack. This semester is almost over and I am looking for nice way to have some basic control over this robotic base platform. I was thinking some sort of joystick teleop type of interface with an xbox controller just to tie this portion of the project together. 


once again thank for the help and information!




Response From Adolfo:

You must be using indigo then. I don't use indigo much, but I though the hydro way of doing things should also work. Well, sorry for the inconvenience.


I was wondering if you might be able to recommend any particular packaged or plugin that would allow general control of the robot either through Rvis or some other motion planning package, I briefly looked into moveit! but it seems that that is generally geared more for arm robots with 3D path planning. Eventually (next semester for my "advanced robotics class")  I will be integrating either a kinetic or a xtion for a low cost alternative to laser sensors, and working towards a full slam system with the navigation stack, but this semester is almost over and I am looking for nice way to have some basic control over this robotic base platform. I was thinking some sort of joystick teleop type of interface with an xbox controller just to tie this portion of the project together. 

For simple joystick/keyboard teleoperation, take a look at teleop_tools:

https://github.com/ros-teleop/teleop_tools


once again thank for the help and information!

Cheers!





Joshua Russell

unread,
Feb 27, 2015, 4:46:03 PM2/27/15
to ros-sig-ro...@googlegroups.com
I am having basically the same problems as you. Would you mind posting your updated(working) URDF,.yaml files so I could reference them. I would appreciate it.

Chris Crippen

unread,
Feb 27, 2015, 4:52:35 PM2/27/15
to Joshua Russell, ros-sig-ro...@googlegroups.com
sure, just letting you know I split it up into Xacro's so you will need to start in wheelchair.urdf.xacro to trace through everything. also I added my wheelchair control package also just for reference.

if you have any questions feel free to ask!

--
You received this message because you are subscribed to a topic in the Google Groups "ROS/Orocos Robot Control Special Interest Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ros-sig-robot-control/1ceavQ8PaUE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ros-sig-robot-co...@googlegroups.com.
wheelchair_urdf.zip
wheelchair_control.zip

Joshua Russell

unread,
Feb 27, 2015, 6:09:37 PM2/27/15
to ros-sig-ro...@googlegroups.com

Like I said, I am having the exact same problems as you did. I am using a large(99%) of these files from a tutorial. In that tutorial, they use xacro to create property blocks for "left" and "right" which they use for creating both sets of wheels/joints/transmissions/etc at the same time, that are needed for them. I am unsure how to reference the left/right wheel joints in the .yaml file for the diff_drive config file. I am pretty sure that is the issue. I have gone through the checklist Adolfo posted, and I think(I use that word cautiously) that I have everything else correct.

Do you know if having the .yaml file's left/right motor joint parameters missing/wrong cause these issues?

Chris Crippen

unread,
Mar 2, 2015, 2:31:37 AM3/2/15
to ros-sig-ro...@googlegroups.com

---------------------------------------------
Chris Crippen
---------------------------------------------
Emails:
Chri...@Gmail.com
Cac...@Rit.edu
---------------------------------------------
Phone:
585-313-8577

---------- Forwarded message ----------
From: Chris Crippen <cac...@rit.edu>
Date: Sat, Feb 28, 2015 at 11:24 AM
Subject: Re: [ros-sig-robot-control] Re: Simple diff_drive_controller info/help
To: Joshua Russell <theru...@gmail.com>


I am using the ros control gazebo plugin,

 <gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
 </plugin>


and attached is the simulation yaml that I use just a moment ago when launching gazebo simply to isolate and test so that I was 100% sure that nothing else was being referenced.(it has been a little wile since I have looked at these files)

The simulation yaml file makes reference to the drive wheel joints that would be defined previously in your URDF or Xacro.

(YAML FILE)
 wheelchair_controller: 
  type: diff_drive_controller/DiffDriveController
  left_wheel: left_drive_wheel_joint
  right_wheel: right_drive_wheel_joint

(URDF/XACRO FILE)
<joint
    name="right_drive_wheel_joint"
    type="continuous">
</joint>

That same joint reference also is used in the transmission tags. For the simulation this tag is especially important since it defines the drive wheel as a VelocityJointInterface (Required for the Diff Drive controller)

<transmission name="right_drive_wheel_joint_trans">
    <type>hardware_interface</type>
    <joint name="right_drive_wheel_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
    </joint>
    <actuator name="right_drive_wheel_joint_motor"/>
    <mechanicalReduction>1</mechanicalReduction>
    <motorTorqueConstant>1</motorTorqueConstant>
  </transmission>

if you look in wheelchair.launch (that is my gazebo launch file) at the end of the file it calls the wheelchair sim control launch file.


The simulation control launch file 
loads the wheelchair_sim_diff.yaml into the param server
starts the wheelchair controller node and joint state controller
starts the robot state publisher node
and lastly starts the joystick control (not needed)

If you have any more problems please provide some of your files or code so that I might be able to determine where things might be going wrong for you. All these code snips have been taken directly from the files I previously sent you.



---------------------------------------------
Chris Crippen
---------------------------------------------
Emails:
Chri...@Gmail.com
Cac...@Rit.edu
---------------------------------------------
Phone:
585-313-8577

On Fri, Feb 27, 2015 at 6:09 PM, Joshua Russell <theru...@gmail.com> wrote:

Like I said, I am having the exact same problems as you did. I am using a large(99%) of these files from a tutorial. In that tutorial, they use xacro to create property blocks for "left" and "right" which they use for creating both sets of wheels/joints/transmissions/etc at the same time, that are needed for them. I am unsure how to reference the left/right wheel joints in the .yaml file for the diff_drive config file. I am pretty sure that is the issue. I have gone through the checklist Adolfo posted, and I think(I use that word cautiously) that I have everything else correct.

Do you know if having the .yaml file's left/right motor joint parameters missing/wrong cause these issues?

--
wheelchair.launch
wheelchair_sim_diff.yaml
wheelchair_sim_control.launch

Chris Crippen

unread,
Mar 2, 2015, 2:32:06 AM3/2/15
to ros-sig-ro...@googlegroups.com

---------------------------------------------
Chris Crippen
---------------------------------------------
Emails:
Chri...@Gmail.com
Cac...@Rit.edu
---------------------------------------------
Phone:
585-313-8577

---------- Forwarded message ----------
From: Joshua Russell <theru...@gmail.com>
Date: Sun, Mar 1, 2015 at 1:52 AM
Subject: Re: [ros-sig-robot-control] Re: Simple diff_drive_controller info/help
To: Chris Crippen <cac...@rit.edu>


I have looked through your files, and I have them looking as they do in yours. Nothing looks wrong. I'll upload the files so you can look at them, if you don't mind. I also sent a screen shot of my terminal window showing the errors on the chance it helps.

Thanks,

Joshua Russell


Like I said, I am having the exact same problems as you did. I am using a large(99%) of these files from a tutorial. In that tutorial, they use xacro to create property blocks for "left" and "right" which they use for creating both sets of wheels/joints/transmissions/etc at the same time, that are needed for them. I am unsure how to reference the left/right wheel joints in the .yaml file for the diff_drive config file. I am pretty sure that is the issue. I have gone through the checklist Adolfo posted, and I think(I use that word cautiously) that I have everything else correct.

Do you know if having the .yaml file's left/right motor joint parameters missing/wrong cause these issues?

--
Screenshot from 2015-03-01 00:50:31.png
mybot_packages.zip

Chris Crippen

unread,
Mar 2, 2015, 2:33:35 AM3/2/15
to ros-sig-ro...@googlegroups.com

Like I said, I am having the exact same problems as you did. I am using a large(99%) of these files from a tutorial. In that tutorial, they use xacro to create property blocks for "left" and "right" which they use for creating both sets of wheels/joints/transmissions/etc at the same time, that are needed for them. I am unsure how to reference the left/right wheel joints in the .yaml file for the diff_drive config file. I am pretty sure that is the issue. I have gone through the checklist Adolfo posted, and I think(I use that word cautiously) that I have everything else correct.

Do you know if having the .yaml file's left/right motor joint parameters missing/wrong cause these issues?

--
Screenshot from 2015-03-01 00:50:31.png
mybot_packages.zip

Chris Crippen

unread,
Mar 2, 2015, 2:38:15 AM3/2/15
to ros-sig-ro...@googlegroups.com

---------------------------------------------
Chris Crippen
---------------------------------------------
Emails:
Chri...@Gmail.com
Cac...@Rit.edu
---------------------------------------------
Phone:
585-313-8577

---------- Forwarded message ----------
From: Joshua Russell <theru...@gmail.com>
Date: Mon, Mar 2, 2015 at 1:15 AM
Subject: Re: [ros-sig-robot-control] Re: Simple diff_drive_controller info/help
To: Chris Crippen <cac...@rit.edu>


The changes you made worked! I hadn't done anything with the name spaces in my own, any of those settings were in the tutorial, and I was just following along. I am able to send Twist messages to the controller's cmd_vel topic, and the odom topic shows that, strangely, I am not getting any movement in Gazebo. But I am sure there is some setting a have to tweak. I haven't set up anything for my bot's .yaml settings, specifically pertaining to it. I just went with the default.

Oh and I didn't think your response was 'late' at all. Anyways, I appreciate your help. Thank you!


Joshua Russell

On Sun, Mar 1, 2015 at 9:57 PM, Chris Crippen <cac...@rit.edu> wrote:
Sorry for the late response, I looked at your files, I changed a few things and commented the file mentioning what I changed and why I changed them. take a look and let me know if they work. 

The main thing that I saw was namespaces, I would hold off on using namespaces until you get the base controller working in the root namespace, and second the name of your controller and the controller node you were launching did not line up. 

I am nearly 100% sure this will fix your problem, I also received this same error at one point.

---------------------------------------------
Chris Crippen
---------------------------------------------
Emails:
Chri...@Gmail.com
Cac...@Rit.edu
---------------------------------------------
Phone:
585-313-8577


Like I said, I am having the exact same problems as you did. I am using a large(99%) of these files from a tutorial. In that tutorial, they use xacro to create property blocks for "left" and "right" which they use for creating both sets of wheels/joints/transmissions/etc at the same time, that are needed for them. I am unsure how to reference the left/right wheel joints in the .yaml file for the diff_drive config file. I am pretty sure that is the issue. I have gone through the checklist Adolfo posted, and I think(I use that word cautiously) that I have everything else correct.

Do you know if having the .yaml file's left/right motor joint parameters missing/wrong cause these issues?

--

Chris Crippen

unread,
Mar 2, 2015, 2:45:22 AM3/2/15
to ros-sig-ro...@googlegroups.com, cac...@rit.edu
alright, so once again I must not have hit reply to all, I have forwarded all the Emails, and then I double posted so I figured I would just copy and paste this next message......

The changes you made worked! I hadn't done anything with the name spaces in my own, any of those settings were in the tutorial, and I was just following along. I am able to send Twist messages to the controller's cmd_vel topic, and the odom topic shows that, strangely, I am not getting any movement in Gazebo. But I am sure there is some setting a have to tweak. I haven't set up anything for my bot's .yaml settings, specifically pertaining to it. I just went with the default. 

Oh and I didn't think your response was 'late' at all. Anyways, I appreciate your help. Thank you!


My Reply

No problem at all! I am glad I could help! if you have any other questions please don't hesitate to ask! I have finished (for now) this wheelchair project, and am now in senior design and am working on a team of 10 making a full scale humanoid robot. We are using ROS and venturing into the MOVEIT package and all the associated motion planning and other fun tools. So my personal knowledge base is continually growing and would like to help when and where I can!
To unsubscribe from this group and all its topics, send an email to ros-sig-robot-control+unsub...@googlegroups.com.

Chris Crippen

unread,
Mar 2, 2015, 2:49:36 AM3/2/15
to ros-sig-ro...@googlegroups.com, cac...@rit.edu
I would like to take a moment to apologies for my poor performance in the general flow of this thread!! mixing Email with group forum posts has not worked all to well for me. If I end up posting more in this group I will attempt to be a bit more conscientious of this!
Reply all
Reply to author
Forward
0 new messages