converting twist messages to pwm signal arduino

asked 2019-06-07 06:13:39 -0500

vinilreddy gravatar image

how can i convert the Twist messages in ros to arduino pwm commands for a differential drive robot.

edit retag flag offensive close merge delete

Comments

We're all here to help, but we can't do your work for you.

Have you tried searching for this? What did you find? What did you try? What didn't work?

Tip: use Google to search ROS Answers. Something like <your search terms here> site:answers.ros.org.

gvdhoorn gravatar imagegvdhoorn ( 2019-06-07 06:24:14 -0500 )edit

actually i am new to all this, i've been learning the theory part and then start implementing it, i have written a node in ros which taken the ticks from the encoder and publishes odometry data and respective tf's. now what i want is , the navgation stack gives a twist message. i want that twist message to be converted into pwm signal.

i just want to how to approach to this problem and yeah i have been searching for this on the web, all the answers suggest to use already available packages like linorobot, diff_drive ros etc..

but i want to write it on my own

is this a proper approach ?

1.with given encoder pulses i convert them to rpm, 2.twist messages give me linear velocities 3. i can convert linear velocity to rpm using this v = r × RPM × 0.10472 but i want rpm of ...(more)

vinilreddy gravatar imagevinilreddy ( 2019-06-07 06:42:17 -0500 )edit

A few older Q&As that seem relevant: #q209963, #q239657 and #q278917.

Your question would appear to not really a ROS-related one, as it's more about the general theory behind converting a body-relative linear and angular velocity into one for your two (or more) wheels. There are a good nr of general robotics sites that have good explanations on how differential drive kinematics works.

all the answers suggest to use already available packages like linorobot, diff_drive ros etc.. but i want to write it on my own

If you still want to write your own, you might want to at least take a look at those packages, as they will most likely include examples of implementations that solve the question you posted.

gvdhoorn gravatar imagegvdhoorn ( 2019-06-07 09:30:27 -0500 )edit