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:
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.
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)
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:
- Either you code in arduino using ROS for Arduino (http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup).
- Or you can have the node in an external computer that communicates with the arduino board.