Skip to content

Commit f9919a1

Browse files
committed
close #92: add host/port params to the command line interface
1 parent 92b97d6 commit f9919a1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/roslibpy/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def main():
9999
import argparse
100100

101101
parser = argparse.ArgumentParser(description='roslibpy command-line utility')
102+
parser.add_argument('-r', '--ros-host', type=str, help='ROS host name or IP address', default='localhost')
103+
parser.add_argument('-p', '--ros-port', type=int, help='ROS bridge port', default=9090)
102104

103105
commands = parser.add_subparsers(help='commands')
104106
commands.dest = 'command'
@@ -186,7 +188,7 @@ def main():
186188

187189
# Invoke
188190
args = parser.parse_args()
189-
ros = roslibpy.Ros('localhost', 9090)
191+
ros = roslibpy.Ros(args.ros_host, args.ros_port)
190192

191193
try:
192194
ros.run()

0 commit comments

Comments
 (0)