0
$\begingroup$

Rosanswers logo

Hello.

I have worked ROS and Gazebo for many days. I am confused about how to use ros with any new custom made robot ? Suppose a robot has a hardware of arduino or raspberry pi ..How to run that robot using my ROS language , like publishing to /cmd_vel topic etc?


Originally posted by sezan92 on ROS Answers with karma: 76 on 2017-09-02

Post score: 1


Original comments

Comment by jayess on 2017-09-02:
This is a very broad question. Can you narrow it down a bit? Also, have you gone through the tutorials?

Comment by sezan92 on 2017-09-04:
I have gone through the tutorials .. I can work on ROS + Gazebo .. But I haven't implemented ROS in my Real life robot yet

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

When you have a new robot, you will need to ROSify that robot. What does it mean? You will have to build a series of nodes (among other things) that make the translation between your hardware and the ROS core.

Some basic steps to start:

  1. You should write the URDF of your robot that describes the different links in your robot, joints and sensors, and different frames that it has. You will need that in order to represent your robot in Rviz, show the robot current status and be able to compute sensor data from different frames. If you don't know how to do the URDF of your robot, you can check this tutorial.

  2. Next thing is to write some nodes to read the sensor data and publish it in ROS topics. This means that you have to write a node that communicates with the hardware (arduino, raspberry, pc, whatever...) and requests to it the sensor data, receives the data, and converts that data from the hardware format to a topic message. You can find already existing types of messages here, but depending on your sensors, you may need to create a new type of message (this tutorial shows how to create a new message for a topic)

  3. Finally, you may need to write the controllers for your robot joints, wheels or any other actuator the robot has. Those nodes should provide topics or services which when some other node calls them, they should convert the command sent into the appropriate commands for the hardware you are using, so they make the robot move/actuate. Here there is a tutorial about ROS control that may help you on this.

You can see an example of ROSification in the nodes created by Melonee Wise for ROSifying the Sphero robot. The code is here. It contains everything open source so you can see how that ROSification may apply to your specific case.

ROSifying a robot is quite a job, but once you have it done, your robot will move in the ROS realm with all its advantages attached. So go for it! You will learn a lot in the process.


Originally posted by R. Tellez with karma: 874 on 2017-09-04

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by sezan92 on 2017-09-04:
thanks for the answer .. In gazebo simulation. we need implement plugins to make the robot work on sensors or controllers .. like differential drive plugins for cmd_vel topic, imu sensor plugins for imu sensors.. In the real world like working with ROS arduino , we need to code in arduino ourselves?

Comment by sezan92 on 2017-09-04:
which code of sphero ros is showing the Rosification part ?

Comment by MarkyMark2012 on 2017-09-04:
Nice answer - personally I would put 2 then 3 as the first tasks to tackle then 1 as a "nice to have" :)

Comment by R. Tellez on 2017-10-03:
Sezan92, in the real world you have two options:

  1. Either you code in arduino using ROS for Arduino (http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup).
  2. Or you can have the node in an external computer that communicates with the arduino board.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.