- Posts: 144
- Thank you received: 9
TCP 5-axis kinematics
- jsskangas
- Offline
- Premium Member
-
Less
More
8 years 10 months ago #102864
by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
I need quick help.
Im trying to write out values from kinematics trough HAL pins:
this is located in" rtapi_app_main"
if((answer = hal_pin_float_new("xyzbc-trt-kins.oma",
HAL_OUT, &(haldata->oma), comp_id)) < 0) goto error;
this is in code:
*(haldata->oma) = 11.11;
when looking/watching from HAL configuration in linuxcnc only shows 0.0
it's compiled and im using this file.. and it does not give error when compiling.
Also I tried HAL_IO, HAL_IN no difference.
How can I write values to HAL pins????
Im trying to write out values from kinematics trough HAL pins:
this is located in" rtapi_app_main"
if((answer = hal_pin_float_new("xyzbc-trt-kins.oma",
HAL_OUT, &(haldata->oma), comp_id)) < 0) goto error;
this is in code:
*(haldata->oma) = 11.11;
when looking/watching from HAL configuration in linuxcnc only shows 0.0
it's compiled and im using this file.. and it does not give error when compiling.
Also I tried HAL_IO, HAL_IN no difference.
How can I write values to HAL pins????
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 10 months ago #102961
by andypugh
Replied by andypugh on topic TCP 5-axis kinematics
What you have ought to work, but there is a bit more you need too (You may be doing this, but haven't shown that part of the code) One thing is that the haldata struct needs to be hal_malloc-ed
Please Log in or Create an account to join the conversation.
- jsskangas
- Offline
- Premium Member
-
Less
More
- Posts: 144
- Thank you received: 9
8 years 10 months ago #103064
by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Yes if you mean this line:
haldata = hal_malloc(sizeof(struct haldata));
That is located in rtapi_app_main() before introducing HAL pins.
Jussi
haldata = hal_malloc(sizeof(struct haldata));
That is located in rtapi_app_main() before introducing HAL pins.
Jussi
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 10 months ago #103068
by andypugh
Replied by andypugh on topic TCP 5-axis kinematics
And is oma in the haldata struct (I can't open .rar files to check. (And I am on a Windows 10 PC at work))
Is the code that is setting the oma value in a function that is being used? I am a little unclear which of the forward and inverse kins subroutines get called when. I think I would be tempted to add another HAL pin that changes state whenever forwards kins or reverse kins runs.
Is the code that is setting the oma value in a function that is being used? I am a little unclear which of the forward and inverse kins subroutines get called when. I think I would be tempted to add another HAL pin that changes state whenever forwards kins or reverse kins runs.
Please Log in or Create an account to join the conversation.
- jsskangas
- Offline
- Premium Member
-
Less
More
- Posts: 144
- Thank you received: 9
8 years 10 months ago #103070
by jsskangas
Replied by jsskangas on topic TCP 5-axis kinematics
Ok
Here is c file of kinematics.
Here is c file of kinematics.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
8 years 10 months ago #103169
by andypugh
Replied by andypugh on topic TCP 5-axis kinematics
Nothing looks particularly wrong (other that you probably need HAL_OUT as HAL_IO is only for very special and unusual cases.)
Is the haldata->oma pin never changing vale at all? I think that that caon only really mean that that code isn't being run.
Do the print messages etc all happen as expected?
Is the haldata->oma pin never changing vale at all? I think that that caon only really mean that that code isn't being run.
Do the print messages etc all happen as expected?
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds