From 92a21cd88f1198488157e008201058c114c58212 Mon Sep 17 00:00:00 2001 From: Victor LEUNG Date: Fri, 14 Jun 2024 16:34:29 +0800 Subject: [PATCH] refactor: Use TOL.is_close for checking if scaling is needed in Robot class --- src/compas_fab/robots/robot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compas_fab/robots/robot.py b/src/compas_fab/robots/robot.py index f932e266e..3d6c16b58 100644 --- a/src/compas_fab/robots/robot.py +++ b/src/compas_fab/robots/robot.py @@ -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 @@ -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 = TOL.is_close(self.scale_factor, 1.0, rtol=1e-8) if need_scaling: waypoints = waypoints.scaled(1.0 / self.scale_factor)