Skip to content

Throwing a ball with KUKA LWR 4+ to a specific location. The code is originally written by Dr. Seungsu Kim.

License

Notifications You must be signed in to change notification settings

SinaMirrazavi/Throwing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Throwing

The code is straightforward if you know RobotToolkit and Seungsu! Here I will explain kukafastthrowing as randomthrowing do not work. The target position can be the position of an object streamed to the code, the name of the "obj_root" and defined in line 25, object is or it can be hard coded, see lines 505 as follow:

    	lTargetPos(0) = -3.4;
    	lTargetPos(1) = -1.200;
    	lTargetPos(2) =  0.0;

To estimate the throwing position and the velocity the following algorithm is implemented:

  1. The robot moves to the neighborhood of the predefined throwing position, cThrow.
  2. The velocity perpendicular to the end-effector position is calculated.
  3. The position of the first joint is modified such that the direction of the velocity will be aligned with the line passes though the target position and the the throwing position.
  4. The throwing velocity is calculated by trial and error. The concept is easy: the throwing scenario is simulated and then the error at the target position is calculated. The error is used to modify the throwing velocity; see the following lines:
for(int i=0; i<50; i++){
		lKp  *= (1.0 -(lError(0)*0.01));
		lKp  *= (1.0 +(lError(2)*0.01));

		mBallistic->SetPosVel(lPos.Array(), (lVel*lKp).Array());
		lDuration = mBallistic->CalSmallestError(targetPos, lError);

		if( lError.Norm() < 0.001) break;
		cout << "error : " << lError(0) << " " << lError(1) << " " << lError(2) << ", kp " <<  lKp << endl;
	}
  1. The ready configuration is calculated:
 mJointReady = mJointThrow - (lJointsVel*_dt*70.0);
  1. CDdymic is used to move the robot to the ready position.
  2. Third order polynomial motion is used to move the robot from the ready position to the throwing position with the desired velocity.

How to run the code:

In short:

  1. job
  2. throw

If you think the calculated throwing velocity or direction needs some modification, use setym ( modification to the direction) ( modification to the velocity)

About

Throwing a ball with KUKA LWR 4+ to a specific location. The code is originally written by Dr. Seungsu Kim.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages