Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Regarding your edit:

The setup you describe, "how do I get my motor to turn", is lower level than ROS. Typically if I had a robot with a microcontroller to control a motor, I'd write some bespoke code (or find libraries, such as Adafruit's for example, probably) for my particular hardware. Most recently, I've just asked ChatGPT for such code (having done it myself the harder ways in years past, so admittedly I know reasonably well what to ask...).

Once you achieve code that moves the motor at various speeds or directions, you might e.g. connect to the Arduino from a computer (e.g. raspberry pi), write a python "ROS Node" script that listens to a ROS topic and sends serial commands from the Pi to the Arduino.

Then, if you attach a laser range-finder or 2D lidar to the Pi, and look for a corresponding ROS node for that laser hardware (on github via google), you would run that additional ROS Node...

And finally you might write the "main" script as a third ROS Node that:

- Interprets the laser data it gets from the laser node's published ROS topic - Has some logic for the robot that interprets that data and chooses to set speed/direction of the motor.

This is all very ad hoc description but hopefully somewhat helpful... You also asked "what is ROS", to which my own typical answer is: A framework for Nodes to communicate with each other, that happens to have a lot of open source nodes available for common hardware.

(I write this with ROS1 in mind, having hardly touched ROS2)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: