Skip to content

Commit 87be2b9

Browse files
authored
Merge pull request #93 from gramaziokohler/host-param
close #92: add host/port params to the command line interface
2 parents 92b97d6 + 0a104d5 commit 87be2b9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Unreleased
1313
**Added**
1414

1515
* Added function to set the default timeout value.
16+
* Added ROS host and port parameters to the command-line interface.
1617

1718
**Changed**
1819

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)