Can someo0ne post Chapter 27 example code.

More
12 May 2009 17:13 #245 by nikodell
I am trying to figure this out but it would be helpful to see the code "formatted to compile"for the explained example, I have tried to create this code and it fails.
It would help me to understand the chapter and how this actually works.

Please Log in or Create an account to join the conversation.

More
12 May 2009 17:44 #246 by BigJohnT
I would have to guess which manual you are speaking about as EMC has at least 5 manuals for different subjects. I just looked in the Integrators Manual but chapter 27 in that manual doesn't seem to fit your question.

Can you be a bit more specific?

Also note that the manuals are constantly being upgraded so if your looking at the installed manuals for 2.2.x the chapters might not be the same for 2.3.x. As always the most current manuals are on line. The HTML manuals are easily linked for questions and are broken up into individual subjects.


John

Please Log in or Create an account to join the conversation.

More
12 May 2009 17:54 - 13 May 2009 14:15 #247 by nikodell
www.linuxcnc.org/docs/html/motion_kinematics.html

Ok this is what I was going to try next, guessing though. I was just working on getting the development packages to rebuild EMC2 with this new suport. Again I am only guessing this may work.

/********************************************************************
* Description: bipodkins.c
* Bipod kinematics
*
* 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 */
#include "posemath.h"
#include "hal.h"
#include "rtapi_math.h"

int kinematicsForward(const double *joint,
EmcPose *world, const KINEMATICS_FORWARD_FLAGS *fflags, KINEMATICS_INVERSE_FLAGS *iflags)


{
double AD2 = joints[0] * joints[0];
double BD2 = joints[1] * joints[1];
double x = (AD2 - BD2 + Bx * Bx) / (2 * Bx);
double y2 = AD2 - x * x;
if(y2 < 0) return -1;
pos->tran.x = x;
pos->tran.y = sqrt(y2);


return 0;
}

int kinematicsInverse(const EmcPose * world,
double *joints,
const KINEMATICS_INVERSE_FLAGS *iflags,
KINEMATICS_FORWARD_FLAGS *fflags)


{
double x2 = pos->tran.x * pos->tran.x;
double y2 = pos->tran.y * pos->tran.y;
joints[0] = sqrt(x2 + y2);
joints[1] = sqrt((Bx - pos->tran.x)*(Bx - pos->tran.x) + y2);

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(void)
{
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("bipodkins");
if(comp_id > 0) {
hal_ready(comp_id);
return 0;
}
return comp_id;
}

void rtapi_app_exit(void) { hal_exit(comp_id); }
#endif
Last edit: 13 May 2009 14:15 by nikodell.

Please Log in or Create an account to join the conversation.

More
12 May 2009 18:26 #248 by nikodell
Ok now it wants modbus but I can't seem to find the file it wants?

checking for glib... configure: error: no -- required until somebody makes modbus optional

Please Log in or Create an account to join the conversation.

More
12 May 2009 18:30 #249 by BigJohnT
Why don't you pop over to the IRC channel #emc so you can ask in real time.

www.linuxcnc.org/component/option,com_mo...rc/Itemid,8/lang,en/

John

Please Log in or Create an account to join the conversation.

More
12 May 2009 21:29 #250 by alex_joni
nikodell wrote:

Ok now it wants modbus but I can't seem to find the file it wants?

checking for glib... configure: error: no -- required until somebody makes modbus optional


It doesn't want modbus, it wants glib

Regards,
Alex

Please Log in or Create an account to join the conversation.

More
12 May 2009 21:41 #251 by nikodell
Yha I figured that out after googleing it. I am able to get a good build, now I just need to get motivated to look at what I was trying to figure out in the first place.

Thanks i will be back! There are more walls.

Please Log in or Create an account to join the conversation.

More
13 May 2009 21:49 #255 by step4linux
nikodell, did you install emc2-dev , following this instruction ?
It would be easier to help you, if you tell us what exactly are you doing.

Gerd

Please Log in or Create an account to join the conversation.

More
14 May 2009 17:25 #266 by nikodell
Yes I just have no clue to what is needed and why in the .c file. is there some other documentation?

Please Log in or Create an account to join the conversation.

More
16 May 2009 07:12 #273 by step4linux
I do not know of any other documentation, other than the Integrator Manual and the wiki pages.
Most important things are pretty much explained in the Integrator Manual.
You can find lots of examples of kinematics in the source code of EMC2.
I suggest, take one example, which is closest to what you want to do.
Rename it and install it without any other changes (using comp tool).

From here you can go forward to your own kinematics.

regards

Gerd

Please Log in or Create an account to join the conversation.

Time to create page: 0.277 seconds
Powered by Kunena Forum