diff --git a/cartesian_controller_base/include/cartesian_controller_base/cartesian_controller_base.h b/cartesian_controller_base/include/cartesian_controller_base/cartesian_controller_base.h index ce9552cf..b526f817 100644 --- a/cartesian_controller_base/include/cartesian_controller_base/cartesian_controller_base.h +++ b/cartesian_controller_base/include/cartesian_controller_base/cartesian_controller_base.h @@ -181,7 +181,7 @@ class CartesianControllerBase : public controller_interface::ControllerInterface * * @return True if the controller is active, false otherwise */ - bool isActive() const {return m_active;}; + bool isActive() const { return m_active; }; KDL::Chain m_robot_chain; diff --git a/cartesian_controller_tests/integration_tests/integration_tests.py b/cartesian_controller_tests/integration_tests/integration_tests.py index 67277d0b..0266e99d 100755 --- a/cartesian_controller_tests/integration_tests/integration_tests.py +++ b/cartesian_controller_tests/integration_tests/integration_tests.py @@ -155,44 +155,47 @@ def test_inputs_with_nans(self): The controllers' callbacks store them even when in inactive state after startup. We then check if every controller can be activated normally. """ + def publish_nan_targets(): # Target pose target_pose = PoseStamped() target_pose.header.frame_id = "base_link" - target_pose.pose.position.x = float('nan') - target_pose.pose.position.y = float('nan') - target_pose.pose.position.z = float('nan') - target_pose.pose.orientation.x = float('nan') - target_pose.pose.orientation.y = float('nan') - target_pose.pose.orientation.z = float('nan') - target_pose.pose.orientation.w = float('nan') + target_pose.pose.position.x = float("nan") + target_pose.pose.position.y = float("nan") + target_pose.pose.position.z = float("nan") + target_pose.pose.orientation.x = float("nan") + target_pose.pose.orientation.y = float("nan") + target_pose.pose.orientation.z = float("nan") + target_pose.pose.orientation.w = float("nan") self.target_pose_pub.publish(target_pose) # Force-torque sensor ft_sensor_wrench = WrenchStamped() - ft_sensor_wrench.wrench.force.x = float('nan') - ft_sensor_wrench.wrench.force.y = float('nan') - ft_sensor_wrench.wrench.force.z = float('nan') - ft_sensor_wrench.wrench.torque.x = float('nan') - ft_sensor_wrench.wrench.torque.y = float('nan') - ft_sensor_wrench.wrench.torque.z = float('nan') + ft_sensor_wrench.wrench.force.x = float("nan") + ft_sensor_wrench.wrench.force.y = float("nan") + ft_sensor_wrench.wrench.force.z = float("nan") + ft_sensor_wrench.wrench.torque.x = float("nan") + ft_sensor_wrench.wrench.torque.y = float("nan") + ft_sensor_wrench.wrench.torque.z = float("nan") self.ft_sensor_wrench_pub.publish(ft_sensor_wrench) # Target wrench target_wrench = WrenchStamped() - target_wrench.wrench.force.x = float('nan') - target_wrench.wrench.force.y = float('nan') - target_wrench.wrench.force.z = float('nan') - target_wrench.wrench.torque.x = float('nan') - target_wrench.wrench.torque.y = float('nan') - target_wrench.wrench.torque.z = float('nan') + target_wrench.wrench.force.x = float("nan") + target_wrench.wrench.force.y = float("nan") + target_wrench.wrench.force.z = float("nan") + target_wrench.wrench.torque.x = float("nan") + target_wrench.wrench.torque.y = float("nan") + target_wrench.wrench.torque.z = float("nan") self.target_wrench_pub.publish(target_wrench) for name in self.our_controllers: self.start_controller(name) publish_nan_targets() - time.sleep(3) # process some update() cycles - self.assertTrue(self.check_state(name, 'active'), f"{name} survives inputs with NaNs") + time.sleep(3) # process some update() cycles + self.assertTrue( + self.check_state(name, "active"), f"{name} survives inputs with NaNs" + ) self.stop_controller(name) def check_state(self, controller, state):