Skip to content

Commit

Permalink
Merge pull request #724 from cyberbotics/merge-master-into-develop
Browse files Browse the repository at this point in the history
Merge master into develop
  • Loading branch information
ygoumaz authored May 3, 2023
2 parents 699167c + fd9b897 commit c1d79f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions webots_ros2/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog for package webots_ros2
------------------
* Added support for painted point clouds.
* Fixed ability to launch RViz without other tools in e-puck example.
* Fixed command line arguments in importer tools.
* Added new TIAGo project to webots_ros2_tiago to run real robot configuration.

2023.0.3 (2023-04-12)
Expand Down
4 changes: 4 additions & 0 deletions webots_ros2_importer/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog for package webots_ros2_importer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023.0.4 (2023-XX-XX)
------------------
* Fixed argument parsing

2022.1.4 (2022-11-18)
------------------
* Upgraded to urdf2webots 2.0.3
Expand Down
8 changes: 4 additions & 4 deletions webots_ros2_importer/webots_ros2_importer/urdf2proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


def main(args=None, urdfInput=None):
parser = argparse.ArgumentParser(usage='usage: %prog --input=my_robot.urdf [options]')
parser = argparse.ArgumentParser(usage='usage: %(prog)s --input=my_robot.urdf [options]')
parser.add_argument('--input', dest='input', default='', help='Specifies the URDF file.')
parser.add_argument('--output', dest='output', default='', help='Specifies the path and, if ending in ".proto", name '
'of the resulting PROTO file. The filename minus the .proto extension will be the robot name '
Expand Down Expand Up @@ -53,13 +53,13 @@ def main(args=None, urdfInput=None):
# use 'parse_known_args' because ROS2 adds a lot of internal arguments
arguments, _ = parser.parse_known_args()
file = os.path.abspath(urdfInput) if urdfInput is not None else os.path.abspath(arguments.input)
if not arguments.input:
if not file:
sys.exit('Input file not specified (should be specified with the "--input" argument).')
if not os.path.isfile(file):
sys.exit('"%s" file does not exist.' % arguments.input)
sys.exit('"%s" file does not exist.' % file)
elif not file.endswith('.urdf'):
sys.exit('"%s" is not an urdf file.' % file)
convertUrdfFile(input=arguments.input,
convertUrdfFile(input=file,
output=arguments.output,
normal=arguments.normal,
boxCollision=arguments.boxCollision,
Expand Down
4 changes: 2 additions & 2 deletions webots_ros2_importer/webots_ros2_importer/xacro2proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


def main(args=None):
parser = argparse.ArgumentParser(usage='usage: %prog --input=my_robot.urdf.xacro [options]')
parser = argparse.ArgumentParser(usage='usage: %(prog)s --input=my_robot.urdf.xacro [options]')
parser.add_argument('--input', dest='inFile', default=None,
help='Specifies the xacro file to convert.')
parser.add_argument('--xacro-opts', dest='xacro_opts', default=None,
Expand Down Expand Up @@ -82,7 +82,7 @@ def main(args=None):
# restore stdout and arguments and then run urdf to proto conversion
sys.stdout = orig_stdout
sys.argv = saved_argv
urdf2proto.main(input=path)
urdf2proto.main(urdfInput=path)
os.remove(path)


Expand Down

0 comments on commit c1d79f0

Please sign in to comment.