diff --git a/flowstate/aic_flowstate_ros_bridge/CHANGELOG.rst b/flowstate/aic_flowstate_ros_bridge/CHANGELOG.rst index 0141f8e17..62e228525 100644 --- a/flowstate/aic_flowstate_ros_bridge/CHANGELOG.rst +++ b/flowstate/aic_flowstate_ros_bridge/CHANGELOG.rst @@ -2,8 +2,12 @@ Changelog for package aic_flowstate_ros_bridge ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0.1.1 (2026-06-11) +0.1.1 (2026-08-04) ------------------ +* Expose tool transformation for FT sensor (`#603 `_) +* Subscribe to proto CaptureResults and publish ROS images (`#600 `_) +* Support admittance control (`#598 `_) +* Contributors: John TGZ, Kaushik Balasundar, Morgan Quigley 0.1.0 (2026-06-09) ------------------ diff --git a/flowstate/aic_flowstate_ros_bridge/CMakeLists.txt b/flowstate/aic_flowstate_ros_bridge/CMakeLists.txt index 8293e9b73..5f23c665d 100644 --- a/flowstate/aic_flowstate_ros_bridge/CMakeLists.txt +++ b/flowstate/aic_flowstate_ros_bridge/CMakeLists.txt @@ -30,10 +30,15 @@ foreach(pkg ${dep_pkgs}) endforeach() find_package(Eigen3 REQUIRED NO_MODULE) +find_package(nlohmann_json REQUIRED) find_package(Protobuf REQUIRED) find_package(orocos_kdl_vendor REQUIRED) #================================== +option(USE_FIXED_CONTROL_PARAMETERS "Use fixed control parameters" ON) +if(USE_FIXED_CONTROL_PARAMETERS) + add_compile_definitions(USE_FIXED_CONTROL_PARAMETERS) +endif() intrinsic_sdk_protobuf_generate( NAME agent_bridge @@ -63,6 +68,7 @@ target_link_libraries(robot_control_bridge pluginlib::pluginlib rclcpp::rclcpp tf2_eigen::tf2_eigen + nlohmann_json::nlohmann_json ${aic_control_interfaces_TARGETS} ${std_srvs_TARGETS} ) diff --git a/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge.proto b/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge.proto index 010354560..224860bc9 100644 --- a/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge.proto +++ b/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge.proto @@ -10,6 +10,9 @@ message RobotControlBridgeConfig { string ft_sensor_part_name = 4; string task_settings_file = 5; string joint_task_settings_file = 6; + double time_to_target_seconds = 7; + string control_mode = 8; + repeated double critical_mass = 9; } message ToolTransformationConfig { diff --git a/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge_default_config.pbtxt b/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge_default_config.pbtxt index 7347aeb9d..df2864f52 100644 --- a/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge_default_config.pbtxt +++ b/flowstate/aic_flowstate_ros_bridge/aic_flowstate_ros_bridge_default_config.pbtxt @@ -52,5 +52,8 @@ ft_sensor_part_name: "ati" task_settings_file: "config/default_task_settings.pbtxt" joint_task_settings_file: "config/default_joint_task_settings.pbtxt" + time_to_target_seconds: 0.1 + control_mode: "admittance" + critical_mass: [10.0, 10.0, 10.0, 5.0, 5.0, 5.0] }, } diff --git a/flowstate/aic_flowstate_ros_bridge/config/default_joint_task_settings.pbtxt b/flowstate/aic_flowstate_ros_bridge/config/default_joint_task_settings.pbtxt index 6396ced09..11ef01d1d 100644 --- a/flowstate/aic_flowstate_ros_bridge/config/default_joint_task_settings.pbtxt +++ b/flowstate/aic_flowstate_ros_bridge/config/default_joint_task_settings.pbtxt @@ -6,13 +6,13 @@ damping_smoothing_constant: 0.1 # These limits cannot exceed the application limits. joint_limits_update: { - min_position: { values: [-6.22, -4.059, -2.77, -6.22, -6.22, -6.22] } - max_position: { values: [6.22, 0.95, 2.77, 6.22, 6.22, 6.22] } + min_position: { values: [-1.832, -1.919, -2.356, -2.792, -1.658, -1.745] } + max_position: { values: [1.221, 0.0, 0.698, 2.443, 3.141, 4.363] } # For safety/testing, reducing velocity limits is usually the most intuitive # and all that matters for conservative motion. Reducting acceleration and # jerk limits can have counter-intuitive behavior. max_velocity: { values: [0.8, 0.8, 0.8, 0.8, 0.8, 0.8] } - max_acceleration: { values: [10, 10, 10, 10, 10, 10] } + max_acceleration: { values: [5, 5, 5, 5, 5, 5] } max_jerk: { values: [8001, 8001, 8001, 8001, 8001, 8001] } max_effort: { values: [100.0, 100.0, 100.0, 28.0, 28.0, 28.0] } } @@ -21,14 +21,15 @@ joint_limits_update: { # towards zero if the motion would push towards the limit. limits_soft_margin_radians: 0.02 -interpolation_mode: LINEAR_INTERPOLATION +# Using reflexxes interpolation constraints commands to specified kinematic limits +interpolation_mode: REFLEXXES # Stiffness and damping cannot exceed the application limits. stiffness: { - joints: [100., 100., 100., 50., 50., 50.] + joints: [175., 175., 175., 125., 50., 50.] } damping: { - joints: [40.0, 40.0, 40.0, 15.0, 15.0, 15.0] + joints: [50.0, 50.0, 50.0, 35.0, 10.0, 10.0] } # Using ~50% of max_effort -- and this is could be more conservative. @@ -42,6 +43,6 @@ feedforward_torque_interpolator_settings: { # the current joint position. An adjustment of the reference position starts # at max_distance*activation_ratio. reference_joint_limit_settings: { - max_distance: 0.75 + max_distance: 0.1 activation_ratio: 0.75 } diff --git a/flowstate/aic_flowstate_ros_bridge/config/default_task_settings.pbtxt b/flowstate/aic_flowstate_ros_bridge/config/default_task_settings.pbtxt index 899930dc4..37fb20064 100644 --- a/flowstate/aic_flowstate_ros_bridge/config/default_task_settings.pbtxt +++ b/flowstate/aic_flowstate_ros_bridge/config/default_task_settings.pbtxt @@ -4,9 +4,9 @@ # Impedance control parameters need to be tuned for every robot and endeffector. # The values below correspond to a robotiq-2f gripper with Axia80 F/T cell. # with critical damping under the assume mass. -max_stiffness: { x: 800 y: 800 z: 800 rx: 40 ry: 40 rz: 40 } -max_damping: { x: 76 y: 76 z: 76 rx: 10 ry: 10 rz: 10 } -mass_for_critical_damping: { x: 1.8 y: 1.8 z: 1.8 rx: 0.12 ry: 0.12 rz: 0.12 } +max_stiffness: { x: 1000 y: 1000 z: 1000 rx: 150 ry: 150 rz: 150 } +max_damping: { x: 1562.049935 y: 1562.049935 z: 1562.049935 rx: 1096.814453 ry: 1096.814453 rz: 1096.814453 } +mass_for_critical_damping: { x: 10.0 y: 10.0 z: 10.0 rx: 5.0 ry: 5.0 rz: 5.0 } # Limits of a reasonable retangular volume in front the the robot. This should # be adjusted for different workcells and even different applications. @@ -18,12 +18,12 @@ cartesian_limits { max_translational_position: 1.0 # y max_translational_position: 1.5 # z - min_translational_velocity: -0.3 - min_translational_velocity: -0.3 - min_translational_velocity: -0.3 - max_translational_velocity: 0.3 - max_translational_velocity: 0.3 - max_translational_velocity: 0.3 + min_translational_velocity: -0.75 + min_translational_velocity: -0.75 + min_translational_velocity: -0.75 + max_translational_velocity: 0.75 + max_translational_velocity: 0.75 + max_translational_velocity: 0.75 min_translational_acceleration: -10 min_translational_acceleration: -10 @@ -39,7 +39,7 @@ cartesian_limits { max_translational_jerk: 3000.0 max_translational_jerk: 3000.0 - max_rotational_velocity: 1 + max_rotational_velocity: 2 max_rotational_acceleration: 10 max_rotational_jerk: 3000.0 } @@ -75,7 +75,8 @@ nullspace_target_configuration { joints: [0.0, 0.0, 0.0, 0.0, 1.57, 0.0] } activation_percentage: -1 -interpolation_mode: LINEAR_INTERPOLATION +# Using reflexxes interpolation constraints commands to specified kinematic limits +interpolation_mode: REFLEXXES # Parameters for limiting the distance between reference pose and sensed pose. # @@ -102,4 +103,6 @@ pose_error_integrator_bound: { x: 10 y: 10 z: 10 rx: 2 ry: 2 rz: 2 } # The control mode allows switching between impedance and admittance control, # and defaults to impedance control when not specified. -control_mode: IMPEDANCE \ No newline at end of file +control_mode: ADMITTANCE + +sensed_wrench_deadband { x: 0.2 y: 0.2 z: 0.5 rx: 0.05 ry: 0.05 rz: 0.05 } diff --git a/flowstate/aic_flowstate_ros_bridge/config/fixed_task_settings.json b/flowstate/aic_flowstate_ros_bridge/config/fixed_task_settings.json new file mode 100644 index 000000000..451e23d0a --- /dev/null +++ b/flowstate/aic_flowstate_ros_bridge/config/fixed_task_settings.json @@ -0,0 +1,8 @@ +{ + "control_mode": "admittance", + "target_pose_stiffness": [1000.0, 1000.0, 1000.0, 150.0, 150.0, 150.0], + "target_pose_damping": [1562.049935, 1562.049935, 1562.049935, 1096.814453, 1096.814453, 1096.814453], + "target_mass": [10.0, 10.0, 10.0, 5.0, 5.0, 5.0], + "target_joint_stiffness": [175.0, 175.0, 175.0, 125.0, 50.0, 50.0], + "target_joint_damping": [50.0, 50.0, 50.0, 35.0, 10.0, 10.0] +} diff --git a/flowstate/aic_flowstate_ros_bridge/launch/aic_flowstate_ros_bridge_launch.py b/flowstate/aic_flowstate_ros_bridge/launch/aic_flowstate_ros_bridge_launch.py index 70342a51d..eca1ca187 100644 --- a/flowstate/aic_flowstate_ros_bridge/launch/aic_flowstate_ros_bridge_launch.py +++ b/flowstate/aic_flowstate_ros_bridge/launch/aic_flowstate_ros_bridge_launch.py @@ -76,6 +76,16 @@ def generate_launch_description(): default_value="ati", description="F/T sensor part name", ), + DeclareLaunchArgument( + "control_mode", + default_value="admittance", + description="Control mode (admittance or impedance)", + ), + DeclareLaunchArgument( + "time_to_target_seconds", + default_value="0.1", + description="Time to reach target in seconds", + ), DeclareLaunchArgument( "use_sim_time", default_value="true", @@ -125,6 +135,10 @@ def generate_launch_description(): "config", "default_joint_task_settings.pbtxt", ), + "control_mode": LaunchConfiguration("control_mode"), + "time_to_target_seconds": LaunchConfiguration( + "time_to_target_seconds" + ), "override_joint_names": [ "shoulder_pan_joint", "shoulder_lift_joint", diff --git a/flowstate/aic_flowstate_ros_bridge/launch/test_joint_targets.launch.py b/flowstate/aic_flowstate_ros_bridge/launch/test_joint_targets.launch.py new file mode 100644 index 000000000..f9d6e62be --- /dev/null +++ b/flowstate/aic_flowstate_ros_bridge/launch/test_joint_targets.launch.py @@ -0,0 +1,49 @@ +import launch +from launch import LaunchDescription +from launch_ros.actions import Node + + +def generate_launch_description(): + return LaunchDescription( + [ + Node( + package="aic_flowstate_ros_bridge", + executable="test_robot_control_bridge.py", + name="test_robot_control_bridge_node", + output="screen", + parameters=[ + { + "controller_namespace": "aic_controller", + "test_mode": "joint", + # Example test_joint_targets format: JSON string of a flattened list of joint values (or list of lists). + # The list is automatically chunked into 6 values per joint target: [j1, j2, j3, j4, j5, j6] + ########################## + # Home position: + ########################## + "test_joint_targets": "[" + "-1.57, -1.57, -1.57, -1.57, 1.57, -1.57" + "]", + "log_filepath": "", # Empty string defaults to tcp_accuracy_.json + "target_joint_stiffness": [ + 175.0, + 175.0, + 175.0, + 125.0, + 50.0, + 50.0, + ], + "target_joint_damping": [ + 50.0, + 50.0, + 50.0, + 35.0, + 10.0, + 10.0, + ], + "publish_duration": 3.0, + "stop_duration": 2.0, + } + ], + ) + ] + ) diff --git a/flowstate/aic_flowstate_ros_bridge/launch/test_pose_targets.launch.py b/flowstate/aic_flowstate_ros_bridge/launch/test_pose_targets.launch.py new file mode 100644 index 000000000..3a82bf078 --- /dev/null +++ b/flowstate/aic_flowstate_ros_bridge/launch/test_pose_targets.launch.py @@ -0,0 +1,49 @@ +import launch +from launch import LaunchDescription +from launch_ros.actions import Node + + +def generate_launch_description(): + return LaunchDescription( + [ + Node( + package="aic_flowstate_ros_bridge", + executable="test_robot_control_bridge.py", + name="test_robot_control_bridge_node", + output="screen", + parameters=[ + { + "controller_namespace": "aic_controller", + "test_mode": "pose", + # Example test_pose_targets format: JSON string of a flattened list of poses (or list of lists). + # The list is automatically chunked into 7 elements per pose: [x, y, z, qx, qy, qz, qw] + ########################## + # Home position + ########################## + "test_pose_targets": "[" + "-0.1, -0.5, 0.5, 0.7071068, -0.7071068, 0.0, 0.0 " + "]", + "log_filepath": "", # Empty string defaults to tcp_accuracy_.json + "target_pose_stiffness": [ + 1000.0, + 1000.0, + 1000.0, + 150.0, + 150.0, + 150.0, + ], + "target_pose_damping": [ + 1562.049935, + 1562.049935, + 1562.049935, + 1096.814453, + 1096.814453, + 1096.814453, + ], + "publish_duration": 5.0, + "stop_duration": 2.0, + } + ], + ) + ] + ) diff --git a/flowstate/aic_flowstate_ros_bridge/package.xml b/flowstate/aic_flowstate_ros_bridge/package.xml index d0e9780fa..c64d6472b 100644 --- a/flowstate/aic_flowstate_ros_bridge/package.xml +++ b/flowstate/aic_flowstate_ros_bridge/package.xml @@ -18,6 +18,7 @@ pluginlib std_srvs tf2_eigen + nlohmann_json ament_lint_auto ament_lint_common diff --git a/flowstate/aic_flowstate_ros_bridge/scripts/test_robot_control_bridge.py b/flowstate/aic_flowstate_ros_bridge/scripts/test_robot_control_bridge.py index e9d00976d..775fb1151 100755 --- a/flowstate/aic_flowstate_ros_bridge/scripts/test_robot_control_bridge.py +++ b/flowstate/aic_flowstate_ros_bridge/scripts/test_robot_control_bridge.py @@ -18,6 +18,8 @@ import sys import time +import json +from datetime import datetime import rclpy import numpy as np from rclpy.executors import ExternalShutdownException @@ -26,13 +28,24 @@ from aic_control_interfaces.msg import ( MotionUpdate, JointMotionUpdate, + ControllerState, TrajectoryGenerationMode, TargetMode, ) from aic_control_interfaces.srv import ( ChangeTargetMode, ) -from geometry_msgs.msg import Pose, Point, Quaternion, Wrench, Vector3, Twist +from geometry_msgs.msg import ( + Pose, + Point, + Quaternion, + Wrench, + Vector3, + Twist, + WrenchStamped, +) +from trajectory_msgs.msg import JointTrajectoryPoint +from sensor_msgs.msg import JointState class TestRobotControlBridgeNode(Node): @@ -45,27 +58,105 @@ def __init__(self): "controller_namespace", "aic_controller" ).value + self.test_pose_targets_str = self.declare_parameter( + "test_pose_targets", "[]" + ).value + + self.test_joint_targets_str = self.declare_parameter( + "test_joint_targets", "[]" + ).value + + self.test_mode = self.declare_parameter("test_mode", "pose").value + + self.log_filepath = self.declare_parameter("log_filepath", "").value + + self.target_pose_stiffness = self.declare_parameter( + "target_pose_stiffness", [1000.0, 1000.0, 1000.0, 150.0, 150.0, 150.0] + ).value + self.target_pose_damping = self.declare_parameter( + "target_pose_damping", + [ + 1562.049935, + 1562.049935, + 1562.049935, + 1096.814453, + 1096.814453, + 1096.814453, + ], + ).value + + self.target_joint_stiffness = self.declare_parameter( + "target_joint_stiffness", [175.0, 175.0, 175.0, 125.0, 50.0, 50.0] + ).value + + self.target_joint_damping = self.declare_parameter( + "target_joint_damping", [50.0, 50.0, 50.0, 35.0, 10.0, 10.0] + ).value + + self.publish_duration = self.declare_parameter("publish_duration", 5.0).value + + self.stop_duration = self.declare_parameter("stop_duration", 5.0).value + + parsed_targets = json.loads(self.test_pose_targets_str) + if parsed_targets and not isinstance(parsed_targets[0], list): + # Reshape 1D array into 2D array of poses (7 elements each) + self.test_pose_targets = [ + parsed_targets[i : i + 7] for i in range(0, len(parsed_targets), 7) + ] + else: + self.test_pose_targets = parsed_targets + + parsed_joint_targets = json.loads(self.test_joint_targets_str) + if parsed_joint_targets and not isinstance(parsed_joint_targets[0], list): + # Reshape 1D array into 2D array of joint targets (6 elements each) + self.test_joint_targets = [ + parsed_joint_targets[i : i + 6] + for i in range(0, len(parsed_joint_targets), 6) + ] + else: + self.test_joint_targets = parsed_joint_targets + + self.tcp_error = None + self.latest_wrench = None + self.current_joint_state = None + self.reference_joint_state = None + self.joint_error = None + + self.wrench_subscriber = self.create_subscription( + WrenchStamped, "/fts_broadcaster/wrench", self.wrench_callback, 10 + ) + self.motion_update_publisher = self.create_publisher( MotionUpdate, f"/{self.controller_namespace}/pose_commands", 10 ) - while self.motion_update_publisher.get_subscription_count() == 0: - self.get_logger().info( - f"Waiting for subscriber to '{self.controller_namespace}/pose_commands'..." - ) - time.sleep(1.0) - self.joint_motion_update_publisher = self.create_publisher( - JointMotionUpdate, - f"/{self.controller_namespace}/joint_commands", + JointMotionUpdate, f"/{self.controller_namespace}/joint_commands", 10 + ) + + if self.test_mode == "pose": + while self.motion_update_publisher.get_subscription_count() == 0: + self.get_logger().info( + f"Waiting for subscriber to '{self.controller_namespace}/pose_commands'..." + ) + time.sleep(1.0) + elif self.test_mode == "joint": + while self.joint_motion_update_publisher.get_subscription_count() == 0: + self.get_logger().info( + f"Waiting for subscriber to '{self.controller_namespace}/joint_commands'..." + ) + time.sleep(1.0) + + self.state_subscriber = self.create_subscription( + ControllerState, + f"/{self.controller_namespace}/controller_state", + self.state_callback, 10, ) - while self.joint_motion_update_publisher.get_subscription_count() == 0: - self.get_logger().info( - f"Waiting for subscriber to '{self.controller_namespace}/joint_commands'..." - ) - time.sleep(1.0) + self.joint_state_subscriber = self.create_subscription( + JointState, "/joint_states", self.joint_state_callback, 10 + ) self.client = self.create_client( ChangeTargetMode, f"/{self.controller_namespace}/change_target_mode" @@ -78,6 +169,40 @@ def __init__(self): ) time.sleep(1.0) + def joint_state_callback(self, msg: JointState): + self.current_joint_state = msg.position + if ( + self.reference_joint_state is not None + and len(self.reference_joint_state) > 0 + ): + self.joint_error = [ + abs(c - r) + for c, r in zip(self.current_joint_state, self.reference_joint_state) + ] + + def state_callback(self, msg: ControllerState): + self.tcp_error = list(msg.tcp_error) + self.reference_joint_state = msg.reference_joint_state.positions + if ( + self.current_joint_state is not None + and self.reference_joint_state is not None + and len(self.reference_joint_state) > 0 + ): + self.joint_error = [ + abs(c - r) + for c, r in zip(self.current_joint_state, self.reference_joint_state) + ] + + def wrench_callback(self, msg: WrenchStamped): + self.latest_wrench = [ + msg.wrench.force.x, + msg.wrench.force.y, + msg.wrench.force.z, + msg.wrench.torque.x, + msg.wrench.torque.y, + msg.wrench.torque.z, + ] + def generate_motion_update( self, pos, @@ -86,7 +211,6 @@ def generate_motion_update( mode=TrajectoryGenerationMode.MODE_POSITION, twist=None, ): - msg = MotionUpdate() msg.header.stamp = self.get_clock().now().to_msg() msg.header.frame_id = frame_id @@ -100,8 +224,8 @@ def generate_motion_update( linear=Vector3(x=twist[0], y=twist[1], z=twist[2]), angular=Vector3(x=twist[3], y=twist[4], z=twist[5]), ) - msg.target_stiffness = np.diag([75.0, 75.0, 75.0, 75.0, 75.0, 75.0]).flatten() - msg.target_damping = np.diag([35.0, 35.0, 35.0, 35.0, 35.0, 35.0]).flatten() + msg.target_stiffness = np.diag(self.target_pose_stiffness).flatten() + msg.target_damping = np.diag(self.target_pose_damping).flatten() msg.feedforward_wrench_at_tip = Wrench( force=Vector3(x=0.0, y=0.0, z=0.0), torque=Vector3(x=0.0, y=0.0, z=0.0), @@ -111,13 +235,22 @@ def generate_motion_update( return msg - def generate_joint_motion_update(self, joint_pos): + def generate_joint_motion_update( + self, + positions, + mode=TrajectoryGenerationMode.MODE_POSITION, + velocities=None, + ): msg = JointMotionUpdate() + if mode == TrajectoryGenerationMode.MODE_POSITION: + msg.target_state.positions = positions + elif mode == TrajectoryGenerationMode.MODE_VELOCITY: + msg.target_state.velocities = velocities - msg.target_state.positions = joint_pos - msg.target_stiffness = [100, 100, 100, 100, 150, 150] - msg.target_damping = [30, 30, 20, 20, 4, 4] - msg.trajectory_generation_mode.mode = TrajectoryGenerationMode.MODE_POSITION + msg.target_stiffness = self.target_joint_stiffness + msg.target_damping = self.target_joint_damping + msg.target_feedforward_torque = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + msg.trajectory_generation_mode.mode = mode return msg @@ -128,29 +261,15 @@ def send_cartesian_pose_target(self, pos, quat, frame_id): pos, quat, frame_id, TrajectoryGenerationMode.MODE_POSITION ) ) - self.get_logger().info( - f"Published MotionUpdate with POSITION trajectory mode to aic_controller" - ) - - def send_cartesian_twist_target(self, twist, frame_id): - - self.motion_update_publisher.publish( - self.generate_motion_update( - None, None, frame_id, TrajectoryGenerationMode.MODE_VELOCITY, twist - ) - ) - self.get_logger().info( - f"Published MotionUpdate with VELOCITY trajectory mode to aic_controller" - ) - def send_joint_target(self, joint_pos): + def send_joint_target(self, positions): self.joint_motion_update_publisher.publish( - self.generate_joint_motion_update(joint_pos) + self.generate_joint_motion_update( + positions, TrajectoryGenerationMode.MODE_POSITION + ) ) - self.get_logger().info("Published JointMotionUpdate to aic_controller") - def send_change_target_mode_req(self, mode): req = ChangeTargetMode.Request() @@ -179,63 +298,92 @@ def main(args=None): node = TestRobotControlBridgeNode() try: - quat_tool_down = [ - 0.7071068, - 0.7071068, - 0.0, - 0.0, - ] # ZYX = (180, 0, 90), z axis normal to plane and (x,y) axes are aligned with base_link axes - - # Trigger reconection - node.send_cartesian_pose_target( - [-0.501, -0.175, 0.2], - quat_tool_down, - "base_link", - ) - time.sleep(3) - - # Send service request to switch to Cartesian target mode - node.send_change_target_mode_req(TargetMode.MODE_CARTESIAN) - - # Send Cartesian pose targets in both "base_link" and "gripper/tcp" frames - node.send_cartesian_pose_target( - [-0.501, -0.175, 0.2], - quat_tool_down, - "base_link", - ) - time.sleep(5) - - node.send_cartesian_pose_target( - [-0.501, -0.175, 0.5], - [-0.2126311, 0.2126311, 0.6743797, 0.6743797], - "base_link", - ) - time.sleep(5) - - # Send Cartesian twist targets in both "base_link" and "gripper/tcp" frames - node.send_cartesian_twist_target( - [0.05, 0.0, 0.0, 0.0, 0.0, 0.0], - "base_link", - ) - time.sleep(3) - node.send_cartesian_twist_target( - [0.0, -0.05, 0.0, 0.0, 0.0, 0.0], - "gripper/tcp", - ) - time.sleep(3) - - # Send service request to switch to joint target mode - node.send_change_target_mode_req(TargetMode.MODE_JOINT) - - node.send_joint_target([0.5, -1.25, -1.5, -1.5, 1.0, 1.0]) - time.sleep(5) - - node.send_joint_target( - [0.0, -1.354375, -1.6648696, -1.6931439, 1.5708, 1.4109242] - ) - time.sleep(5) - - rclpy.spin(node) + output_log = { + "target_pose_stiffness": node.target_pose_stiffness, + "target_pose_damping": node.target_pose_damping, + "target_joint_stiffness": node.target_joint_stiffness, + "target_joint_damping": node.target_joint_damping, + "results": {}, + } + + if node.test_mode == "pose" and node.test_pose_targets: + # Send service request to switch to Cartesian target mode + node.send_change_target_mode_req(TargetMode.MODE_CARTESIAN) + + for pose in node.test_pose_targets: + # pose is expected to be [x, y, z, qx, qy, qz, qw] + pos = pose[0:3] + quat = pose[3:7] + + node.get_logger().info(f"Testing pose target: {pose}") + + node.get_logger().info( + f"Publishing motion update for {node.publish_duration} seconds." + ) + start_time = time.time() + while time.time() - start_time < node.publish_duration and rclpy.ok(): + node.send_cartesian_pose_target(pos, quat, "base_link") + rclpy.spin_once(node, timeout_sec=0.04) # 25 Hz + + node.get_logger().info( + f"Stopping motion updates for {node.stop_duration} seconds." + ) + start_time = time.time() + while time.time() - start_time < node.stop_duration and rclpy.ok(): + rclpy.spin_once(node, timeout_sec=0.1) + + if node.tcp_error is not None: + node.get_logger().info(f"Recording tcp_error: {node.tcp_error}") + recorded_data = {"tcp_error": node.tcp_error} + if node.latest_wrench is not None: + node.get_logger().info( + f"Recording wrench: {node.latest_wrench}" + ) + recorded_data["wrench"] = node.latest_wrench + output_log["results"][str(pose)] = recorded_data + + if node.test_mode == "joint" and node.test_joint_targets: + # Send service request to switch to Joint target mode + node.send_change_target_mode_req(TargetMode.MODE_JOINT) + + for joint_target in node.test_joint_targets: + node.get_logger().info(f"Testing joint target: {joint_target}") + + node.get_logger().info( + f"Publishing joint motion update for {node.publish_duration} seconds." + ) + start_time = time.time() + while time.time() - start_time < node.publish_duration and rclpy.ok(): + node.send_joint_target(joint_target) + rclpy.spin_once(node, timeout_sec=0.04) # 25 Hz + + node.get_logger().info( + f"Stopping joint motion updates for {node.stop_duration} seconds." + ) + start_time = time.time() + while time.time() - start_time < node.stop_duration and rclpy.ok(): + rclpy.spin_once(node, timeout_sec=0.1) + + if node.joint_error is not None: + node.get_logger().info(f"Recording joint_error: {node.joint_error}") + recorded_data = {"joint_error": node.joint_error} + if node.latest_wrench is not None: + node.get_logger().info( + f"Recording wrench: {node.latest_wrench}" + ) + recorded_data["wrench"] = node.latest_wrench + output_log["results"][str(joint_target)] = recorded_data + + if output_log["results"]: + if node.log_filepath: + filename = node.log_filepath + else: + timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") + filename = f"tcp_accuracy_{timestamp}.json" + + with open(filename, "w") as f: + json.dump(output_log, f, indent=4) + node.get_logger().info(f"Saved TCP accuracy to {filename}") except (KeyboardInterrupt, ExternalShutdownException): pass diff --git a/flowstate/aic_flowstate_ros_bridge/src/aic_flowstate_ros_bridge_main.cpp b/flowstate/aic_flowstate_ros_bridge/src/aic_flowstate_ros_bridge_main.cpp index b5efa9da0..e80cc3c3b 100644 --- a/flowstate/aic_flowstate_ros_bridge/src/aic_flowstate_ros_bridge_main.cpp +++ b/flowstate/aic_flowstate_ros_bridge/src/aic_flowstate_ros_bridge_main.cpp @@ -137,6 +137,15 @@ int main(int argc, char* argv[]) { robot_control_bridge_config.task_settings_file()); params.emplace_back("joint_task_settings_file", robot_control_bridge_config.joint_task_settings_file()); + params.emplace_back("time_to_target_seconds", + robot_control_bridge_config.time_to_target_seconds()); + params.emplace_back("control_mode", + robot_control_bridge_config.control_mode()); + + const auto& critical_mass_proto = robot_control_bridge_config.critical_mass(); + std::vector critical_mass(critical_mass_proto.begin(), + critical_mass_proto.end()); + params.emplace_back("critical_mass", critical_mass); const auto& override_joint_names_proto = s.override_joint_names(); std::vector override_joint_names( override_joint_names_proto.begin(), override_joint_names_proto.end()); diff --git a/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.cpp b/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.cpp index 0de32ea75..c6594f9b8 100644 --- a/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.cpp +++ b/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.cpp @@ -19,7 +19,9 @@ #include #include +#include #include +#include #include #include @@ -58,6 +60,28 @@ constexpr const char* kFlowstateZenohRouterParamName = "flowstate_zenoh_router_address"; constexpr const char* kRestartConnectionRetriesParamName = "restart_connection_retries"; +constexpr const char* kTimeToTargetSecondsParamName = "time_to_target_seconds"; +constexpr const char* kControlModeParamName = "control_mode"; +constexpr const char* kCriticalMassParamName = "critical_mass"; + +namespace { + +inline void SetDiagonal6x6(google::protobuf::RepeatedField* field, + const std::vector& diag) { + field->Clear(); + field->Resize(36, 0.0); + for (int i = 0; i < 6; ++i) { + field->Set(i * 7, diag[i]); + } +} + +inline void SetDiagonal6x6(google::protobuf::RepeatedField* field, + const intrinsic_proto::icon::CartVec6& diag) { + SetDiagonal6x6( + field, {diag.x(), diag.y(), diag.z(), diag.rx(), diag.ry(), diag.rz()}); +} + +} // namespace ///============================================================================= void RobotControlBridge::declare_ros_parameters( @@ -73,13 +97,20 @@ void RobotControlBridge::declare_ros_parameters( param_interface->declare_parameter(kPartNameParamName, rclcpp::ParameterValue{"arm"}); param_interface->declare_parameter(kFTPartNameParamName, - rclcpp::ParameterValue{"ft_sensor"}); + rclcpp::ParameterValue{""}); param_interface->declare_parameter(kAgentBridgeTaskSettingsFileParamName, rclcpp::ParameterValue{""}); param_interface->declare_parameter(kAgentBridgeJointTaskSettingsFileParamName, rclcpp::ParameterValue{""}); param_interface->declare_parameter(kRestartConnectionRetriesParamName, rclcpp::ParameterValue{10}); + param_interface->declare_parameter(kTimeToTargetSecondsParamName, + rclcpp::ParameterValue{0.1}); + param_interface->declare_parameter(kControlModeParamName, + rclcpp::ParameterValue{"admittance"}); + param_interface->declare_parameter(kCriticalMassParamName, + rclcpp::ParameterValue{std::vector{ + 5.0, 5.0, 5.0, 5.0, 5.0, 5.0}}); } ///============================================================================= @@ -102,12 +133,25 @@ bool RobotControlBridge::initialize( .get_value(); data_->part_name_ = param_interface->get_parameter(kPartNameParamName) .get_value(); - data_->ft_sensor_part_name_ = + std::string param_ft_sensor_part_name = param_interface->get_parameter(kFTPartNameParamName) .get_value(); + if (!param_ft_sensor_part_name.empty()) { + data_->ft_sensor_part_name_ = param_ft_sensor_part_name; + } else { + data_->ft_sensor_part_name_ = std::nullopt; + } data_->restart_connection_retries_ = param_interface->get_parameter(kRestartConnectionRetriesParamName) .get_value(); + data_->time_to_target_seconds_ = + param_interface->get_parameter(kTimeToTargetSecondsParamName) + .get_value(); + data_->critical_mass_ = param_interface->get_parameter(kCriticalMassParamName) + .get_value>(); + std::string control_mode_str = + param_interface->get_parameter(kControlModeParamName) + .get_value(); std::filesystem::path task_settings_file = param_interface->get_parameter(kAgentBridgeTaskSettingsFileParamName) .get_value(); @@ -169,6 +213,102 @@ bool RobotControlBridge::initialize( "filepath for loading default task_settings."; throw std::runtime_error("'joint_task_settings_file' parameter is empty."); } + + if (control_mode_str == "admittance") { + data_->agent_bridge_fixed_params_.mutable_task_settings()->set_control_mode( + intrinsic_proto::icon::actions::proto::ControlMode::ADMITTANCE); + } else if (control_mode_str == "impedance") { + data_->agent_bridge_fixed_params_.mutable_task_settings()->set_control_mode( + intrinsic_proto::icon::actions::proto::ControlMode::IMPEDANCE); + } else { + LOG(ERROR) << "Invalid control_mode: " << control_mode_str; + throw std::runtime_error("Invalid control_mode parameter."); + } + +#ifdef USE_FIXED_CONTROL_PARAMETERS + { + std::filesystem::path fixed_json_path = + ament_index_cpp::get_package_share_directory( + "aic_flowstate_ros_bridge") + + "/config/fixed_task_settings.json"; + try { + std::ifstream f(fixed_json_path.string()); + if (!f.is_open()) { + throw std::runtime_error("Could not open JSON config file."); + } + nlohmann::json config = nlohmann::json::parse(f); + + auto target_pose_stiffness = + config["target_pose_stiffness"].get>(); + auto target_pose_damping = + config["target_pose_damping"].get>(); + auto target_mass = config["target_mass"].get>(); + + if (target_pose_stiffness.size() != 6 || + target_pose_damping.size() != 6 || target_mass.size() != 6) { + LOG(ERROR) << "Fixed task settings: target_pose_stiffness, " + "target_pose_damping, and target_mass must have exactly " + "6 elements."; + throw std::runtime_error( + "Fixed task settings must have exactly 6 elements for pose " + "stiffness, damping, and mass."); + } + + auto* mu = data_->agent_bridge_fixed_params_.mutable_motion_update(); + auto* target_stiffness = mu->mutable_target_stiffness(); + auto* target_damping = mu->mutable_target_damping(); + auto* target_mass_proto = mu->mutable_target_mass(); + SetDiagonal6x6(target_stiffness->mutable_data(), target_pose_stiffness); + SetDiagonal6x6(target_damping->mutable_data(), target_pose_damping); + SetDiagonal6x6(target_mass_proto->mutable_data(), target_mass); + + auto target_joint_stiffness = + config["target_joint_stiffness"].get>(); + auto target_joint_damping = + config["target_joint_damping"].get>(); + + if (target_joint_stiffness.size() != 6 || + target_joint_damping.size() != 6) { + LOG(ERROR) << "Fixed task settings: target_joint_stiffness and " + "target_joint_damping must have exactly 6 elements."; + throw std::runtime_error( + "Fixed task settings must have exactly 6 elements for joint " + "stiffness and damping."); + } + + auto* mu_joint = + data_->agent_bridge_joint_fixed_params_.mutable_motion_update(); + auto* tjs = mu_joint->mutable_target_stiffness(); + auto* tjd = mu_joint->mutable_target_damping(); + tjs->clear_joints(); + tjd->clear_joints(); + for (double v : target_joint_stiffness) { + tjs->add_joints(v); + } + for (double v : target_joint_damping) { + tjd->add_joints(v); + } + + std::string mode_str = config["control_mode"].get(); + auto* ts = data_->agent_bridge_fixed_params_.mutable_task_settings(); + if (mode_str == "admittance") { + ts->set_control_mode( + intrinsic_proto::icon::actions::proto::ControlMode::ADMITTANCE); + } else if (mode_str == "impedance") { + ts->set_control_mode( + intrinsic_proto::icon::actions::proto::ControlMode::IMPEDANCE); + } else { + LOG(ERROR) << "Invalid control_mode: " << mode_str; + throw std::runtime_error("Invalid control_mode parameter."); + } + + } catch (const std::exception& e) { + LOG(ERROR) << "Failed to read fixed_task_settings.json: " << e.what(); + throw std::runtime_error("Failed to read fixed_task_settings.json"); + } + } +#endif + // Set default taring cycle of 100 // todo(johntgz) set this as a ros parameter data_->tare_ft_sensor_fixed_params_.set_num_taring_cycles(100); @@ -677,26 +817,37 @@ bool RobotControlBridge::startControllerAction() { // Define ActionDescriptors for both the AgentBridge and AgentBridgeJoint // actions ActionDescriptor agent_bridge_descriptor = - ActionDescriptor( - intrinsic::icon::AgentBridgeInfo::kActionTypeName, kAgentBridgeId, - {{intrinsic::icon::AgentBridgeInfo::kSlotName, data_->part_name_}}) - .WithFixedParams(data_->agent_bridge_fixed_params_); + data_->ft_sensor_part_name_.has_value() + ? ActionDescriptor( + intrinsic::icon::AgentBridgeInfo::kActionTypeName, + kAgentBridgeId, + {{intrinsic::icon::AgentBridgeInfo::kSlotName, + data_->part_name_}, + {intrinsic::icon::AgentBridgeInfo::kForceTorqueSlotName, + data_->ft_sensor_part_name_.value()}}) + .WithFixedParams(data_->agent_bridge_fixed_params_) + : ActionDescriptor(intrinsic::icon::AgentBridgeInfo::kActionTypeName, + kAgentBridgeId, + {{intrinsic::icon::AgentBridgeInfo::kSlotName, + data_->part_name_}}) + .WithFixedParams(data_->agent_bridge_fixed_params_); ActionDescriptor agent_bridge_joint_descriptor = - ActionDescriptor(intrinsic::icon::AgentBridgeJointInfo::kActionTypeName, - kAgentBridgeJointId, - {{intrinsic::icon::AgentBridgeJointInfo::kSlotName, - data_->part_name_}}) - .WithFixedParams(data_->agent_bridge_joint_fixed_params_); - - ActionDescriptor tare_ft_sensor_descriptor = - ActionDescriptor( - intrinsic::icon::TareForceTorqueSensorInfo::kActionTypeName, - kTareForceTorqueSensorId, - {{intrinsic::icon::TareForceTorqueSensorInfo:: - kForceTorqueSensorSlotName, - data_->ft_sensor_part_name_}}) - .WithFixedParams(data_->tare_ft_sensor_fixed_params_); + data_->ft_sensor_part_name_.has_value() + ? ActionDescriptor( + intrinsic::icon::AgentBridgeJointInfo::kActionTypeName, + kAgentBridgeJointId, + {{intrinsic::icon::AgentBridgeJointInfo::kSlotName, + data_->part_name_}, + {intrinsic::icon::AgentBridgeJointInfo::kForceTorqueSlotName, + data_->ft_sensor_part_name_.value()}}) + .WithFixedParams(data_->agent_bridge_joint_fixed_params_) + : ActionDescriptor( + intrinsic::icon::AgentBridgeJointInfo::kActionTypeName, + kAgentBridgeJointId, + {{intrinsic::icon::AgentBridgeJointInfo::kSlotName, + data_->part_name_}}) + .WithFixedParams(data_->agent_bridge_joint_fixed_params_); // Add the AgentBridge and AgentBridgeJoint actions to the session, then // create StreamWriters for each of the actions. @@ -722,13 +873,26 @@ bool RobotControlBridge::startControllerAction() { data_->agent_bridge_joint_action_ = agent_bridge_joint_action_or.value(); // Add the TareForceTorqueSensor action to the current session - auto tare_action_or = data_->session_->AddAction(tare_ft_sensor_descriptor); - if (!tare_action_or.ok()) { - LOG(ERROR) << "Failed to add TareForceTorqueSensor Action: " - << tare_action_or.status().message().data(); - return false; + if (data_->ft_sensor_part_name_.has_value()) { + ActionDescriptor tare_ft_sensor_descriptor = + ActionDescriptor( + intrinsic::icon::TareForceTorqueSensorInfo::kActionTypeName, + kTareForceTorqueSensorId, + {{intrinsic::icon::TareForceTorqueSensorInfo:: + kForceTorqueSensorSlotName, + data_->ft_sensor_part_name_.value()}}) + .WithFixedParams(data_->tare_ft_sensor_fixed_params_); + + auto tare_action_or = data_->session_->AddAction(tare_ft_sensor_descriptor); + if (!tare_action_or.ok()) { + LOG(ERROR) << "Failed to add TareForceTorqueSensor Action: " + << tare_action_or.status().message().data(); + return false; + } + data_->tare_action_ = tare_action_or.value(); + } else { + data_->tare_action_ = std::nullopt; } - data_->tare_action_ = tare_action_or.value(); // Create StreamWriter for the AgentBridge action auto agent_bridge_writer_or = @@ -824,8 +988,9 @@ bool RobotControlBridge::startControllerSession() { // Start ICON Session std::vector parts = {data_->part_name_}; - if (data_->ft_sensor_part_name_ != data_->part_name_) { - parts.push_back(data_->ft_sensor_part_name_); + if (data_->ft_sensor_part_name_.has_value() && + data_->ft_sensor_part_name_.value() != data_->part_name_) { + parts.push_back(data_->ft_sensor_part_name_.value()); } auto session_or = Session::Start(icon_channel_or.value(), parts); @@ -853,6 +1018,7 @@ bool RobotControlBridge::resetMotionUpdate() { auto* target_state = initial_motion_update->mutable_target_state(); target_state->mutable_velocity()->Resize(6, 0.0); +#ifndef USE_FIXED_CONTROL_PARAMETERS // Use max values from task settings for initial stiffness, damping, and // mass auto* target_stiffness = initial_motion_update->mutable_target_stiffness(); @@ -864,42 +1030,27 @@ bool RobotControlBridge::resetMotionUpdate() { target_mass->mutable_data()->Resize(36, 0.0); if (data_->agent_bridge_fixed_params_.task_settings().has_max_stiffness() && - data_->agent_bridge_fixed_params_.task_settings().has_max_damping() && - data_->agent_bridge_fixed_params_.task_settings() - .has_mass_for_critical_damping()) { + data_->agent_bridge_fixed_params_.task_settings().has_max_damping()) { const auto& max_stiffness = data_->agent_bridge_fixed_params_.task_settings().max_stiffness(); const auto& max_damping = data_->agent_bridge_fixed_params_.task_settings().max_damping(); - const auto& critical_mass = - data_->agent_bridge_fixed_params_.task_settings() - .mass_for_critical_damping(); - - target_stiffness->set_data(0, max_stiffness.x()); - target_stiffness->set_data(7, max_stiffness.y()); - target_stiffness->set_data(14, max_stiffness.z()); - target_stiffness->set_data(21, max_stiffness.rx()); - target_stiffness->set_data(28, max_stiffness.ry()); - target_stiffness->set_data(35, max_stiffness.rz()); - - target_damping->set_data(0, max_damping.x()); - target_damping->set_data(7, max_damping.y()); - target_damping->set_data(14, max_damping.z()); - target_damping->set_data(21, max_damping.rx()); - target_damping->set_data(28, max_damping.ry()); - target_damping->set_data(35, max_damping.rz()); - - target_mass->set_data(0, critical_mass.x()); - target_mass->set_data(7, critical_mass.y()); - target_mass->set_data(14, critical_mass.z()); - target_mass->set_data(21, critical_mass.rx()); - target_mass->set_data(28, critical_mass.ry()); - target_mass->set_data(35, critical_mass.rz()); + + SetDiagonal6x6(target_stiffness->mutable_data(), max_stiffness); + SetDiagonal6x6(target_damping->mutable_data(), max_damping); + + if (data_->critical_mass_.size() >= 6) { + SetDiagonal6x6(target_mass->mutable_data(), data_->critical_mass_); + } else { + LOG(ERROR) << "critical_mass parameter does not have 6 elements."; + return false; + } } else { - LOG(ERROR) << "Task settings missing max_stiffness, max_damping, or " - "mass_for_critical_damping parameters."; + LOG(ERROR) + << "Task settings missing max_stiffness or max_damping parameters."; return false; } +#endif auto* fw = initial_motion_update->mutable_feedforward_wrench_at_tip(); fw->set_x(0); @@ -925,6 +1076,7 @@ bool RobotControlBridge::resetMotionUpdate() { ->mutable_velocity() ->Resize(data_->num_joints_, 0.0); +#ifndef USE_FIXED_CONTROL_PARAMETERS auto* target_joint_stiffness = initial_joint_motion_update->mutable_target_stiffness(); auto* target_joint_damping = @@ -945,6 +1097,7 @@ bool RobotControlBridge::resetMotionUpdate() { target_joint_damping->set_joints(i, damping.joints(i)); } } +#endif return true; } @@ -1092,6 +1245,7 @@ void RobotControlBridge::MotionUpdateCallback( target_state->add_velocity(msg->velocity.angular.y); target_state->add_velocity(msg->velocity.angular.z); +#ifndef USE_FIXED_CONTROL_PARAMETERS // Map stiffness and damping parameters auto* stiffness = proto_msg.mutable_target_stiffness(); auto* damping = proto_msg.mutable_target_damping(); @@ -1101,6 +1255,7 @@ void RobotControlBridge::MotionUpdateCallback( stiffness->add_data(msg->target_stiffness[i]); damping->add_data(msg->target_damping[i]); } +#endif // Map feedforward wrench at tip auto* fw = proto_msg.mutable_feedforward_wrench_at_tip(); @@ -1122,7 +1277,7 @@ void RobotControlBridge::MotionUpdateCallback( // Set time_to_target_seconds to a default of 1.1 * controller period (0.002 // s), so it will reach the target as fast as possible - proto_msg.set_time_to_target_seconds(0.0022); + proto_msg.set_time_to_target_seconds(data_->time_to_target_seconds_); // Write the MotionUpdate proto message to the AgentBridge action auto status = data_->agent_bridge_writer_->Write(proto_msg); @@ -1190,6 +1345,7 @@ void RobotControlBridge::JointMotionUpdateCallback( target_state->add_velocity(vel); } +#ifndef USE_FIXED_CONTROL_PARAMETERS // Map the stiffness and damping parameters auto* stiffness = proto_msg.mutable_target_stiffness(); auto* damping = proto_msg.mutable_target_damping(); @@ -1201,6 +1357,7 @@ void RobotControlBridge::JointMotionUpdateCallback( for (double d : msg->target_damping) { damping->add_joints(d); } +#endif // Map the feedforward torque auto* ff_torque = proto_msg.mutable_target_feedforward_torque(); @@ -1211,7 +1368,7 @@ void RobotControlBridge::JointMotionUpdateCallback( // Set time_to_target_seconds to a default of 1.1 * controller period (0.002 // s), so it will reach the target as fast as possible - proto_msg.set_time_to_target_seconds(0.0022); + proto_msg.set_time_to_target_seconds(data_->time_to_target_seconds_); // Write the JointMotionUpdate proto message to the AgentBridgeJoint action auto status = data_->agent_bridge_joint_writer_->Write(proto_msg); diff --git a/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.hpp b/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.hpp index 08ed23ef9..8e19c45c0 100644 --- a/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.hpp +++ b/flowstate/aic_flowstate_ros_bridge/src/robot_control_bridge.hpp @@ -210,13 +210,15 @@ class RobotControlBridge : public BridgeInterface { bool connected_to_controller_; std::string part_name_; - std::string ft_sensor_part_name_; + std::optional ft_sensor_part_name_; std::string instance_; std::string server_address_; std::size_t num_joints_; int restart_connection_retries_; uint8_t target_mode_value_; std::optional last_part_status_timestamp_ns_; + double time_to_target_seconds_; + std::vector critical_mass_; aic_control_interfaces::msg::ControllerState controller_state_; std::mutex controller_state_mutex_;