Background and Initial Setup.

  1. Creating URDF files for robots…
credits (google Images search)

Robots are just bunch of joints, couple of sensors thrown together in a systematic and well designed manner, designing a robot is a major task for robotic simulations as your design tells a lot about the jobs robot is going to perform. In this series we will use a 6-DOF robotic arm to perform our simulation.

6-DOF Robot

In this simulation we will be using this robot i have created it and uploaded to

Now let’s talk about some of the available robotic simulators some big names in this field are ROS (Robot Operating System), Gazebo, CoppeliaSim, Webots and obviously keep going . . . . 😀 😆. The big daddy of this field is ROS which provides all the functioning you need from validating your idea to real-time working controllers and all other good stuff but these much functionality comes with a price of complexity (as i feel while using ROS) another rising name is CoppeliaSim which is a great piece of software and a great tool for validating your ideas to controlling them in real-time, but again what i feel problematic in CoppeliaSim is its documentation for Python Api as it is designed to use with Lua programming language. So after getting exhausted by looking a good alternative of all these and trying and failing for long i finally make up my mind to use Bullet physics engine to simulate my robots and believe me its work very well and i thought of helping all other robot enthusiast out here with what i learned………

First Step :- To create 3D models of parts of your robots.

This is the easiest part for all Mechanical Engineers (kuddoosss… 😍) and hobbyists who have a good experience in designing 3D parts, i am putting an YouTube playlist which are great if you are beginner in field of designing 3D parts.

https://www.youtube.com/playlist?list=PLrZ2zKOtC_-DR2ZkMaK3YthYLErPxCnT-

personally i use FreeCad for designing but for beginners Fusion 360 is a good point to start as you can get 1 year free license as a student.

Second Step :- To create URDF file.

URDF file creation is very simple just you have to define what is where and how is it.

<link name="base_link">
<inertial>
<origin rpy="0 0 0" xyz="-5.336640178419851e-14 -8.338500278781017e-17 0.2443634195323267"/>
<mass value="2412.4922874782374"/>
<inertia ixx="388.738882" ixy="-0.0" ixz="-0.0" iyy="388.738882" iyz="0.0" izz="665.868438"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://Complete_ARM_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://Complete_ARM_description/meshes/base_link.stl" scale="0.001 0.001 0.001"/>
</geometry>
</collision>
</link>
<joint name="Rev1" type="continuous">
<origin rpy="0 0 0" xyz="0.0 0.0 0.6"/>
<parent link="base_link"/>
<child link="ARM_1_1"/>
<axis xyz="-0.0 0.0 1.0"/>
</joint>

above snippet is for a single link, i will explain the complete procedure for writing urdf file:-

  1. Open a text editor and create a new file with extension .urdf and we will write line of codes in this file, if you know XML then writing this is a piece of cake for you otherwise just follow along you will able to write your own urdf file after reading this.
  2. I will use ## for explaining each line in below code snippet in XML<!…> is used for commenting but for sake of simplicity i will use ## for comment.
## define body(link) and its name, all properties of body will be  ## children of this link<link name="base_link">## Inertial Properties of the solid body
## Origin of body xyz Cartesian co-ordinates and rpy are roll, pitch ## and yaw
## Mass of the body
## 3x3 rotational inertial matrix values as the matrix is symmetric ## no need to write same values again
## ixx ixy ixz
## ixy iyy iyz
## ixz iyz izz
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.0"/>
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
</inertial>
## Visual properties of solid body
## Origin of body xyz Cartesian co-ordinates and rpy are roll, pitch ## and yaw
## In geometry child put path to .obj file of your model
## material name ="silver" is just a material name and color which ## is already defined in a separate file materials.xacro see GitHub
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="path_to .obj file" scale="0.0 0.0 0.0"/>
</geometry>
<material name="silver"/>
</visual>
## Collision properties of body
## Origin of body xyz Cartesian co-ordinates and rpy are roll, pitch ## and yaw
## In geometry child put path to .stl file of your model dont swap ## files in visual and collision properties otherwise we will get ## error in solving for inverse kinematics.
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="path_to .stl file" scale="0.0 0.0 0.0"/>
</geometry>
</collision>
</link>

The files which i have uploaded on GitHub are only for forward kinematics as further in time when we will reach inverse kinematics calculations i will upload the appropriate urdf file. Now we will discuss about joining two bodies (links).

## Joints in URDF files are of 6 types
## .Revolute - Similar to Hinge Joint have limits
## .Continuous - Revolute around an axis no limits, ex:- wheels
## .Prismatic - sliding joint or linear in only 1 axis
## .Fixed - Fixed no DOF
## .Floating - Joint have all 6 DOF
## .Planar - linear joint in multi axis
## Origin of joint xyz Cartesian co-ordinates and rpy are roll, ## pitch and yaw
## Parent and child link are just clear by names
## axis - axis of rotation for revolute and continous, axis of ## movement for prismatic and planar
<joint name="Rev1" type="continuous">
<origin rpy="0 0 0" xyz="0.0 0.0 0.6"/>
<parent link="base_link"/>
<child link="ARM_1_1"/>
<axis xyz="-0.0 0.0 1.0"/>
</joint>

There are more children's to joint like calibration, dynamics, limit, safety_controller, we will be looking on these children's in future as we proceed with this publication. That’s it for this story next story will be about setting up our coding environment, installing packages, and our first Robotics Simulation from scratch… 😃😃😃😃

Until then GOOD BYE AND KEEP LEARNING HOW OUR BRAIN LEARNS 😅

--

--