Skip to content

fix some bugs in GcodeProcessor#1466

Merged
ABSitf merged 2 commits intomasterfrom
i2198_fix_some_bugs
Jul 24, 2023
Merged

fix some bugs in GcodeProcessor#1466
ABSitf merged 2 commits intomasterfrom
i2198_fix_some_bugs

Conversation

@ABSitf
Copy link
Contributor

@ABSitf ABSitf commented Jul 24, 2023

fix rotation in relative input mode
fix setting idle mode

res.idle = moveMode_ == MoveMode::Idle;

Vector3f rotationAnglesStep_ = ( *inputRotation_ - rotationAngles_ ) / ( pointInRotation - 1.f );
Vector3f rotationAnglesStep_ = ( newRotationAngles - rotationAngles_ ) / ( pointInRotation - 1.f );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if pointInRotation == 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impossible. pointInRotation is constant equal 21

const int pointCount = int( res.action.path.size() );
res.toolDirection.resize( pointCount );
const Vector3f rotationAnglesStep_ = ( *inputRotation_ - rotationAngles_ ) / ( pointCount - 1.f );
const Vector3f rotationAnglesStep_ = ( newAngles - rotationAngles_ ) / ( pointCount - 1.f );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if pointCount == 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impossible. in this logic branch minimum value is 11 (as result previous method)

res.toolDirection.resize( pointInRotation );
const Vector3f lineStep = ( newPoint - translationPos_ ) / ( pointInRotation - 1.f );
const Vector3f rotationAnglesStep_ = ( *inputRotation_ - rotationAngles_ ) / ( pointInRotation - 1.f );
const Vector3f rotationAnglesStep_ = ( newAngles - rotationAngles_ ) / ( pointInRotation - 1.f );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@ABSitf ABSitf merged commit 2b7e938 into master Jul 24, 2023
@ABSitf ABSitf deleted the i2198_fix_some_bugs branch July 24, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants