Trouble Using halcompile for compiling custom kinematics

More
05 Feb 2022 08:05 #234012 by drose
New to LinuxCNC (and C) and working on a modified scara-type robot. To accomodate the modifications I copied and edited the scarakins.c file and made a few minor modifications to test things out but I'm having trouble getting it to compile properly with halcompile. From reading the forums and halcompile section of the manual it seems like all I need to do is run:

sudo halcompile --install mykins.c

And it should compile the file outside of the source tree. Despite this the compiler keeps running into referencing errors like this:

Error:
pi@linuxcnc:~/linuxcnc/kinematics $ sudo halcompile --compile scarakins.c
Compiling realtime scarakins.c
In file included from /home/pi/linuxcnc/kinematics/switchkins.h:7,
                 from scarakins.c:24:
/home/pi/linuxcnc/kinematics/kinematics.h:192:31: error: unknown type name ‘kparms’
                               kparms*     ksetup_parms);
                               ^~~~~~
This makes it seem like the halcompile command can not actually compile the file outside of the source tree. Do I need to compile all the src files or am I doing something wrong with halcompile?

Note that this seems to happen with any kinematics file I try to compile using halcompile.

Attempted Resolve Steps:
- tried using a different kinematics file I know is good (tried re-compiling trivkins for example).
- tried adding the header file it asked for into the local directory

System Info: 
Raspberry pi4b 4gb
Linux linuxcnc 4.19.71-rt24-v7l+ #1 SMP PREEMPT RT Fri Jan 1 21:15:16 GMT 2021 armv7l GNU/Linux

Installed halcompile using command:
sudo apt-get -install linuxcnc-uspace-dev
 

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

More
05 Feb 2022 10:05 - 05 Feb 2022 10:06 #234016 by Aciera
Despite to what the documentation says, I've never had much luck trying to compile a classic kinematics.c file with 'halcompile'. So either use 'make' as when doing a RIP install or use the currently (version 2.8 and higher) recommended method and use the userkins.comp template file to create custom kinematics.

Have a look at the /sim/axis/vismach/millturn simulation config for an application of 'userkins.comp' template with switchable kinematics. 'millturn.comp' can be found at /src/hal/components
Last edit: 05 Feb 2022 10:06 by Aciera.
The following user(s) said Thank You: drose

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

Time to create page: 0.092 seconds
Powered by Kunena Forum