Dear sir:
The annex is my kinematics modle which describes my machine. And I want to
compile it by th "comp" program. But the command failed to be found.
yang...@yangdan-desktop:~$ sudo comp --install /emc2/src/emc/kinematics/sixpkm.c
[sudo] password for yangdan:
sudo: comp: command not found
Thanks for your help.
Regards!
yang
/********************************************************************
* Description: trivkins.c
* Trivial kinematics for 3 axis Cartesian machine
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*
* Copyright (c) 2004 All rights reserved.
*
* Last change:
********************************************************************/
#include "kinematics.h" /* these decls */
int kinematicsForward(const double *joints,
EmcPose * pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
pos->tran.x = joints[0];
pos->tran.y = joints[1];
pos->tran.z = joints[2];
pos->a = joints[3];
pos->b = joints[4];
pos->c = joints[5];
pos->u = joints[6];
pos->v = joints[7];
pos->w = joints[8];
return 0;
}
int kinematicsInverse(const EmcPose * pos,
double *joints,
const KINEMATICS_INVERSE_FLAGS * iflags,
KINEMATICS_FORWARD_FLAGS * fflags)
{
double a[33];
a[1]=1/2*cos(pos->b)*cos(pos->c)*120*sqrt(3);
a[2]=1/2*cos(pos->b)*sin(pos->c)*120;
a[3]=1/2*(sin(pos->a)*sin(pos->b)*cos(pos->c)+cos(pos->a)*sin(pos->c))*120*sqrt(3);
a[4]=1/2*(-sin(pos->a)*sin(pos->b)*sin(pos->c)+cos(pos->a)*cos(pos->c))*120;
a[5]=1/2*(-cos(pos->a)*sin(pos->b)*cos(pos->c)+sin(pos->a)*sin(pos->c))*120*sqrt(3);
a[6]=1/2*(cos(pos->a)*sin(pos->b)*sin(pos->c)+sin(pos->a)*cos(pos->c))*120;
a[7]=sin(pos->b);
a[8]=sin(pos->a)*cos(pos->b);
a[9]=cos(pos->a)*cos(pos->b);
a[10]=1/2*sqrt(3)*602.7-a[1]-a[2]+a[7]*5-pos->tran.x;
a[11]=-602.7*1/2-a[3]+a[4]-a[8]*5-pos->tran.y;
a[12]=-a[5]+a[6]+a[9]*5-pos->tran.z;
a[13]=sqrt(a[10]*a[10]+a[11]*a[11]+a[12]*a[12]);
joints[0]=a[13];
a[14]=2*a[2]-a[7]*(-5-40)-pos-tran.x;
a[15]=607.2-2*a[4]+a[8]*(-5-40)-pos-tran.y;
a[16]=-2*a[6]-a[9]*(-5-40)-pos->tran.z;
a[17]=sqrt(a[14]*a[14]+a[15]*a[15]+a[16]*a[16]);
joints(1)=a[17];
a[18]=-1/2*sqrt(3)*602.7+a[1]-a[2]-a[7]*(-5-2*40)-pos->tran.x;
a[19]=-1/2*602.7+1/2*a[3]+a[4]+a[8]*(-5-2*40)-pos->tran.y;
a[20]=a[5]+a[6]-a[9]*(-5-2*40)-pos->tran.z;
a[21]=sqrt(a[18]*a[18]+a[19]*a[19]+a[20]*a[20]);
joints(2)=a[21];
a[22]=-1/2*752.7*sqrt(3)+a[1]+a[2]-a[7]*(-130-3*40-5)-pos->tran.x;
a[23]=1/2*752.7+a[3]-a[4]+a[8]*(-130-3*40-5-pos->tran.y;
a[24]=-153.5+a[5]-a[6]-a[9]*(-130-3*40-5)-pos->tran.z;
a[25]=sqrt(a[22]*a[22]+a[23]*a[23]+a[24]*a[24]);
joints(3)=a[25];
a[26]=-2*a[2]-a[7]*(-130-4*40-5)-pos->tran.x;
a[27]=-752.7+2*a[4]+a[8]*(-130-4*40-5)-pos->tran.y;
a[28]=-153.5+2*a[6]-a[9]*(-130-4*40-5)-pos->tran.z;
a[29]=sqrt(a[26]*a[26]+a[27]*a[27]+a[28]*a[28]);
joints(4)=a[29];
a[30]=1/2*752.7*sqrt(3)-a[1]+a[2]-a[7]*(-130-5*40-5)-pos->tran.x;
a[31]=1/2*752.7-a[3]-a[4]+a[8]*(-130-5*40-5)-pos->tran.y;
a[32]=-153.5-a[5]-a[6]-a[9]*(-130-5*40-5)-pos->tran.z;
a[33]=sqrt(a[30]*a[30]+a[31]*a[31]+a[32]*a[32]);
jionts(5)=a[33];
return 0;
}
/* implemented for these kinematics as giving joints preference */
int kinematicsHome(EmcPose * world,
double *joint,
KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
*fflags = 0;
*iflags = 0;
return kinematicsForward(joint, world, fflags, iflags);
}
KINEMATICS_TYPE kinematicsType()
{
return KINEMATICS_IDENTITY;
}
#ifdef RTAPI
#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h"
EXPORT_SYMBOL(kinematicsType);
EXPORT_SYMBOL(kinematicsForward);
EXPORT_SYMBOL(kinematicsInverse);
MODULE_LICENSE("GPL");
int comp_id;
int rtapi_app_main(void) {
comp_id = hal_init("trivkins");
if(comp_id > 0) {
hal_ready(comp_id);
return 0;
}
return comp_id;
}
void rtapi_app_exit(void) { hal_exit(comp_id); }
#endif
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users