[SOLVED] axes follow other axes
#include <linuxcnc/canon.hh>
there is the same of
import emccanon
...
emccanon.STRAIGHT_TRAVERSE(line,x0+delta,y0,z0,0,0,0,0,0,0)
????
Please Log in or Create an account to join the conversation.
other .... in my c++ code I can link this:
#include <linuxcnc/canon.hh>
there is the same ofimport emccanon
I think so. Does it work?
You probably do want to be working at the canon layer, rather than the MDI layer.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
107 int rtapi_app_main(void) {
108 int result;
109 comp_id = hal_init("5axiskins");
110 if(comp_id < 0) return comp_id;
111
112 haldata = hal_malloc(sizeof(struct haldata));
113
114 result = hal_pin_float_new("5axiskins.pivot-length", HAL_IO, &(haldata->pivot_length), comp_id);
115 if(result < 0) goto error;
116
117 *(haldata->pivot_length) = 250.0;
118
119 hal_ready(comp_id);
120 return 0;
121
122 error:
123 hal_exit(comp_id);
124 return result;
125 }
and in the header of function there is this link
99 #include "hal.h"
but in linuxcnc.org/docs/html/hal/components_es.html#_hal_api_calls we talk about
hal_pin_bit_new.3hal
hal_pin_bit_newf.3hal
hal_pin_float_new.3hal
hal_pin_float_newf.3hal
hal_pin_new.3hal
hal_pin_s32_new.3hal
hal_pin_s32_newf.3hal
hal_pin_u32_new.3hal
In my deltakinematics I have to use
include "3hal.h"
?????
Please Log in or Create an account to join the conversation.
.....fowardkins.....
pos->tran.x = joint[0] - (haldata->encoder1offset) .....
.....inversekind.....
joint[0] = pos->tran.x + (haldata->encoder1offset) .....
...........................
...........................
int comp_id;
int rtapi_app_main(void) {
int result;
comp_id = hal_init("mykinemaics");
if(comp_id < 0) return comp_id;
haldata = hal_malloc(sizeof(struct haldata));
/* is correct this???? */ result = hal_pin_float_new("mykinemaics.encoder1offset", HAL_IO, &(haldata->encoder1offset), comp_id);
hal_ready(comp_id);
return 0;
error:
hal_exit(comp_id);
return result;
}
in hal file instead imposed ENCODER_RATIO (or only one encoder with SCALE + encoder reset pin) and set adequately limit3. With limt3 I avoid that when pressed encoder.reset there is the following error axes...
I can use another
hal_pin_bit_new.3hal /* or more correcly hal_pin_new.hal ???*/
if ((haldata->myswich == 1){pos->tran.x = joint[0] - (haldata->encoder1offset)}
else {pos->tran.x = joint[0] .......}
Please Log in or Create an account to join the conversation.
include "3hal.h"
You probably don't even need that, as "comp" needs hal.h to create pins when making hal components, so probably automatically includes it.
However, there is no harm in including hal.h in your own kins file.
I think the .3hal actually just indicates which sectoion of the documentation it belongs in
Please Log in or Create an account to join the conversation.
pos->tran.x = joint[0] - (haldata->encoder1offset)
HAL pins are always pointers, as they get moved around so that they point at the same bit of shared memory. (In practice the HAL "net" command just changes a set of pointers to all point at the same memory location)
So, you need
pos->tran.x = joint[0] - *(haldata->encoder1offset)
Please Log in or Create an account to join the conversation.
net enable_encoder1 motion.digital-in-00 => mydeltakins_catch.enable_encoder1
setp mydeltakins_catch.encoder1_offset encoder.1.position
The pin in my kinematic is write in this way .... (bit pin and float pin)
if((res = hal_pin_float_new("mydeltakins_catch.encoder1_offset", HAL_IO, &(haldata->encoder1_offset),comp_id)) != 0) goto error;
if((res = hal_pin_bit_new("mydeltakins_catch.enable_encoder1", HAL_IO, &(haldata->enable_encoder1),comp_id)) != 0) goto error;
I don't Understand why linux cnc send me this error: value for 'encoder.1.position' invalid for float.
encoder.1.position is pin out float and mydeltakins_catch.encoder1_offset is pin IO float ... there are the same type of value ..... Why encoder.1.position is invalid??????
Obviously I must have misunderstood something .... but I do not know what.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.