Print Kinematics Parameters in LinuxCNC Simulation

More
18 Aug 2015 07:54 #61500 by jstoquica
Hi,

Recently I finished the simulation assembly of the IRB6 manipulator in vismach, and then I tried to test the properly kinematic, but the performance of the simulation is not good. I need to analyse the results of the kinematic parameters file.

How can I generate a log file with the kinematics variables in the simulation? Is It possible in linuxCNC? Or What other way do you recommend to me?

Regards.

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

More
20 Aug 2015 17:57 #61576 by andypugh
If the numbers you need appear on HAL pins then you can log them with halsampler, or possibly with halscope.
The following user(s) said Thank You: jstoquica

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

More
22 Aug 2015 04:53 - 22 Aug 2015 04:55 #61635 by jstoquica
Thanks for the reply,

I want to know the values of the kinematics variables, like angles values (theta) when I type G commands. For to check the real computations of kinematics functions in the *.c file. Is It possible in the functions like kinematicsForward or kinematicsInverse?

If it's possible, how can I do that?

else, how can I check them?

Regards.
Last edit: 22 Aug 2015 04:55 by jstoquica.

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

More
09 Sep 2015 06:08 #62291 by jstoquica
Hi,

I hope you can help me with. Can I use something like that for generate the results of the kinematics variables?:
#include <stdio.h>

int main(void)
{
	char log[]="LogIRB.txt";
	FILE *arq;
	
	arq = fopen(log, "a");
	if(arq == NULL)
			printf("Erro, nao foi possivel abrir o arquivo\n");
	else{
		
		fprintf(arq, "X= %.2f\n", variavelX );
		
	}
	fclose(arq);
	
	return 0;
}

Regards.

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

More
09 Sep 2015 06:16 - 09 Sep 2015 06:17 #62292 by andypugh
You can't access files from kernel modules, and kinematics routines are real-time kernel modules.

All you can do it print to the kernel log (i.e., dmesg). This is a Linux limitation, not a LinuxCNC one.

hal_sampler and sampler together circumvent this via a shared-memory buffer.

[Edit]

You might be able to print to file from a sim or uspace config, but not an RTAI config
Last edit: 09 Sep 2015 06:17 by andypugh.

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

More
23 Nov 2015 18:41 #65710 by jstoquica
Hi everyone,

In "genserkins.c" file the main () function has some printf() or fprintf() functions like:
fprintf(stderr, "bad value: %s\n", argv[2]);

printf("initial estimate for Cartesian position, xyzrpw: ");

printf("calculation time: %f secs\n", (end - start));

How can I verify those log results when run a simulation? and/or how can I generate o text file with sim config without RTAI config?.

Thanks.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum