i'm a senior, i really desperate to find answers here. i am building a robotic arm with bunch of low-cost sensors , motors and other actuators. i'm using PI 3 as my Microcontroller.

I need helping to build the software by giving answers to my questions:

  1. Is it efficient to us ROS with low-cost projects? if not what are my other alternatives?
  2. also is it possible to use another microcontrollers (Arduino's or PI's) in between so everyone of them can deal with a specific collection of sensors and actuators ?
  3. is it possible to control stepper motors through Arduino/PI using ROS?

This would be the easiest way to describe my project:

Master (PI 3) ---> Receiving results from 4 microcontrollers ---> each one controls a joint (encoders, sensors, steppermotors)

I'm open to suggestions from any kind i'm still in the start i have 4-6 months period to finish it, i don't know if i'm asking in the right place or not but i don't know much about blogs.


Here are my responses to your questions:

  1. In brief, using ROS does not depend on the project cost, rather the scale of the project. It would help you tremendously in the following cases:

    • Modular Application: Robotic applications might need various features. For eg (in your case): Sensor input (Grab data from the sensors, process it and make it available to other modules). Frame Conversion (Convert sensor reading to angles and estimate transforms for arm state estimation). Controls (Command the actuators to achieve specific arm state). Calibration (Making sense of arm sensor data).
      Thus, as you develop each of the above features one after the other, you can simply keep creating individual ROS nodes/packages for each feature. They will be run independently with ROS managing communications between the nodes.

    • Communication: Simple example: Suppose you fix a camera on your arm. Only one application can read the camera driver to grab the images. Thus, if you need multiple applications to work with the images, you will need to create a way to make the image available through inter-process communication. In ROS, you have the scalability to simply publish the image in a topic and all others application that needs it will subscribe.

    • Community Support: ROS has a wide community that has developed many tools that might be useful. For eg: Rviz is a great tool that you can use to visualize your arm and its environment. You may use moveit, a well developed opensource ROS package to control your arm actuators.

    • Gazebo Simulation: While Gazebo and ROS are independent. They go very well together. You can develop a model of your arm in Gazebo and develop your arm features in simulation (Quicker hardware iterations and software development). Your ROS application would only deal with the ROS topics, thus, it need not know whether it is working with the simulated arm or the physical arm. (Example)

  2. Yes, it can be done. ROS comes to rescue again. Treat a central PI as ROS master, connect all other PIs to the same network over Wi-Fi/Ethernet and all PIs will be able to share ROS topics among themselves. Follow this wiki on ROS to know how ROS can be setup in a network between multiple machines. You can connect the arduinos to PIs using USB and use rosserial package to output arduino sensor data as ROS topics (Tutorial).

  3. Yes, low-level hardware commands can be generated both by PI (IO pins) and Arduino. However, it would be more convenient to use Arduino. Connect stepper motor ---wire----> Arduino ---usb---> PI. Use rosserial as mentioned in (2) above.

I would suggest using a more powerful central computer than PI 3. Odroid XU4 is a good option. PI 3 takes a lot of time in compiling ROS applications in C++ thus slowing down the development process. One way to circumvent this issue is to use interpreted language like python rather than C++. ROS has support for both python and C++.

You can follow moveit ROS package to learn more about controlling Robot arm using ROS.

Hope it helps.

  • $\begingroup$ this was really useful thanks alot for the info, it really helped. i will start soon following the steps you gave me hope it go as planned, thanks again mate @quartzfun . $\endgroup$ – Mohannad Maged El Tarzy Dec 20 '17 at 14:25

You may be intrested to know that there is already an Arduino library for ROS. It is called rosserial_arduino,

The Arduino and Arduino IDE are great tools for quickly and easily programming hardware. Using the rosserial_arduino package, you can use ROS directly with the Arduino IDE. rosserial provides a ROS communication protocol that works over your Arduino's UART. It allows your Arduino to be a full fledged ROS node which can directly publish and subscribe to ROS messages, publish TF transforms, and get the ROS system time. http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.