Repository navigation
Conversation
|
Thanks. On your points: On your point 1: deleting the old names is fine with me, #4702 is recent. I will rename the few uses in my multiaxis branch when I rebase. On your point 2: I think a union default makes a positional initializer silently wrong: On your point 5: NaN passes all three clamp comparisons and reaches the cast, which is undefined; Inf is clamped. Maybe skip the write on NaN and keep the pin's last value? In tree only the iteration counts are written to integer pins, so it would only matter for out-of-tree modules. |
046de88 to
8a76e65
Compare
|
Using a single type for multiple targets is basically wrong. A double does not cover the range of sint/uint properly. Sure, it may be a "small" compromise, but I think it is wrong. I suggest to change the ordering of the union fields to: union {
rtapi_bool b;
rtapi_real r;
rtapi_sint s;
rtapi_uint u;
}That way BTW, I also think it is wrong not to keep the internals at the correct type and always use a floating point (and do a read/write conversion). We've seen this discussion before, I think. However, I was not prepared to refactor the whole code ;-) The NaN issue, well, not writing may be the better option. Adding a test to skip writing if Pushed a new version, have a look what you think now. |
|
Thanks, the bool first ordering and the isnan skip look good to me, and fair enough on the exact types. One leftover: two doc examples still use the removed names with positional defaults, docs/src/motion/switchkins.adoc lines 708-709 ( |
8a76e65 to
1c74212
Compare
|
Sure will fix the docs. Was silently waiting for consensus on this PR first ;-) For out-of-tree compiles, well, as I said, I think we should default to enabling |
grandixximo
left a comment
There was a problem hiding this comment.
Thanks, docs look right now. Built clean and the kins tests pass here (kins-params, kins-switch*, kins-frames, kins-jacobian, kins-tool-offset, genhexkins-forward, pumakins-unwrap, tool-frame, matrixkins, maxkins). I will rename the uses in my multiaxis branch when I rebase.
A recent change in the kinematics setup has with #4702 (re-)introduced the old HAL naming scheme. This PR updates all kinematics HAL interfacing to adhere to the new naming scheme. Simultaneously, it updates the code to run 64-bit clean.
@grandixximo A few points to consider:
include/kins_module.h: The old namesKINS_PARAM_{FLOAT,BIT,S32,U32}are still declared but will emit a deprecation warning. Since this is a recent addition, it would probably be alright just to delete the enums with the old naming scheme. Please let me know.emc/kinematics/kins_util.c: The initialization inkinsParamsInit()now hooks into the correct source type for the default.emc/kinematics/kins_util.c: Writing pins inkinsParamsPinsWrite()with sint/uint will now clamp because the source of the data is of type double and may cause rather "experimental" results when blindly converted (see next point).