|
| 1 | +# Copyright 2025 Intrinsic Innovation LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import os |
| 16 | +from ament_index_python.packages import get_package_share_directory |
| 17 | + |
| 18 | +from launch import LaunchDescription |
| 19 | +from launch.actions import DeclareLaunchArgument |
| 20 | +from launch.substitutions import LaunchConfiguration |
| 21 | +from launch_ros.actions import LifecycleNode |
| 22 | + |
| 23 | + |
| 24 | +def generate_launch_description(): |
| 25 | + return LaunchDescription( |
| 26 | + [ |
| 27 | + DeclareLaunchArgument( |
| 28 | + "service_tunnel", |
| 29 | + default_value="localhost:17080", |
| 30 | + description="Service tunnel address", |
| 31 | + ), |
| 32 | + DeclareLaunchArgument( |
| 33 | + "flowstate_zenoh_router_address", |
| 34 | + default_value="tcp/localhost:17447", |
| 35 | + description="Flowstate Zenoh router address", |
| 36 | + ), |
| 37 | + DeclareLaunchArgument( |
| 38 | + "autostart", |
| 39 | + default_value="true", |
| 40 | + description="Automatically start the bridge", |
| 41 | + ), |
| 42 | + DeclareLaunchArgument( |
| 43 | + "server_address", |
| 44 | + default_value="localhost:17080", |
| 45 | + description="Address of the robot controller application layer server", |
| 46 | + ), |
| 47 | + DeclareLaunchArgument( |
| 48 | + "instance", |
| 49 | + default_value="robot_controller", |
| 50 | + description="Name of the robot controller service/resource instance", |
| 51 | + ), |
| 52 | + DeclareLaunchArgument( |
| 53 | + "part_name", default_value="arm", description="Part to control" |
| 54 | + ), |
| 55 | + DeclareLaunchArgument( |
| 56 | + "robot_joint_state_topic", default_value="/joint_states", description="" |
| 57 | + ), |
| 58 | + DeclareLaunchArgument( |
| 59 | + "force_torque_topic", |
| 60 | + default_value="/fts_broadcaster/wrench", |
| 61 | + description="", |
| 62 | + ), |
| 63 | + DeclareLaunchArgument( |
| 64 | + "robot_base_frame_id", |
| 65 | + default_value="robot/robot/base_link", |
| 66 | + description="", |
| 67 | + ), |
| 68 | + DeclareLaunchArgument( |
| 69 | + "force_torque_sensor_frame_id", |
| 70 | + default_value="force_torque_sensor/force_torque_sensor/AtiForceTorqueSensor", |
| 71 | + description="", |
| 72 | + ), |
| 73 | + LifecycleNode( |
| 74 | + package="flowstate_ros_bridge", |
| 75 | + executable="flowstate_ros_bridge", |
| 76 | + name="flowstate_ros_bridge", |
| 77 | + namespace="", |
| 78 | + output="screen", |
| 79 | + parameters=[ |
| 80 | + { |
| 81 | + "autostart": True, |
| 82 | + "service_tunnel": LaunchConfiguration("service_tunnel"), |
| 83 | + "flowstate_zenoh_router_address": LaunchConfiguration( |
| 84 | + "flowstate_zenoh_router_address" |
| 85 | + ), |
| 86 | + "bridge_plugins": [ |
| 87 | + "flowstate_ros_bridge::ExecutiveBridge", |
| 88 | + "flowstate_ros_bridge::WorldBridge", |
| 89 | + "flowstate_ros_bridge::RobotControlBridge", |
| 90 | + ], |
| 91 | + "server_address": LaunchConfiguration("server_address"), |
| 92 | + "instance": LaunchConfiguration("instance"), |
| 93 | + "part_name": LaunchConfiguration("part_name"), |
| 94 | + "robot_joint_state_topic": LaunchConfiguration( |
| 95 | + "robot_joint_state_topic" |
| 96 | + ), |
| 97 | + "force_torque_topic": LaunchConfiguration("force_torque_topic"), |
| 98 | + "robot_base_frame_id": LaunchConfiguration( |
| 99 | + "robot_base_frame_id" |
| 100 | + ), |
| 101 | + "force_torque_sensor_frame_id": LaunchConfiguration( |
| 102 | + "force_torque_sensor_frame_id" |
| 103 | + ), |
| 104 | + "task_settings_file": os.path.join( |
| 105 | + "config", |
| 106 | + "default_task_settings.pbtxt", |
| 107 | + ), |
| 108 | + "joint_task_settings_file": os.path.join( |
| 109 | + "config", |
| 110 | + "default_joint_task_settings.pbtxt", |
| 111 | + ), |
| 112 | + } |
| 113 | + ], |
| 114 | + ), |
| 115 | + ] |
| 116 | + ) |
0 commit comments