Robotics StackExchange | Archived questions

How to connect raspberry pi to motor drive with ros?

hi i'm new with ROS, i don't understand how raspberry pi can move to some point/goal with lidar. i have been searching but i don't have the answer yet. what i understand is the raspberry pi send signal to motor driver by GPIO. at this point i don't know how to implement this to ROS.

and yes i already knew about rviz to gmapping, scan laser.

please help thank you.

Asked by kyozho on 2020-08-11 05:31:43 UTC

Comments

Hello kyoyho

Would you please help me with control of motor driver with Rasberry? I can find nothing. Trying to control Lm298n OR IBT motor driver Can you help me ?

Šimon

simon.valkovic@gmai.com

Asked by Saimonko on 2020-09-15 06:25:03 UTC

hi, you can follow this step;

https://projects.raspberrypi.org/en/projects/build-a-buggy

Asked by kyozho on 2020-09-16 22:22:13 UTC

Answers

Generally Ros users use arduino and motor shield to drive motor. I guess you should try this. In that way motors give better performance.

Asked by bfdmetu on 2020-08-11 06:01:52 UTC

Comments

hi, thank you for your help. is there anyway without using those two things. i mean directly use GPIO instead ARDUINO

Asked by kyozho on 2020-08-11 06:05:31 UTC

There are some motor driver for Pi. For example https://www.pololu.com/product/2753 ... Maybe this can works.. Dc motors need high voltage and current. If you dont use any motor driver, motors may damage Pi GPIO pins.

Asked by bfdmetu on 2020-08-11 06:10:32 UTC

hi, thank you for keep following me up. yes i have my own motor driver and already plugged in with raspberry pi. right now i make my own simple code with python to move with w a s d. the GPIO it self i define as below;

BCM Pin
7 = forward left
8 = backward left
9 = forward right
10 = backward left

but this just as basic control with python.
i wanted to make a 2d goal with rviz so the robot can move in certain location in the map
Thank you

Asked by kyozho on 2020-08-12 00:12:50 UTC

You have to learn gmapping and ros navigation.... In order to go a specific goal, firstly your car needs a map (gmapping). Then car needs encoder ( for odom informaiton).. And also laser scanner- lidar... At the final point your car needs to amcl - move_base package.... All of them connect each other. If one of is missing, your car doesn't go anywhere in RVİZ

Asked by bfdmetu on 2020-08-20 03:47:43 UTC