system :
- Used OS: Ubuntu 16.04 LTS - Xenial Xerus
- Used ROS: Kinetic Kame LTS
- Used programming language: Python 2.7
Current features:
- initialize info node
- get current end effector point and orientation
- control robotic arm using
- end point space + trajectory planning
- end point space + constrainted trajectory planning
- joint space
Git repo files:
- abblib - package (folder) for control
- example files
- abbTestFile.py - example for using info node
- abbCmd.py - example for control
Function jointsInfo creates new node named abb_jointListener and subscribes to the /joint_states topic to get the current joint angles. Angles displayed are in degrees. Node can be runned as a normal node or as anonymous node. If it's run as anonymous node then ROS will append a unique id at the end of the node name.
Usage:
def jointsInfo(printoutRate=0.5, anonym=False)
- printoutRate
- print rate to terminal in Hz (Refresh time)
- default: 0.5
- anonym
- do you want to run the node as anonymous node
- default: False
Example:
from abblib import abbCtrl
abbCtrl.jointsInfo(0.5,True)
Functions for arm control are implemented in abbRobot class. Object of the class abbRobot does not initialize new node so it should be initialized by the user.
Function getEEPoint returns a tuple in which first member is a list of cartesian coordinates and the second member is the list of quaternions in x,y,z,w convention.
Usage:
def getEEPoint(self, start_link='base_link',end_link="tool0")
- start_link
- default: base_link
- end_link
- default: tool0
Example:
from abblib import abbCtrl
import rospy as rp
rp.init_node('abbMove_Main')
robot=abbRobot()
print robot.getEEPoint()
Function move2Point moves the robot in end effector point space using MoveIt! package for trajectory planning. Because this function uses MoveIt! package, if the given point can not be reached it will print out "No solutions found. Execution not attempted."
Usage:
def move2Point(points, eAngles=[[0,0,0]], ax='sxyz', end_effector='link_6')
- points - list of lists that contain x,y,z coordinates in meters
- eAngles
- list of lists that contain alpha,beta and gamma values of euler angles in radians
- default: [[0,0,0]]
- if multiple points are passed and only one list of euler angles then those angles are going to be used for all points
- ax
- specify convention to use for euler angles
- default: 'sxyz'
- end_effector
- link whose point you want to move
- default: link_6
Aditional notes:
Convention for the parameter ax is specified with a 4 letter string. First letter describes what frame of reference should be. It can be 's'tatic or 'r'otating frame. Remaining characters define order of axis rotation.
Example - move end effector point to (1,0,1) then (1,1,1) then (1,-1,1) with euler angles (0,0,0). Because euler angles are all 0 for all points then eAngles parameter does not have to be passed in.
from abblib.abbCtrl import abbRobot
import rospy as rp
rp.init_node('abbMove_Main')
robot=abbRobot()
pts=[[1,0,1],[1,1,1],[1,-1,1]]
robot.move2Point(pts)
Function cartesian2Point moves the robot in end effector point space in a straight line using MoveIt! package for trajectory planning. Euler angles specify the direction of end effector in which it will be constrained. Trajectory planning can fail because of 2 reasons: generated path contains too much points (>100) or path found is incomplete. If generated path has too much points, consider increasing the resolution parameter. If path found is incomplete then end point is most probably out of range for the constraint.
Usage:
def cartesian2Point(self, points, eAngles, ax='sxyz',resolution=0.01, jumpStep=0,end_effector='link_6'):
- points
- list of lists that contain x,y,z coordinates
- eAngles
- list that contains a,b,g euler angles for constraint
- ax
- specify convention to use for euler angles
- default: 'sxyz'
- resolution
- maximum distance between 2 generated points
- default: 0.01
- jumpStep
- maximum jump distance between 2 generated points in joint space
- default: 0
- end_effector
- link whose point you want to move
- default: link_6
Aditional notes:
Parameter jumpStep describes highest possible movement in joint space. If joint value changes for a higher value than jumpStep then trajectory generated is truncated to a point just before the jump. If jumpStep is equal to 0 then jump detection is disabled.
Example - move end effector point to (1,0,1) then (1,1,1) then (1,-1,1) with euler angles (0,0,0). Move the end effector with default convention, resolution and jumpStep.
from abblib.abbCtrl import abbRobot
import rospy as rp
rp.init_node('abbMove_Main')
robot=abbRobot()
pts=[[1,0,1],[1,1,1],[1,-1,1]]
robot.cartesian2Point(pts,[0,0,0])
Function jointAction uses an ROS action to move robot in joint space. While moving, function will print out current desired angles in degrees. Care should be taken when using this function because angles could be out of reach. In that case, FlexPendant will throw an error and stop the RAPID program when joints are close to singularity while function will return message "Invalid joints".
Usage:
def jointAction(jointAngles)
- jointAngles
- list of lists that contain 6 angles in radians in order from joint_1 to joint_6
Example - move to joint values (0,0,0,0,0,0) then to (-pi,0,0,0,0,0) then to (0,pi,-pi,0,0,0)
from abblib.abbCtrl import abbRobot
import rospy as rp
from math import pi
rp.init_node('abbMove_Main')
robot=abbRobot()
angles=[[0,0,0,0,0,0],[-pi,0,0,0,0,0],[0,pi,-pi,0,0,0]]
robot.jointAction(angles)