diff options
author | dc42 <dcrocker@eschertech.com> | 2021-02-16 17:57:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 17:57:56 +0300 |
commit | e86f9472eda30820714d3965bffbd36574e0e62d (patch) | |
tree | 0c6d0b451eecab8993e6bd5cbe1883bb827bf112 /src/Movement/Kinematics/FiveBarScaraKinematics.cpp | |
parent | 88f1a6d5defd8d0649238006cae797a3ca12c728 (diff) |
Wil mesh any two axes (#476)
* Open mesh compenastion for any-two axes
* Fix reboot loop on Duet 3
* Fix typos
Skip Z axis where not appropriate
Add version to HeightMapHeader
* Fix compiler errors
* Make compatible with pre 3.3-beta2 format again
Minor simplifications
* Revert changes to SBC interface (implement that later)
* Also prevent sending a none-XY grid to SBC for now
* Rename variables and no longer persist axis numbers
* Use common parent class for Kinematics with round bed
Co-authored-by: Manuel Coenen <manuel@duet3d.com>
Diffstat (limited to 'src/Movement/Kinematics/FiveBarScaraKinematics.cpp')
-rw-r--r-- | src/Movement/Kinematics/FiveBarScaraKinematics.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Movement/Kinematics/FiveBarScaraKinematics.cpp b/src/Movement/Kinematics/FiveBarScaraKinematics.cpp index 9358efd1..8428d08e 100644 --- a/src/Movement/Kinematics/FiveBarScaraKinematics.cpp +++ b/src/Movement/Kinematics/FiveBarScaraKinematics.cpp @@ -826,10 +826,19 @@ void FiveBarScaraKinematics::MotorStepsToCartesian(const int32_t motorPos[], con } // Return true if the specified XY position is reachable by the print head reference point. -bool FiveBarScaraKinematics::IsReachable(float x, float y, bool isCoordinated) const noexcept +bool FiveBarScaraKinematics::IsReachable(float axesCoords[MaxAxes], AxesBitmap axes, bool isCoordinated) const noexcept { - float coords[2] = {x, y}; - return constraintsOk(coords); + if (axes.IsBitSet(X_AXIS) && axes.IsBitSet(Y_AXIS)) + { + float coords[2] = {axesCoords[X_AXIS], axesCoords[Y_AXIS]}; + if (!constraintsOk(coords)) + { + return false; + } + } + axes.ClearBit(X_AXIS); + axes.ClearBit(Y_AXIS); + return Kinematics::IsReachable(axesCoords, axes, isCoordinated); } // Return the initial Cartesian coordinates we assume after switching to this kinematics |