Robotics Lab Project: Submitted To: Engr. Shehbaz Khan Group Members
Robotics Lab Project: Submitted To: Engr. Shehbaz Khan Group Members
Robotics Lab Project: Submitted To: Engr. Shehbaz Khan Group Members
1
Contents
Outline............................................................................................................................................. 4
Introduction .................................................................................................................................... 4
Problem Statement: ........................................................................................................................ 4
Problem Solution: ........................................................................................................................... 4
The Robot: ....................................................................................................................................... 4
Braccio Robotic Arm: .................................................................................................................. 5
Our Robotic Arm: ........................................................................................................................ 5
Requirements:................................................................................................................................. 6
Hardware: ................................................................................................................................... 6
Software: ..................................................................................................................................... 6
Methodology:.................................................................................................................................. 6
1) Construct a Hardware Arm .................................................................................................. 6
2) Test the Arm with Arduino .................................................................................................. 6
3) Configure ROS with Arduino ................................................................................................ 6
4) Perform the Robotic Manipulation with ROS ...................................................................... 7
Forward Kinematics of the Braccio Robotic Arm: ........................................................................... 7
Developing the DH Table: ........................................................................................................... 7
Step 0: Number of Joints......................................................................................................... 7
Step 1: Assigning coordinate frame 0 to the robot base. ....................................................... 7
Step 2: Align zi with the axis of joint i+1. ................................................................................ 8
Step 3: Locate the origin oi at the intersection of zi and zi-1 ................................................... 8
Step 4: Assigning the x coordinates ........................................................................................ 9
Step 5: Assigning the y coordinate ....................................................................................... 10
Step 6: Set origin on at the tool tip ........................................................................................ 10
Step 7: Finding the bi............................................................................................................. 10
Step 8: di = distance from origin oi-1 to bi measured along zi-1 ............................................. 11
Step 9: ai-1 = distance from bi to oi measured along xi .......................................................... 11
Step 10: θi = angle of rotation from xi-1 to xi measured along zi-1 ......................................... 11
Step 11: αi = angle of rotation from zi-1 to zi measured along xi............................................ 12
DH Table: ............................................................................................................................... 12
2
Finding Forward Kinematics: .................................................................................................... 12
Matlab Simulation:........................................................................................................................ 14
Conclusion ..................................................................................................................................... 15
Appendix: ...................................................................................................................................... 15
Matlab program used: .............................................................................................................. 15
Arduino Program used: ............................................................................................................. 15
References .................................................................................................................................... 17
3
Robotic Arm Manipulation via ROS
Outline
In this project we will use ROS (Robotic Operating System) to communicate with an Arduino
board to manipulate a simple 6-DOF robotic arm to simulate a simple pick and drop operation.
Introduction
This project focuses on basic use of ROS and how to interface it with other (Prototyping
and Industrial) standards PLCs and Automation Modules.
In this specific attempt, we will learn how to interface it with an Arduino Board for
prototyping and performing basic operations.
By doing so we will learn the applications of robotics and automation in practical life.
Problem Statement:
Robot arms are ideal for operations, in the places which needs maximum accuracy, efficiency
and nonstop operation, human operation can possibly cause errors and the production, or the
stage of production is limited by the work load and speed of human operator, and all the above
mentioned facts.
Problem Solution:
Robotic ARM! Robotic arms can be programmed or taught to operate in a sequence nonstop
and with max efficiency without any possible error (keeping the Conditions and requirements
optimum for the system’s functionality). It can decrease time required to do an operation and
increase the amount of work done and set of operations per unit time. Hence eliminating
human error and speeding up the work.
The Robot:
The robot used in this project is a Braccio Robotic Arm. Now the mathematics and the ROS
manipulation is done based on the parameters of an actual Braccio robotic arm. However for
the hardware a similar attempt of a DIY Braccio Arm is used.
4
Braccio Robotic Arm:
The TinkerKit Braccio is a fully operational robotic arm, controlled via Arduino. It can be
assembled in several ways for multiple tasks such as moving objects. You can also attach a
camera or solar panel. There are so many ways in which the Braccio can extend the reach of
your devices. [1]
5
Requirements:
Hardware:
3x MG996R 180◦ Servos
3x TowerPro MG90S 180◦ Servos
1x Arduino Nano Board
Connecting wires
Batteries
Servo Brackets
Software:
Arduino IDE
ROS containing system
MoveIt
Rviz
Matlab
Methodology:
1) Construct a Hardware Arm
The hardware consists of cardboard box, on which the base servo is mounted and all the rest of
the servos are attached to the base servo using Servo Brackets. The electronics are soldered on
a perfboard and the circuit is placed inside the box. An external power supply is used to power
the 7V servos, while 5V servos are using Arduino Nano’s 5V pin.
6
4) Perform the Robotic Manipulation with ROS
For the ROS manipulation, first of all a repository containing the package for the Braccio robot
[3] needs to be cloned, after doing that the catkin workspace needs to be built. Next a
respective code for the robot needs to be uploaded on the Arduino connected and then the
ROS process needs to be initiated. If done correctly, the parse and publisher from the Rviz
program would allow the Arduino to successfully be controlled by the ROS program and the
robot would be manipulated accordingly.
7
Figure 4 Step 1: the 0th frame
Figure 5 Assigning z
8
Figure 6 Assigned the Origin
9
Step 5: Assigning the y coordinate
In the below figure are the yi and yi+1 coordinates
10
Step 8: di = distance from origin oi-1 to bi measured along zi-1
A general measurement of the link length of the robot is used, the result is:
d1 = 0
d2 = 0
d3 = d3
d4 = d4
d5 = 0
d6 = 0
11
Step 11: αi = angle of rotation from zi-1 to zi measured along xi
Again using standardized parameters the result is:
α0 = 0
α1 = -90◦
α2 = 0
α3 = -90◦
α4 = 90◦
α5 = -90◦
DH Table:
Now with all the steps completed, we finally obtain the DH table as:
13
Matlab Simulation:
After now having all the calculations done, the Matlab simulation part can take place, this
allows to verify the result and output a plotted instant of the robot with respect to the
information given.
Matlab however does require all the variables to be defined, therefore the link lengths would
be given as:
L1 = 0.1
L2 = 0.4
L3 = 0.1
L4 = 0.3
With these input parameters given, the program can be ran.
Running the program outputs the following DH table:
Which is synonymous to the DH table calculated earlier, and then the following robot instant
would be plotted as an output:
14
Conclusion
This project was about controlling a 6DoF robot via ROS, this was achieved by assuming a Robot
first, which was chosen to be a Braccio Robotic Arm, then a physical replica was constructed of
it. Afterwards the packages required for this project were obtained and then ran, which had a
final result of the robot being able to be manipulated via ROS. Afterwards the Forward
Kinematics of the robot were calculated manually and via Matlab.
Appendix:
Matlab program used:
startup_rvc
clc
clear all
L1 = 0.1; L2= 0.4; L3 = 0.1; L4 = 0.3;
L(1) = Link([0, 0, 0, 0, 0])
L(2) = Link([0, 0, 0, -pi/2, 0])
L(3) = Link([0, L1, L2, 0, 0])
L(4) = Link([0, L3, L4, -pi/2, 0])
L(5) = Link([0, 0, 0, pi/2, 0])
L(6) = Link([0, 0, 0, -pi/2, 0])
Rob = SerialLink(L)
Rob.name = 'Braccio'
Rob.plot([0,pi/2,0,pi/2,0,0])
#include <Servo.h>
#include <ros.h>
#include <std_msgs/UInt16.h>
#include <sensor_msgs/JointState.h>
ros::NodeHandle nh;
Servo roll;
Servo crap;
Servo gripper;
Servo wrist;
Servo elbow;
Servo shoulder2;
Servo base;
double base_angle=0;
double shoulder_angle=0;
double elbow_angle=0;
double wrist_angle= 0;
15
double gripper_angle=0;
double roll_angle=0;
double roll_angle2=0;
base.write(base_angle);
shoulder2.write(shoulder_angle);
elbow.write(elbow_angle);
wrist.write(wrist_angle);
gripper.write(gripper_angle);
roll.write(roll_angle2);
void setup(){
nh.getHardware()->setBaud(115200);
nh.initNode();
nh.subscribe(sub);
base.attach(2); //base_joint
elbow.attach(8); //elbow_joint
wrist.attach(6); //wrist_pitch_joint
roll.attach(5);//6 //wrist_roll
shoulder2.attach(9); //shoulder_joint
gripper.attach(11); //gripper_joint
delay(1);
base.write(0);
shoulder2.write(0);
elbow.write(0);
wrist.write(0);
gripper.write(0);
roll.write(0);
}
void loop(){
nh.spinOnce();
}
16
}
References
17