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

How can diff_drive_controller package subscribe to velocity topics?

asked 2020-04-17 06:39:00 -0500

wallybeam gravatar image

I am trying to make a diff drive bot and I want to use diff_drive_controller package to publish odom and use pid etc.

I have an hardware interface and I am publishing speed values into the topics "right_axis_act_vel" and "left_axis_act_vel" but I couldn't understand how can diff_drive_controller package subscribe to them. Could you please explain how can I relate my velocity topics and the diff_drive_controller package?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-17 08:08:51 -0500

Kaapeine gravatar image

You need to publish velocity commands to the topic cmd_vel which is a twist message. You'll need to provide the linear and angular velocity of the bot to this topic. So, for this, you can write a node that uses those speed values and computes the required linear and angular velocities, and publishes them as a twist message.

edit flag offensive delete link more

Comments

I guess my question is not clear enough, sorry about it. TO be more clear, I am using move_base too. It is publishing the cmd_vel. I want to create a closed-loop control system. My hardware interface is reading encoder values and converts it into speed feedbacks. How should I input this feedbacks into diff_drive_controller package?

wallybeam gravatar image wallybeam  ( 2020-04-18 02:02:54 -0500 )edit

The encoder values need to be converted to an odometry value and published to odom. I don't know how diff_drive_controller would make use of that as it's only subscribing to cmd_vel.

Kaapeine gravatar image Kaapeine  ( 2020-04-18 08:03:51 -0500 )edit

It is only subscribing to the cmd_vel as you mentioned. Also, it publishes Odom so it should be somehow taken encoder feedback as input. I don't know how to make the encoder feedbacks input to the diff_drive_controller.

wallybeam gravatar image wallybeam  ( 2020-04-19 03:22:18 -0500 )edit

Sorry, I couldn't figure it out. But here's the package that I used: http://wiki.ros.org/differential_drive It's more straightforward and the documentation is way better. Hope it helps!

Kaapeine gravatar image Kaapeine  ( 2020-04-19 03:39:58 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-04-17 06:39:00 -0500

Seen: 190 times

Last updated: Apr 17 '20