v01
This commit is contained in:
70
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roscore
vendored
Executable file
70
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roscore
vendored
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2008, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import sys
|
||||
from optparse import OptionParser
|
||||
from rosmaster.master_api import NUM_WORKERS
|
||||
|
||||
NAME = 'roscore'
|
||||
|
||||
def _get_optparse():
|
||||
|
||||
parser = OptionParser(usage="usage: %prog [options]",
|
||||
prog=NAME,
|
||||
description="roscore will start up a ROS Master, a ROS Parameter Server and a rosout logging node",
|
||||
epilog="See http://www.ros.org/wiki/roscore"
|
||||
)
|
||||
parser.add_option("-p", "--port",
|
||||
dest="port", default=None,
|
||||
help="master port. Only valid if master is launched", metavar="PORT")
|
||||
parser.add_option("-v", action="store_true",
|
||||
dest="verbose", default=False,
|
||||
help="verbose printing")
|
||||
parser.add_option("-w", "--numworkers",
|
||||
dest="num_workers", default=NUM_WORKERS, type=int,
|
||||
help="override number of worker threads", metavar="NUM_WORKERS")
|
||||
parser.add_option("-t", "--timeout",
|
||||
dest="timeout",
|
||||
help="override the socket connection timeout (in seconds).", metavar="TIMEOUT")
|
||||
return parser
|
||||
|
||||
|
||||
parser = _get_optparse()
|
||||
(options, args) = parser.parse_args(sys.argv[1:])
|
||||
|
||||
if len(args) > 0:
|
||||
parser.error("roscore does not take arguments")
|
||||
|
||||
|
||||
import roslaunch
|
||||
roslaunch.main(['roscore', '--core'] + sys.argv[1:])
|
||||
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch
vendored
Executable file
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2008, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import roslaunch
|
||||
roslaunch.main()
|
||||
125
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-check
vendored
Executable file
125
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-check
vendored
Executable file
@@ -0,0 +1,125 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2009, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import rospkg
|
||||
|
||||
import roslaunch.rlutil
|
||||
import rosunit
|
||||
|
||||
def check_roslaunch_file(roslaunch_file, use_test_depends=False):
|
||||
print("checking", roslaunch_file)
|
||||
error_msg = roslaunch.rlutil.check_roslaunch(roslaunch_file, use_test_depends=use_test_depends)
|
||||
# error message has to be XML attr safe
|
||||
if error_msg:
|
||||
return "[%s]:\n\t%s"%(roslaunch_file,error_msg)
|
||||
|
||||
def check_roslaunch_dir(roslaunch_dir, use_test_depends=False):
|
||||
error_msgs = []
|
||||
for f in os.listdir(roslaunch_dir):
|
||||
if f.endswith('.launch'):
|
||||
roslaunch_file = os.path.join(roslaunch_dir, f)
|
||||
if os.path.isfile(roslaunch_file):
|
||||
error_msgs.append(check_roslaunch_file(roslaunch_file, use_test_depends=use_test_depends))
|
||||
# error message has to be XML attr safe
|
||||
return '\n'.join([e for e in error_msgs if e])
|
||||
|
||||
## run check and output test result file
|
||||
if __name__ == '__main__':
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser(usage="usage: \troslaunch-check [options] <file|directory> [env=value...]")
|
||||
# #3674
|
||||
parser.add_option("-o", "--output-file",
|
||||
dest="output_file", default=None,
|
||||
help="file to store test results in", metavar="FILE")
|
||||
parser.add_option("-t", "--use-test-depends",
|
||||
action="store_true", dest="test_depends", default=False,
|
||||
help="Assuming packages listed in test_depends are also installed")
|
||||
|
||||
options, args = parser.parse_args()
|
||||
if not args:
|
||||
parser.error('please specify a file or directory for roslaunch files to test')
|
||||
roslaunch_path = args[0]
|
||||
|
||||
# #2590: implementing this quick and dirty as this script should only be used by higher level tools
|
||||
env_vars = args[1:]
|
||||
for e in env_vars:
|
||||
var, val = e.split('=')
|
||||
os.environ[var] = val
|
||||
|
||||
pkg = rospkg.get_package_name(roslaunch_path)
|
||||
r = rospkg.RosPack()
|
||||
pkg_dir = r.get_path(pkg)
|
||||
|
||||
if os.path.isfile(roslaunch_path):
|
||||
error_msg = check_roslaunch_file(roslaunch_path, use_test_depends=options.test_depends)
|
||||
else:
|
||||
print("checking *.launch in directory", roslaunch_path)
|
||||
error_msg = check_roslaunch_dir(roslaunch_path, use_test_depends=options.test_depends)
|
||||
relpath = os.path.abspath(roslaunch_path)[len(os.path.abspath(pkg_dir))+1:]
|
||||
outname = relpath.replace('.', '_').replace(os.sep, '_')
|
||||
if outname == '_':
|
||||
outname = '_pkg'
|
||||
|
||||
if options.output_file:
|
||||
test_file = options.output_file
|
||||
# If we were given a test file name to write, then construct the
|
||||
# test name from it, to ensure uniqueness
|
||||
test_name = os.path.basename(test_file)
|
||||
else:
|
||||
test_file = rosunit.xml_results_file(pkg, "roslaunch_check_"+outname, is_rostest=False)
|
||||
test_name = roslaunch_path
|
||||
|
||||
print("...writing test results to", test_file)
|
||||
|
||||
dir_path = os.path.abspath(os.path.dirname(test_file))
|
||||
if not os.path.exists(dir_path):
|
||||
os.makedirs(dir_path)
|
||||
|
||||
if error_msg:
|
||||
print("FAILURE:\n%s"%error_msg, file=sys.stderr)
|
||||
with open(test_file, 'w') as f:
|
||||
message = "roslaunch check [%s] failed"%(roslaunch_path)
|
||||
f.write(rosunit.junitxml.test_failure_junit_xml(test_name, message, stdout=error_msg,
|
||||
class_name="roslaunch.RoslaunchCheck", testcase_name="%s_%s" % (pkg, outname)))
|
||||
print("wrote test file to [%s]"%test_file)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("passed")
|
||||
with open(test_file, 'w') as f:
|
||||
f.write(rosunit.junitxml.test_success_junit_xml(test_name,
|
||||
class_name="roslaunch.RoslaunchCheck", testcase_name="%s_%s" % (pkg, outname)))
|
||||
55
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-complete
vendored
Executable file
55
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-complete
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2013, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import roslaunch.core
|
||||
import roslaunch.arg_dump as roslaunch_arg_dump
|
||||
from roslaunch import rlutil
|
||||
import sys
|
||||
|
||||
try:
|
||||
args = rlutil.resolve_launch_arguments(sys.argv[1:])
|
||||
# Strip all other args: As we are completing they might be incomplete
|
||||
# and will lead to an error. Anyways we only want all possible args.
|
||||
args = args[0:1]
|
||||
roslaunch_args = roslaunch_arg_dump.get_args(args)
|
||||
except roslaunch.core.RLException:
|
||||
# stay silent for completion
|
||||
sys.exit(1)
|
||||
|
||||
#complete_args = [a + ":=" for a in sorted(roslaunch_args.keys())]
|
||||
# Currently don't put := after that as the completion will escape := to \:\=
|
||||
# Unfortunately we also want the escaping for roslaunch, when completing filenames
|
||||
complete_args = [a for a in sorted(roslaunch_args.keys())]
|
||||
print " ".join(complete_args)
|
||||
sys.exit(0)
|
||||
|
||||
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-deps
vendored
Executable file
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-deps
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2009, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import roslaunch.depends
|
||||
roslaunch.depends.roslaunch_deps_main()
|
||||
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-logs
vendored
Executable file
35
thirdparty/ros/ros_comm/tools/roslaunch/scripts/roslaunch-logs
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2009, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import roslaunch.roslaunch_logs
|
||||
roslaunch.roslaunch_logs.logs_main()
|
||||
Reference in New Issue
Block a user