From 4dd4c4bc77d0c7571d8629031440def594d1471e Mon Sep 17 00:00:00 2001 From: David Schmidt Date: Tue, 26 Mar 2019 15:45:45 +0100 Subject: [PATCH] Remove unused ros_websocket Change-Id: I97c6d9c603ea330b15663cd542fc5a9515ddb110 GitOrigin-RevId: 80c828ccdecc7847dd7e69caf9f42f5618aec8c3 --- bazel/repositories.bzl | 21 --- src/app_charts/ros/BUILD.bazel | 1 - src/app_charts/ros/cloud/ros-websocket.yaml | 48 ------ src/docker/ros_websocket/BUILD.bazel | 27 --- src/docker/ros_websocket/ros_websocket.py | 51 ------ src/docker/ros_websocket/websocket.launch | 7 - third_party/rosbridge_suite.BUILD | 177 -------------------- third_party/tf2_web_republisher.BUILD | 54 ------ 8 files changed, 386 deletions(-) delete mode 100644 src/app_charts/ros/cloud/ros-websocket.yaml delete mode 100644 src/docker/ros_websocket/BUILD.bazel delete mode 100644 src/docker/ros_websocket/ros_websocket.py delete mode 100644 src/docker/ros_websocket/websocket.launch delete mode 100644 third_party/rosbridge_suite.BUILD delete mode 100644 third_party/tf2_web_republisher.BUILD diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 9c6417fd..898bb60a 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -488,27 +488,6 @@ def cloud_robotics_repositories(): urls = ["https://github.com/GT-RAIL/rosauth/archive/0.1.7.tar.gz"], ) - _maybe( - http_archive, - name = "com_github_robotwebtools_rosbridge_suite", - build_file = "@cloud_robotics//third_party:rosbridge_suite.BUILD", - sha256 = "6499b6bb1e0a2858e762f5e7c8a6af512d308233e6d9fd483e2019c6798f3b38", - strip_prefix = "rosbridge_suite-0.8.4", - urls = [ - "https://mirror.bazel.build/github.com/RobotWebTools/rosbridge_suite/archive/0.8.4.tar.gz", - "https://github.com/RobotWebTools/rosbridge_suite/archive/0.8.4.tar.gz", - ], - ) - - _maybe( - http_archive, - name = "com_github_robotwebtools_tf2_web_republisher", - build_file = "@cloud_robotics//third_party:tf2_web_republisher.BUILD", - sha256 = "a0a6278937fe72eb6e30b62ad39c8f52f9cf5ddc6b61e43490d0d63749037a29", - strip_prefix = "tf2_web_republisher-0.3.2", - urls = ["https://github.com/RobotWebTools/tf2_web_republisher/archive/0.3.2.tar.gz"], - ) - # Boost SOURCEFORGE_MIRRORS = ["phoenixnap", "newcontinuum", "cfhcable", "superb-sea2", "cytranet", "iweb", "gigenet", "ayera", "astuteinternet", "pilotfiber", "svwh"] _maybe( diff --git a/src/app_charts/ros/BUILD.bazel b/src/app_charts/ros/BUILD.bazel index 22a16f78..fdb24df5 100644 --- a/src/app_charts/ros/BUILD.bazel +++ b/src/app_charts/ros/BUILD.bazel @@ -13,7 +13,6 @@ core_app_chart( "cloud-tunnel": "//src/go/cmd/cloud-tunnel", "ros-adapter": "//src/docker/ros_adapter:ros_adapter", "ros-log": "//src/docker/ros_log", - "ros-websocket": "//src/docker/ros_websocket", "roscore": "//src/docker/ros:roscore", "roscore-sim": "//src/docker/ros:roscore_sim", }, diff --git a/src/app_charts/ros/cloud/ros-websocket.yaml b/src/app_charts/ros/cloud/ros-websocket.yaml deleted file mode 100644 index fac4cd25..00000000 --- a/src/app_charts/ros/cloud/ros-websocket.yaml +++ /dev/null @@ -1,48 +0,0 @@ -{{ range .Values.robots }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: ros-websocket-{{ .name }} -spec: - replicas: 1 - selector: - matchLabels: - id: "{{ .name }}" - app: ros-websocket - template: - metadata: - labels: - id: "{{ .name }}" - app: ros-websocket - spec: - containers: - - env: - - name: GOOGLE_CLOUD_PROJECT - value: {{ $.Values.project }} - - name: ROS_MASTER_URI - value: http://roscore-cloud-{{ .name }}.app-ros.svc.cluster.local:11311 - - name: ROS_IP - valueFrom: - fieldRef: - fieldPath: "status.podIP" - - name: ROBOT_NAME - value: "{{ .name }}" - image: {{ $.Values.images.ros_websocket }} - name: ros-websocket - ports: - - containerPort: 9090 ---- -apiVersion: v1 -kind: Service -metadata: - name: ros-websocket-{{ .name }} -spec: - ports: - - name: websocket - port: 9090 - selector: - id: "{{ .name }}" - app: ros-websocket - type: ClusterIP ---- -{{ end }} diff --git a/src/docker/ros_websocket/BUILD.bazel b/src/docker/ros_websocket/BUILD.bazel deleted file mode 100644 index cece8b59..00000000 --- a/src/docker/ros_websocket/BUILD.bazel +++ /dev/null @@ -1,27 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load("@io_bazel_rules_docker//python:image.bzl", "py_image") - -py_image( - name = "ros_websocket", - srcs = ["ros_websocket.py"], - base = "//src/docker/ros:base", - data = [ - ":websocket.launch", - "@com_github_robotwebtools_rosbridge_suite//:rosapi_node", - "@com_github_robotwebtools_rosbridge_suite//:rosbridge_server_files", - "@com_github_robotwebtools_rosbridge_suite//:rosbridge_websocket", - "@com_github_robotwebtools_tf2_web_republisher//:tf2_web_republisher", - ], - main = "ros_websocket.py", - deps = [ - "//src/python/rosenv", - "@com_github_robotwebtools_rosbridge_suite//:rosapi_msgs_py", - "@com_github_robotwebtools_tf2_web_republisher//:msgs_py", - "@com_github_ros_common_msgs//:actionlib_msgs_py", - "@com_github_ros_common_msgs//:nav_msgs_py", - "@com_github_ros_common_msgs//:sensor_msgs_py", - "@com_github_ros_planning_navigation_msgs//:move_base_msgs_py", - "@com_github_ros_ros_comm//:roslaunch", - ], -) diff --git a/src/docker/ros_websocket/ros_websocket.py b/src/docker/ros_websocket/ros_websocket.py deleted file mode 100644 index 5cb161ee..00000000 --- a/src/docker/ros_websocket/ros_websocket.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2019 The Cloud Robotics Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -import rosenv - - -def main(): - with rosenv.RosEnv() as re: - re.add_package("com_github_robotwebtools_rosbridge_suite/rosapi") - re.add_package("com_github_robotwebtools_rosbridge_suite/rosbridge_server") - re.add_package( - "com_github_robotwebtools_tf2_web_republisher", - "tf2_web_republisher") - re.add_package("com_github_ros_common_msgs/actionlib_msgs") - re.add_package("com_github_ros_common_msgs/nav_msgs") - re.add_package("com_github_ros_common_msgs/sensor_msgs") - re.add_package("com_github_ros_planning_navigation_msgs/move_base_msgs") - re.add_package("com_github_ros_ros_comm/tools/rosgraph") - re.add_package("com_github_ros_ros_comm/tools/roslaunch") - re.add_package("com_github_ros_ros_comm/tools/rosnode") - re.add_to_path("com_github_ros_catkin") - re.add_to_path("com_github_ros_infrastructure_rospkg") - re.add_binary( - "com_github_robotwebtools_rosbridge_suite/rosapi_node", - "rosapi") - re.add_binary( - "com_github_robotwebtools_rosbridge_suite/rosbridge_websocket", - "rosbridge_server") - - launch = os.path.join( - re.runfiles, "cloud_robotics/src/docker/ros_websocket/websocket.launch") - - import roslaunch - roslaunch.main(["roslaunch", "--wait", launch]) - - -if __name__ == "__main__": - main() diff --git a/src/docker/ros_websocket/websocket.launch b/src/docker/ros_websocket/websocket.launch deleted file mode 100644 index 905e951a..00000000 --- a/src/docker/ros_websocket/websocket.launch +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/third_party/rosbridge_suite.BUILD b/third_party/rosbridge_suite.BUILD deleted file mode 100644 index 649e97e5..00000000 --- a/third_party/rosbridge_suite.BUILD +++ /dev/null @@ -1,177 +0,0 @@ -# Description: -# Server Implementations of the rosbridge v2 Protocol -# http://robotwebtools.org/ -# -load("@cloud_robotics//bazel/build_rules:copy.bzl", "copy_files") -load("@cloud_robotics//bazel/build_rules:rosmsg.bzl", "rosmsg") -load("@ros_deps//:requirements.bzl", "requirement") - -package( - default_visibility = ["//visibility:public"], -) - -licenses(["notice"]) # BSD - -py_library( - name = "internal_backports", - srcs = glob([ - "rosbridge_server/src/backports/*.py", - "rosbridge_server/src/backports/ssl_match_hostname/*.py", - ]), - imports = ["rosbridge_server/src"], -) - -py_library( - name = "internal_tornado", - srcs = glob([ - "rosbridge_server/src/tornado/*.py", - "rosbridge_server/src/tornado/platform/*.py", - ]), - imports = ["rosbridge_server/src"], - deps = [ - ":internal_backports", - requirement("Twisted"), - ], -) - -py_library( - name = "rosbridge_library", - srcs = glob([ - "rosbridge_library/src/rosbridge_library/*.py", - "rosbridge_library/src/rosbridge_library/capabilities/*.py", - "rosbridge_library/src/rosbridge_library/internal/*.py", - "rosbridge_library/src/rosbridge_library/util/*.py", - ]), - imports = ["rosbridge_library/src"], - deps = [ - "@com_github_ros_ros//:roslib_py", - "@com_github_ros_ros_comm//:rospy", - "@com_github_ros_ros_comm//:rosservice_lib", - "@com_github_ros_ros_comm//:rostopic_lib", - requirement("pymongo"), - requirement("Pillow"), - ], -) - -filegroup( - name = "rosbridge_server_files", - srcs = [ - "rosbridge_server/launch/rosbridge_websocket.launch", - "rosbridge_server/package.xml", - ], -) - -py_library( - name = "rosbridge_server", - srcs = glob([ - "rosbridge_server/src/rosbridge_server/*.py", - ]), - imports = ["rosbridge_server/src"], - deps = [ - ":internal_tornado", - ":rosbridge_library", - "@com_github_gt_rail_rosauth//:rosauth_msgs_py", - "@com_github_ros_ros_comm//:rospy", - requirement("Twisted"), - ], -) - -rosmsg( - name = "rosapi_msgs", - srcs = glob([ - "rosapi/msg/*.msg", - "rosapi/srv/*.srv", - ]), - data = ["rosapi/package.xml"], - rospkg = "rosapi", -) - -# This file turns `rosapi` into a Python namespace, preventing conflict with -# the `rosapi` directory created by the rosmsg() macro. -genrule( - name = "namespaced_init_py", - outs = ["__namespaced__/rosapi/__init__.py"], - cmd = """cat > $(@) << 'EOF' -try: - import pkg_resources - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - __path__ = pkgutil.extend_path(__path__, __name__) -EOF -""", -) - -copy_files( - name = "rosapi_srcs", - srcs = [ - "rosapi/src/rosapi/glob_helper.py", - "rosapi/src/rosapi/objectutils.py", - "rosapi/src/rosapi/params.py", - "rosapi/src/rosapi/proxy.py", - ], - outdir = "__namespaced__/rosapi", -) - -py_library( - name = "rosapi", - srcs = [ - "__namespaced__/rosapi/__init__.py", - ":rosapi_srcs", - ], - data = [ - # These targets bring in the package.xml files, which are required - # because rosapi uses `from ros import rosnode` to import from a - # package located at runtime. - "@com_github_ros_ros_comm//:rosgraph_files", - "@com_github_ros_ros_comm//:rosnode_files", - ], - imports = ["__namespaced__"], - deps = [ - ":rosapi_msgs_py", - ":rosbridge_library", - "@com_github_gt_rail_rosauth//:rosauth_msgs_py", - "@com_github_ros_ros//:roslib_py", - "@com_github_ros_ros_comm//:rosgraph", - "@com_github_ros_ros_comm//:rosnode_lib", - "@com_github_ros_ros_comm//:rospy", - "@com_github_ros_ros_comm//:rosservice_lib", - "@com_github_ros_ros_comm//:rostopic_lib", - requirement("Twisted"), - ], -) - -# py_binary expects all files to end with .py. We also move it out of rosapi/, -# otherwise Bazel will create an empty rosapi/__init__.py and interfere with our -# attempts to make `rosapi` a namespace. https://github.com/bazelbuild/bazel/issues/3998 -# -# TODO(rodrigoq): if #3998 is resolved, or if we can make rules_docker work with -# --noexperimental_python_import_all_repositories, see if we can avoid changing -# the path. -genrule( - name = "rename_rosapi_node", - srcs = ["rosapi/scripts/rosapi_node"], - outs = ["__scripts__/rosapi_node.py"], - cmd = "cp $< $@", -) - -py_binary( - name = "rosapi_node", - srcs = ["__scripts__/rosapi_node.py"], - data = ["rosapi/package.xml"], - deps = [ - ":rosapi", - ":rosapi_msgs_py", - "@com_github_ros_ros_comm//:rospy", - ], -) - -py_binary( - name = "rosbridge_websocket", - srcs = ["rosbridge_server/scripts/rosbridge_websocket.py"], - deps = [ - ":internal_tornado", - ":rosbridge_library", - ":rosbridge_server", - ], -) diff --git a/third_party/tf2_web_republisher.BUILD b/third_party/tf2_web_republisher.BUILD deleted file mode 100644 index b508c0a1..00000000 --- a/third_party/tf2_web_republisher.BUILD +++ /dev/null @@ -1,54 +0,0 @@ -# Description: -# Republishing of Selected TFs -# http://robotwebtools.org/ -# -load("@cloud_robotics//bazel/build_rules:rosmsg.bzl", "rosmsg") -load("@ros_deps//:requirements.bzl", "requirement") - -package( - default_visibility = ["//visibility:public"], -) - -licenses(["notice"]) # BSD - -rosmsg( - name = "msgs", - srcs = glob([ - "msg/*.msg", - "services/*.srv", - "action/*.action", - ]), - data = ["package.xml"], - rospkg = "tf2_web_republisher", - deps = [ - "@com_github_ros_common_msgs//:actionlib_msgs", - "@com_github_ros_common_msgs//:geometry_msgs", - ], -) - -cc_library( - name = "tf_pair", - hdrs = ["include/tf_pair.h"], - includes = ["include"], - deps = [ - "@com_github_ros_geometry//:tf_lib", - ], -) - -cc_binary( - name = "tf2_web_republisher", - srcs = ["src/tf_web_republisher.cpp"], - copts = ["-Wno-reorder"], - data = ["package.xml"], - linkstatic = 1, - deps = [ - ":msgs_cpp", - ":tf_pair", - "@boost//:thread", - "@com_github_ros_actionlib//:actionlib", - "@com_github_ros_common_msgs//:geometry_msgs_cpp", - "@com_github_ros_geometry//:tf_lib", - "@com_github_ros_geometry2//:tf2_ros", - "@com_github_ros_ros_comm//:roscpp_lib", - ], -)