Help with diff_drive_controller & gazebo?

1,650 views
Skip to first unread message

Zac Witte

unread,
May 19, 2016, 5:24:45 PM5/19/16
to ROS/Orocos Robot Control Special Interest Group
I'm just learning ros-control and trying to set up a model of our robot in gazebo following the gazebo tutorial. We have a wheelchair base robot and the next step is to use ros-control to link up to the roboteq ros node to control it.

When I used the joint_state_controller as the tutorial guided I was able to move the robot forwards and back, but not turn. Then I tried converting it to the diff_drive_controller and I'm not seeing any movement at all. I know that my teleop node is sending commands to the correct topic and I know there's no movement on /odom or /tf. Other than that, ros-control seems like a black box and I'm not sure how to bisect the problem.

Can anyone see anything wrong with this configuration?
scrappy_gazebo.launch
scrappy_control.yaml
scrappy.urdf.xacro
wheel.urdf.xacro

Paul Mathieu

unread,
May 19, 2016, 5:55:27 PM5/19/16
to Zac Witte, ROS/Orocos Robot Control Special Interest Group
Nothing seems wrong with your configuration, but then it would be interesting to look at your robot sim driver.

It's a very simple driver for a diff-drive mobile base that interfaces with ros_control.
They key points are:

- joint handles are registered with a joint state interface
- and then registered with a joint velocity interface

Hope that helps,
Paul

--
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.

Bence Magyar

unread,
May 19, 2016, 5:58:29 PM5/19/16
to Zac Witte, ROS/Orocos Robot Control Special Interest Group
Hi Zac,

I had a very quick look at the files and what pops up first is that you both have the gazebo diff drive controller and the ros_control diff drive controller. I agree it may be a bit confusing but those 2 are fairly different. My spider-sense hints a bit of confusion here.

One example I could give is the PMB2:

Don't mind the custom ros_control plugin (pmb2_hardware_gazebo), you can consider it to be pretty much the same as the default (only adds some fancy stuff such as casters). 

It's rather simple. You have to configure up the diff_drive_controller and load the plugin. Make sure controller_manager is running and do a rosservice call /controller_manager/list_controllers to verify that the controller is there too. 

Hope this help, I can assist more next morning :)

Cheers,
Bence

--

Zac Witte

unread,
May 20, 2016, 5:13:44 PM5/20/16
to ROS/Orocos Robot Control Special Interest Group, zacw...@gmail.com
Thanks for the quick help guys.

Paul, forgive my greenness, but I'm having trouble relating the diffbot.h test to the URDF/yaml setup I've seen everywhere else. I'm not sure how that fits in.

Bence, thanks - that's helpful. I now get that libgazebo_ros_diff_drive.so and libgazebo_ros_control.so are redundant and may conflict. I removed libgazebo_ros_diff_drive.so and am letting my scrappy_control.yaml provide all the configuration for libgazebo_ros_control.so instead of defining it in the robot URDF. I've parsed through all of the pmb2 example configs and as far as I can tell my setup has everything it needs.

There are still a lot of holes in my knowledge of the ros-control stack, how it integrates with gazebo, and it's still not working. I get no movement and rviz is missing the TF for the wheels. 

1) I've seen a couple ways of defining the <transmission> block and I've tried both. I'm using Indigo and I'm not sure how the format changes between versions.

2) Is the diff_drive_controller all I need? In other examples I've seen things like join_state_controller and joint_position_controller and I'm not sure if those are alternatives to diff_drive_controller or if I need multiple controllers.

3) I'm a little unclear about what nodes are required just for rviz, which are required just for gazebo, and which are required for running on actual hardware. I've mostly seen examples with the controller_manager spawner and loading the yaml config within the rviz block in the launch file, but I would think those would be a pretty important thing to have regardless of whether rviz is used.

It would be very helpful to see a simple, working example of diff drive controller working with gazebo, rviz, and on a real robot. The pmb2 bot is helpful, but not the lowest common denominator and complex enough to make it difficult to compare. If I felt confident with this stuff I would be willing to help with the documentation.

Thanks in advance for more help.

Zac
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-robot-control+unsub...@googlegroups.com.
ros_control.log
caster.urdf.xacro
materials.urdf.xacro
scrappy.urdf.xacro
wheel.urdf.xacro
scrappy_control.yaml
scrappy_gazebo.launch

Bence Magyar

unread,
May 22, 2016, 5:35:34 AM5/22/16
to Zac Witte, ROS/Orocos Robot Control Special Interest Group
Hi Zac,

See answers below.

2016-05-20 22:13 GMT+01:00 Zac Witte <zacw...@gmail.com>:
Thanks for the quick help guys.

Paul, forgive my greenness, but I'm having trouble relating the diffbot.h test to the URDF/yaml setup I've seen everywhere else. I'm not sure how that fits in.

Bence, thanks - that's helpful. I now get that libgazebo_ros_diff_drive.so and libgazebo_ros_control.so are redundant and may conflict. I removed libgazebo_ros_diff_drive.so and am letting my scrappy_control.yaml provide all the configuration for libgazebo_ros_control.so instead of defining it in the robot URDF. I've parsed through all of the pmb2 example configs and as far as I can tell my setup has everything it needs.

There are still a lot of holes in my knowledge of the ros-control stack, how it integrates with gazebo, and it's still not working. I get no movement and rviz is missing the TF for the wheels. 

1) I've seen a couple ways of defining the <transmission> block and I've tried both. I'm using Indigo and I'm not sure how the format changes between versions.
That part is quite stable now, if you add the interface to both the actuator and joint sections, you are safe. 

2) Is the diff_drive_controller all I need? In other examples I've seen things like join_state_controller and joint_position_controller and I'm not sure if those are alternatives to diff_drive_controller or if I need multiple controllers.
The wiki page of joint_state_controller says this: "Controller to publish joint state". That doesn't do anything but publishes joint states, you need that to run robot_state_publisher that publishes tf for you which in return makes everything work in rviz and most tools.
If you only have wheels, a joint_position_controller is not needed.

3) I'm a little unclear about what nodes are required just for rviz, which are required just for gazebo, and which are required for running on actual hardware. I've mostly seen examples with the controller_manager spawner and loading the yaml config within the rviz block in the launch file, but I would think those would be a pretty important thing to have regardless of whether rviz is used.

It would be very helpful to see a simple, working example of diff drive controller working with gazebo, rviz, and on a real robot. The pmb2 bot is helpful, but not the lowest common denominator and complex enough to make it difficult to compare. If I felt confident with this stuff I would be willing to help with the documentation.
I think I answered some of the issues raised here above. I think the best way to attack general system design with ROS would be a couple of strong charts with components and rqt_graph-like data flow markup.

Thanks in advance for more help.

Zac

On Thursday, May 19, 2016 at 2:58:29 PM UTC-7, Bence Magyar wrote:
Hi Zac,

I had a very quick look at the files and what pops up first is that you both have the gazebo diff drive controller and the ros_control diff drive controller. I agree it may be a bit confusing but those 2 are fairly different. My spider-sense hints a bit of confusion here.

One example I could give is the PMB2:

Don't mind the custom ros_control plugin (pmb2_hardware_gazebo), you can consider it to be pretty much the same as the default (only adds some fancy stuff such as casters). 

It's rather simple. You have to configure up the diff_drive_controller and load the plugin. Make sure controller_manager is running and do a rosservice call /controller_manager/list_controllers to verify that the controller is there too. 

Hope this help, I can assist more next morning :)

Cheers,
Bence
2016-05-19 22:24 GMT+01:00 Zac Witte <zacw...@gmail.com>:
I'm just learning ros-control and trying to set up a model of our robot in gazebo following the gazebo tutorial. We have a wheelchair base robot and the next step is to use ros-control to link up to the roboteq ros node to control it.

When I used the joint_state_controller as the tutorial guided I was able to move the robot forwards and back, but not turn. Then I tried converting it to the diff_drive_controller and I'm not seeing any movement at all. I know that my teleop node is sending commands to the correct topic and I know there's no movement on /odom or /tf. Other than that, ros-control seems like a black box and I'm not sure how to bisect the problem.

Can anyone see anything wrong with this configuration?

--
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.

--
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.
Reply all
Reply to author
Forward
0 new messages