Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use TOL.is_close for checking if scaling is needed in Robot class #436

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/compas_fab/robots/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from compas.data import Data
from compas.geometry import Frame
from compas.geometry import Transformation
from compas.tolerance import TOL
from compas_robots import Configuration
from compas_robots import RobotModel
from compas_robots.model import Joint
Expand Down Expand Up @@ -1389,7 +1390,7 @@ def plan_cartesian_motion(self, waypoints, start_configuration=None, group=None,
# =======
# Scaling
# =======
need_scaling = self.scale_factor != 1.0
need_scaling = not TOL.is_close(self.scale_factor, 1.0, rtol=1e-8)

if need_scaling:
waypoints = waypoints.scaled(1.0 / self.scale_factor)
Expand Down
Loading