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

How to use ros_control and diff_drive_controller using python?

asked 2019-08-15 03:26:20 -0500

joseecm gravatar image

Hello!

I am beggining to learn ROS and I am trying to use ros_control with a diff_drive_controller. I have read many tutorial and searched on google but I have found only C++ code examples. Could anybody tell me or provide a example code for a real robot using python, please?

Best regards.

edit retag flag offensive close merge delete

Comments

What do you actually want to do? Command a diff drive mobile base to a certain position? Something else?

gvdhoorn gravatar image gvdhoorn  ( 2019-08-15 04:17:38 -0500 )edit

I am trying to move a two wheeled Lego EV3 robot using ROS on a laptop and sending commands to the motors through MQTT message protocol. I already know how to make a base_controller that convert ROS twist messages to left and right motors commands but I want to learn how to use ros_control and ros_diff_controller and I didn't know that the only way is using C++.

joseecm gravatar image joseecm  ( 2019-08-15 13:22:29 -0500 )edit

This may be due to a misunderstanding of how you'd interface with the diff_drive_controller: as you can read here it accepts geometry_msgs/Twist inputs that then get converted to individual wheel velocities. You don't typically "use it from C++" (if that means: directly calling methods on/in it).

gvdhoorn gravatar image gvdhoorn  ( 2019-08-17 05:13:08 -0500 )edit

First of all thanks for your comments. I know that diff_drive_controller takes a geometry_msgs/Twist as an input but what I don't know is how it is converted to each wheel velocity. - Where can I get the individual wheel velocities? - How can I send these velocity values to a python script?

Regards.

joseecm gravatar image joseecm  ( 2019-08-22 14:13:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-08-15 03:40:19 -0500

joseecm gravatar image

Well, I have found the answer myself. I can not use python with ros_control so I will have to learn C++

Regards.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2019-08-15 03:26:20 -0500

Seen: 592 times

Last updated: Aug 15 '19