diff --git a/capella_ros_tools/__main__.py b/capella_ros_tools/__main__.py index 755444a..e328959 100644 --- a/capella_ros_tools/__main__.py +++ b/capella_ros_tools/__main__.py @@ -27,6 +27,12 @@ default="c" if sys.stdin.isatty() else "a", help="Default action when an element already exists: (c)heck, (k)eep, (o)verwrite, (a)bort.", ) +@click.option( + "--no-deps", + "no_deps", + is_flag=True, + help="Don’t install message dependencies.", +) @click.option("--port", type=int, help="Port for HTML display.") @click.option( "-i", @@ -54,12 +60,6 @@ required=True, help="Layer to use.", ) -@click.option( - "--no-deps", - "no_deps", - is_flag=True, - help="Don’t install message dependencies.", -) def cli( in_: tuple[str, str], out: tuple[str, str], @@ -87,14 +87,13 @@ def cli( input: t.Any = Path(input_path) - input = ( - input - if input.exists() - else capellambse.filehandler.get_filehandler(input_path) - ) + if not input.exists() and input_type == "messages": + input = capellambse.filehandler.get_filehandler(input_path).rootdir + elif not input.exists() and input_type == "capella": + input = capellambse.filehandler.get_filehandler(input_path) msg_path, capella_path, convert_class = ( - (input.rootdir, output, msg2capella.Converter) + (input, output, msg2capella.Converter) if input_type == "messages" else (output, input, capella2msg.Converter) ) diff --git a/capella_ros_tools/modules/messages/parser.py b/capella_ros_tools/modules/messages/parser.py index fb647d0..c71136a 100644 --- a/capella_ros_tools/modules/messages/parser.py +++ b/capella_ros_tools/modules/messages/parser.py @@ -318,7 +318,7 @@ def from_msg_folder(cls, package_name: str, msg_pkg_dir: t.Any): @classmethod def from_pkg_folder(cls, root_dir: t.Any, root_dir_name: str = "root"): - """Create MessagePkgDef from a folder of messagefolders.""" + """Create MessagePkgDef from a folder of message folders.""" out = cls("", [], []) for dir in root_dir.rglob("msg"): out.packages.append( diff --git a/docs/source/examples/Export capella.ipynb b/docs/source/examples/Export capella.ipynb new file mode 100644 index 0000000..8a5e4bb --- /dev/null +++ b/docs/source/examples/Export capella.ipynb @@ -0,0 +1,81 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Export Capella" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "import capellambse\n", + "from capella_ros_tools.scripts import capella2msg\n", + "from pathlib import Path" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "msg_path = Path(\"data/coffee_msgs\")\n", + "capella_path = capellambse.filehandler.get_filehandler(\"git+https://github.com/DSD-DBS/coffee-machine\")\n", + "layer = \"la\"" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Cannot load PVMT extension: ValueError: Provided model does not have a PropertyValuePkg\n", + "Property values are not available in this model\n" + ] + } + ], + "source": [ + "converter = capella2msg.Converter(msg_path, capella_path, layer, \"o\", False)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "converter.convert()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/examples/Export capella.ipynb.license b/docs/source/examples/Export capella.ipynb.license new file mode 100644 index 0000000..f6f3181 --- /dev/null +++ b/docs/source/examples/Export capella.ipynb.license @@ -0,0 +1,2 @@ +# Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: CC0-1.0 diff --git a/docs/source/examples/Parse messages.ipynb b/docs/source/examples/Parse messages.ipynb index a719013..5ce665e 100644 --- a/docs/source/examples/Parse messages.ipynb +++ b/docs/source/examples/Parse messages.ipynb @@ -1,365 +1,158 @@ { - "cells": [ - { -<<<<<<< HEAD - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from capella_ros_tools.modules.messages.parser import MessageDef\n", - "from IPython.display import display" -======= - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Parse Messages" ->>>>>>> 40ef464 (feat: Make tree view draggable) - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ -<<<<<<< HEAD - "msg_name = \"CameraInfo\"\n", - "msg_string = \"\"\"\n", - "# This message defines meta information for a camera. It should be in a\n", - "# camera namespace on topic \"camera_info\" and accompanied by up to five\n", - "# image topics named:\n", - "#\n", - "# image_raw - raw data from the camera driver, possibly Bayer encoded\n", - "# image - monochrome, distorted\n", - "# image_color - color, distorted\n", - "# image_rect - monochrome, rectified\n", - "# image_rect_color - color, rectified\n", - "#\n", - "# The image_pipeline contains packages (image_proc, stereo_image_proc)\n", - "# for producing the four processed image topics from image_raw and\n", - "# camera_info. The meaning of the camera parameters are described in\n", - "# detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.\n", - "#\n", - "# The image_geometry package provides a user-friendly interface to\n", - "# common operations using this meta information. If you want to, e.g.,\n", - "# project a 3d point into image coordinates, we strongly recommend\n", - "# using image_geometry.\n", - "#\n", - "# If the camera is uncalibrated, the matrices D, K, R, P should be left\n", - "# zeroed out. In particular, clients may assume that K[0] == 0.0\n", - "# indicates an uncalibrated camera.\n", - "\n", - "#######################################################################\n", - "# Image acquisition info #\n", - "#######################################################################\n", - "\n", - "# Time of image acquisition, camera coordinate frame ID\n", - "std_msgs/Header header # Header timestamp should be acquisition time of image\n", - " # Header frame_id should be optical frame of camera\n", - " # origin of frame should be optical center of camera\n", - " # +x should point to the right in the image\n", - " # +y should point down in the image\n", - " # +z should point into the plane of the image\n", - "\n", - "\n", - "#######################################################################\n", - "# Calibration Parameters #\n", - "#######################################################################\n", - "# These are fixed during camera calibration. Their values will be the #\n", - "# same in all messages until the camera is recalibrated. Note that #\n", - "# self-calibrating systems may \"recalibrate\" frequently. #\n", - "# #\n", - "# The internal parameters can be used to warp a raw (distorted) image #\n", - "# to: #\n", - "# 1. An undistorted image (requires D and K) #\n", - "# 2. A rectified image (requires D, K, R) #\n", - "# The projection matrix P projects 3D points into the rectified image.#\n", - "#######################################################################\n", - "\n", - "# The image dimensions with which the camera was calibrated.\n", - "# Normally this will be the full camera resolution in pixels.\n", - "uint32 height\n", - "uint32 width\n", - "\n", - "# The distortion model used. Supported models are listed in\n", - "# sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a\n", - "# simple model of radial and tangential distortion - is sufficent.\n", - "string distortion_model\n", - "\n", - "# The distortion parameters, size depending on the distortion model.\n", - "# For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).\n", - "float64[] d\n", - "\n", - "# Intrinsic camera matrix for the raw (distorted) images.\n", - "# [fx 0 cx]\n", - "# K = [ 0 fy cy]\n", - "# [ 0 0 1]\n", - "# Projects 3D points in the camera coordinate frame to 2D pixel\n", - "# coordinates using the focal lengths (fx, fy) and principal point\n", - "# (cx, cy).\n", - "float64[9] k # 3x3 row-major matrix\n", - "\n", - "# Rectification matrix (stereo cameras only)\n", - "# A rotation matrix aligning the camera coordinate system to the ideal\n", - "# stereo image plane so that epipolar lines in both stereo images are\n", - "# parallel.\n", - "float64[9] r # 3x3 row-major matrix\n", - "\n", - "# Projection/camera matrix\n", - "# [fx' 0 cx' Tx]\n", - "# P = [ 0 fy' cy' Ty]\n", - "# [ 0 0 1 0]\n", - "# By convention, this matrix specifies the intrinsic (camera) matrix\n", - "# of the processed (rectified) image. That is, the left 3x3 portion\n", - "# is the normal camera intrinsic matrix for the rectified image.\n", - "# It projects 3D points in the camera coordinate frame to 2D pixel\n", - "# coordinates using the focal lengths (fx', fy') and principal point\n", - "# (cx', cy') - these may differ from the values in K.\n", - "# For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will\n", - "# also have R = the identity and P[1:3,1:3] = K.\n", - "# For a stereo pair, the fourth column [Tx Ty 0]' is related to the\n", - "# position of the optical center of the second camera in the first\n", - "# camera's frame. We assume Tz = 0 so both cameras are in the same\n", - "# stereo image plane. The first camera always has Tx = Ty = 0. For\n", - "# the right (second) camera of a horizontal stereo pair, Ty = 0 and\n", - "# Tx = -fx' * B, where B is the baseline between the cameras.\n", - "# Given a 3D point [X Y Z]', the projection (x, y) of the point onto\n", - "# the rectified image is given by:\n", - "# [u v w]' = P * [X Y Z 1]'\n", - "# x = u / w\n", - "# y = v / w\n", - "# This holds for both images of a stereo pair.\n", - "float64[12] p # 3x4 row-major matrix\n", - "\n", - "\n", - "#######################################################################\n", - "# Operational Parameters #\n", - "#######################################################################\n", - "# These define the image region actually captured by the camera #\n", - "# driver. Although they affect the geometry of the output image, they #\n", - "# may be changed freely without recalibrating the camera. #\n", - "#######################################################################\n", - "\n", - "# Binning refers here to any camera setting which combines rectangular\n", - "# neighborhoods of pixels into larger \"super-pixels.\" It reduces the\n", - "# resolution of the output image to\n", - "# (width / binning_x) x (height / binning_y).\n", - "# The default values binning_x = binning_y = 0 is considered the same\n", - "# as binning_x = binning_y = 1 (no subsampling).\n", - "uint32 binning_x\n", - "uint32 binning_y\n", - "\n", - "# Region of interest (subwindow of full camera resolution), given in\n", - "# full resolution (unbinned) image coordinates. A particular ROI\n", - "# always denotes the same window of pixels on the camera sensor,\n", - "# regardless of binning settings.\n", - "# The default setting of roi (all values 0) is considered the same as\n", - "# full resolution (roi.width = width, roi.height = height).\n", - "RegionOfInterest roi\n", - "\"\"\"" -======= - "from capella_ros_tools.modules.messages.parser import MessageDef\n", - "from pathlib import Path\n", - "from IPython.display import display\n" ->>>>>>> 40ef464 (feat: Make tree view draggable) - ] - }, - { - "cell_type": "code", -<<<<<<< HEAD - "execution_count": 3, -======= - "execution_count": 4, ->>>>>>> 40ef464 (feat: Make tree view draggable) - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ -<<<<<<< HEAD - "

CameraInfo

# This message defines meta information for a camera. It should be in a
# camera namespace on topic \"camera_info\" and accompanied by up to five
# image topics named:
#
# image_raw - raw data from the camera driver, possibly Bayer encoded
# image - monochrome, distorted
# image_color - color, distorted
# image_rect - monochrome, rectified
# image_rect_color - color, rectified
#
# The image_pipeline contains packages (image_proc, stereo_image_proc)
# for producing the four processed image topics from image_raw and
# camera_info. The meaning of the camera parameters are described in
# detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
#
# The image_geometry package provides a user-friendly interface to
# common operations using this meta information. If you want to, e.g.,
# project a 3d point into image coordinates, we strongly recommend
# using image_geometry.
#
# If the camera is uncalibrated, the matrices D, K, R, P should be left
# zeroed out. In particular, clients may assume that K[0] == 0.0
# indicates an uncalibrated camera.
#######################################################################
# Image acquisition info #
#######################################################################
#######################################################################
# Calibration Parameters #
#######################################################################
# These are fixed during camera calibration. Their values will be the #
# same in all messages until the camera is recalibrated. Note that #
# self-calibrating systems may \"recalibrate\" frequently. #
# #
# The internal parameters can be used to warp a raw (distorted) image #
# to: #
# 1. An undistorted image (requires D and K) #
# 2. A rectified image (requires D, K, R) #
# The projection matrix P projects 3D points into the rectified image.#
#######################################################################
#######################################################################
# Operational Parameters #
#######################################################################
# These define the image region actually captured by the camera #
# driver. Although they affect the geometry of the output image, they #
# may be changed freely without recalibrating the camera. #
#######################################################################

Fields

  1. std_msgs/Header header
    # Time of image acquisition, camera coordinate frame ID
    # Header timestamp should be acquisition time of image
    # Header frame_id should be optical frame of camera
    # origin of frame should be optical center of camera
    # +x should point to the right in the image
    # +y should point down in the image
    # +z should point into the plane of the image
  2. uint32 height
    # The image dimensions with which the camera was calibrated.
    # Normally this will be the full camera resolution in pixels.
  3. uint32 width
    # The image dimensions with which the camera was calibrated.
    # Normally this will be the full camera resolution in pixels.
  4. string distortion_model
    # The distortion model used. Supported models are listed in
    # sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a
    # simple model of radial and tangential distortion - is sufficent.
  5. float64[] d
    # The distortion parameters, size depending on the distortion model.
    # For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).
  6. float64[9.0] k
    # Intrinsic camera matrix for the raw (distorted) images.
    # [fx 0 cx]
    # K = [ 0 fy cy]
    # [ 0 0 1]
    # Projects 3D points in the camera coordinate frame to 2D pixel
    # coordinates using the focal lengths (fx, fy) and principal point
    # (cx, cy).
    # 3x3 row-major matrix
  7. float64[9.0] r
    # Rectification matrix (stereo cameras only)
    # A rotation matrix aligning the camera coordinate system to the ideal
    # stereo image plane so that epipolar lines in both stereo images are
    # parallel.
    # 3x3 row-major matrix
  8. float64[12.0] p
    # Projection/camera matrix
    # [fx' 0 cx' Tx]
    # P = [ 0 fy' cy' Ty]
    # [ 0 0 1 0]
    # By convention, this matrix specifies the intrinsic (camera) matrix
    # of the processed (rectified) image. That is, the left 3x3 portion
    # is the normal camera intrinsic matrix for the rectified image.
    # It projects 3D points in the camera coordinate frame to 2D pixel
    # coordinates using the focal lengths (fx', fy') and principal point
    # (cx', cy') - these may differ from the values in K.
    # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
    # also have R = the identity and P[1:3,1:3] = K.
    # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
    # position of the optical center of the second camera in the first
    # camera's frame. We assume Tz = 0 so both cameras are in the same
    # stereo image plane. The first camera always has Tx = Ty = 0. For
    # the right (second) camera of a horizontal stereo pair, Ty = 0 and
    # Tx = -fx' * B, where B is the baseline between the cameras.
    # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
    # the rectified image is given by:
    # [u v w]' = P * [X Y Z 1]'
    # x = u / w
    # y = v / w
    # This holds for both images of a stereo pair.
    # 3x4 row-major matrix
  9. uint32 binning_x
    # Binning refers here to any camera setting which combines rectangular
    # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
    # resolution of the output image to
    # (width / binning_x) x (height / binning_y).
    # The default values binning_x = binning_y = 0 is considered the same
    # as binning_x = binning_y = 1 (no subsampling).
  10. uint32 binning_y
    # Binning refers here to any camera setting which combines rectangular
    # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
    # resolution of the output image to
    # (width / binning_x) x (height / binning_y).
    # The default values binning_x = binning_y = 0 is considered the same
    # as binning_x = binning_y = 1 (no subsampling).
  11. RegionOfInterest roi
    # Region of interest (subwindow of full camera resolution), given in
    # full resolution (unbinned) image coordinates. A particular ROI
    # always denotes the same window of pixels on the camera sensor,
    # regardless of binning settings.
    # The default setting of roi (all values 0) is considered the same as
    # full resolution (roi.width = width, roi.height = height).

Enums

    " - ], - "text/plain": [ - "" -======= - "

    CameraInfo

    # This message defines meta information for a camera. It should be in a
    # camera namespace on topic \"camera_info\" and accompanied by up to five
    # image topics named:
    #
    # image_raw - raw data from the camera driver, possibly Bayer encoded
    # image - monochrome, distorted
    # image_color - color, distorted
    # image_rect - monochrome, rectified
    # image_rect_color - color, rectified
    #
    # The image_pipeline contains packages (image_proc, stereo_image_proc)
    # for producing the four processed image topics from image_raw and
    # camera_info. The meaning of the camera parameters are described in
    # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
    #
    # The image_geometry package provides a user-friendly interface to
    # common operations using this meta information. If you want to, e.g.,
    # project a 3d point into image coordinates, we strongly recommend
    # using image_geometry.
    #
    # If the camera is uncalibrated, the matrices D, K, R, P should be left
    # zeroed out. In particular, clients may assume that K[0] == 0.0
    # indicates an uncalibrated camera.
    #######################################################################
    # Image acquisition info #
    #######################################################################
    #######################################################################
    # Calibration Parameters #
    #######################################################################
    # These are fixed during camera calibration. Their values will be the #
    # same in all messages until the camera is recalibrated. Note that #
    # self-calibrating systems may \"recalibrate\" frequently. #
    # #
    # The internal parameters can be used to warp a raw (distorted) image #
    # to: #
    # 1. An undistorted image (requires D and K) #
    # 2. A rectified image (requires D, K, R) #
    # The projection matrix P projects 3D points into the rectified image.#
    #######################################################################
    #######################################################################
    # Operational Parameters #
    #######################################################################
    # These define the image region actually captured by the camera #
    # driver. Although they affect the geometry of the output image, they #
    # may be changed freely without recalibrating the camera. #
    #######################################################################

    Fields

    1. std_msgs/Header header
      # Time of image acquisition, camera coordinate frame ID
      # Header timestamp should be acquisition time of image
      # Header frame_id should be optical frame of camera
      # origin of frame should be optical center of camera
      # +x should point to the right in the image
      # +y should point down in the image
      # +z should point into the plane of the image
    2. uint32 height
      # The image dimensions with which the camera was calibrated.
      # Normally this will be the full camera resolution in pixels.
    3. uint32 width
      # The image dimensions with which the camera was calibrated.
      # Normally this will be the full camera resolution in pixels.
    4. string distortion_model
      # The distortion model used. Supported models are listed in
      # sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a
      # simple model of radial and tangential distortion - is sufficent.
    5. float64[] d
      # The distortion parameters, size depending on the distortion model.
      # For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).
    6. float64[9] k
      # Intrinsic camera matrix for the raw (distorted) images.
      # [fx 0 cx]
      # K = [ 0 fy cy]
      # [ 0 0 1]
      # Projects 3D points in the camera coordinate frame to 2D pixel
      # coordinates using the focal lengths (fx, fy) and principal point
      # (cx, cy).
      # 3x3 row-major matrix
    7. float64[9] r
      # Rectification matrix (stereo cameras only)
      # A rotation matrix aligning the camera coordinate system to the ideal
      # stereo image plane so that epipolar lines in both stereo images are
      # parallel.
      # 3x3 row-major matrix
    8. float64[12] p
      # Projection/camera matrix
      # [fx' 0 cx' Tx]
      # P = [ 0 fy' cy' Ty]
      # [ 0 0 1 0]
      # By convention, this matrix specifies the intrinsic (camera) matrix
      # of the processed (rectified) image. That is, the left 3x3 portion
      # is the normal camera intrinsic matrix for the rectified image.
      # It projects 3D points in the camera coordinate frame to 2D pixel
      # coordinates using the focal lengths (fx', fy') and principal point
      # (cx', cy') - these may differ from the values in K.
      # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
      # also have R = the identity and P[1:3,1:3] = K.
      # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
      # position of the optical center of the second camera in the first
      # camera's frame. We assume Tz = 0 so both cameras are in the same
      # stereo image plane. The first camera always has Tx = Ty = 0. For
      # the right (second) camera of a horizontal stereo pair, Ty = 0 and
      # Tx = -fx' * B, where B is the baseline between the cameras.
      # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
      # the rectified image is given by:
      # [u v w]' = P * [X Y Z 1]'
      # x = u / w
      # y = v / w
      # This holds for both images of a stereo pair.
      # 3x4 row-major matrix
    9. uint32 binning_x
      # Binning refers here to any camera setting which combines rectangular
      # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
      # resolution of the output image to
      # (width / binning_x) x (height / binning_y).
      # The default values binning_x = binning_y = 0 is considered the same
      # as binning_x = binning_y = 1 (no subsampling).
    10. uint32 binning_y
      # Binning refers here to any camera setting which combines rectangular
      # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
      # resolution of the output image to
      # (width / binning_x) x (height / binning_y).
      # The default values binning_x = binning_y = 0 is considered the same
      # as binning_x = binning_y = 1 (no subsampling).
    11. RegionOfInterest roi
      # Region of interest (subwindow of full camera resolution), given in
      # full resolution (unbinned) image coordinates. A particular ROI
      # always denotes the same window of pixels on the camera sensor,
      # regardless of binning settings.
      # The default setting of roi (all values 0) is considered the same as
      # full resolution (roi.width = width, roi.height = height).

    Enums

      " - ], - "text/plain": [ - "" ->>>>>>> 40ef464 (feat: Make tree view draggable) - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ -<<<<<<< HEAD - "msgs = MessageDef.from_msg_string(msg_name, msg_string)\n", -======= - "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/CameraInfo.msg\"))\n", ->>>>>>> 40ef464 (feat: Make tree view draggable) - "display(msgs)" - ] - }, - { - "cell_type": "code", -<<<<<<< HEAD - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "msg_name = \"DiagnosticStatus\"\n", - "msg_string = \"\"\"\n", - "# This message holds the status of an individual component of the robot.\n", - "\n", - "# Possible levels of operations.\n", - "byte OK=0\n", - "byte WARN=1\n", - "byte ERROR=2\n", - "byte STALE=3\n", - "\n", - "# Level of operation enumerated above.\n", - "byte level\n", - "# A description of the test/component reporting.\n", - "string name\n", - "# A description of the status.\n", - "string message\n", - "# A hardware unique string.\n", - "string hardware_id\n", - "# An array of values associated with the status.\n", - "KeyValue[] values\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", -======= ->>>>>>> 40ef464 (feat: Make tree view draggable) - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ -<<<<<<< HEAD - "

      DiagnosticStatus

      # This message holds the status of an individual component of the robot.

      Fields

      1. byte level
        # Level of operation enumerated above.
      2. string name
        # A description of the test/component reporting.
      3. string message
        # A description of the status.
      4. string hardware_id
        # A hardware unique string.
      5. KeyValue[] values
        # An array of values associated with the status.

      Enums

      1. DiagnosticStatus
        # Possible levels of operations.
        • byte OK = 0
        • byte WARN = 1
        • byte ERROR = 2
        • byte STALE = 3
      " - ], - "text/plain": [ - "" -======= - "

      DiagnosticStatus

      # This message holds the status of an individual component of the robot.

      Fields

      1. DiagnosticStatusLevel level
        # Level of operation enumerated above.
      2. string name
        # A description of the test/component reporting.
      3. string message
        # A description of the status.
      4. string hardware_id
        # A hardware unique string.
      5. KeyValue[] values
        # An array of values associated with the status.

      Enums

      1. DiagnosticStatusLevel
        # Possible levels of operations.
        • byte OK = 0
        • byte WARN = 1
        • byte ERROR = 2
        • byte STALE = 3
      " - ], - "text/plain": [ - "" ->>>>>>> 40ef464 (feat: Make tree view draggable) - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ -<<<<<<< HEAD - "msgs = MessageDef.from_msg_string(msg_name, msg_string)\n", -======= - "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/DiagnosticStatus.msg\"))\n", ->>>>>>> 40ef464 (feat: Make tree view draggable) - "display(msgs)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, -<<<<<<< HEAD - "outputs": [], - "source": [ - "msg_name = \"PointCloud2\"\n", - "msg_string = \"\"\"\n", - "# This message holds a collection of N-dimensional points, which may\n", - "# contain additional information such as normals, intensity, etc. The\n", - "# point data is stored as a binary blob, its layout described by the\n", - "# contents of the \"fields\" array.\n", - "#\n", - "# The point cloud data may be organized 2d (image-like) or 1d (unordered).\n", - "# Point clouds organized as 2d images may be produced by camera depth sensors\n", - "# such as stereo or time-of-flight.\n", - "\n", - "# Time of sensor data acquisition, and the coordinate frame ID (for 3d points).\n", - "std_msgs/Header header\n", - "\n", - "# 2D structure of the point cloud. If the cloud is unordered, height is\n", - "# 1 and width is the length of the point cloud.\n", - "uint32 height\n", - "uint32 width\n", - "\n", - "# Describes the channels and their layout in the binary data blob.\n", - "PointField[] fields\n", - "\n", - "bool is_bigendian # Is this data bigendian?\n", - "uint32 point_step # Length of a point in bytes\n", - "uint32 row_step # Length of a row in bytes\n", - "uint8[] data # Actual point data, size is (row_step*height)\n", - "\n", - "bool is_dense # True if there are no invalid points\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, -======= ->>>>>>> 40ef464 (feat: Make tree view draggable) - "outputs": [ - { - "data": { - "text/html": [ - "

      PointCloud2

      # This message holds a collection of N-dimensional points, which may
      # contain additional information such as normals, intensity, etc. The
      # point data is stored as a binary blob, its layout described by the
      # contents of the \"fields\" array.
      #
      # The point cloud data may be organized 2d (image-like) or 1d (unordered).
      # Point clouds organized as 2d images may be produced by camera depth sensors
      # such as stereo or time-of-flight.

      Fields

      1. std_msgs/Header header
        # Time of sensor data acquisition, and the coordinate frame ID (for 3d points).
      2. uint32 height
        # 2D structure of the point cloud. If the cloud is unordered, height is
        # 1 and width is the length of the point cloud.
      3. uint32 width
        # 2D structure of the point cloud. If the cloud is unordered, height is
        # 1 and width is the length of the point cloud.
      4. PointField[] fields
        # Describes the channels and their layout in the binary data blob.
      5. bool is_bigendian
        # Is this data bigendian?
      6. uint32 point_step
        # Length of a point in bytes
      7. uint32 row_step
        # Length of a row in bytes
      8. uint8[] data
        # Actual point data, size is (row_step*height)
      9. bool is_dense
        # True if there are no invalid points

      Enums

        " - ], - "text/plain": [ -<<<<<<< HEAD - "" -======= - "" ->>>>>>> 40ef464 (feat: Make tree view draggable) - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ -<<<<<<< HEAD - "msgs = MessageDef.from_msg_string(msg_name, msg_string)\n", -======= - "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/PointCloud2.msg\"))\n", ->>>>>>> 40ef464 (feat: Make tree view draggable) - "display(msgs)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Parse Messages" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from capella_ros_tools.modules.messages.parser import MessageDef\n", + "from pathlib import Path\n", + "from IPython.display import display\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

        CameraInfo

        # Copyright DB InfraGO AG and contributors
        # SPDX-License-Identifier: CC0-1.0
        #
        # This message defines meta information for a camera. It should be in a
        # camera namespace on topic \"camera_info\" and accompanied by up to five
        # image topics named:
        #
        # image_raw - raw data from the camera driver, possibly Bayer encoded
        # image - monochrome, distorted
        # image_color - color, distorted
        # image_rect - monochrome, rectified
        # image_rect_color - color, rectified
        #
        # The image_pipeline contains packages (image_proc, stereo_image_proc)
        # for producing the four processed image topics from image_raw and
        # camera_info. The meaning of the camera parameters are described in
        # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
        #
        # The image_geometry package provides a user-friendly interface to
        # common operations using this meta information. If you want to, e.g.,
        # project a 3d point into image coordinates, we strongly recommend
        # using image_geometry.
        #
        # If the camera is uncalibrated, the matrices D, K, R, P should be left
        # zeroed out. In particular, clients may assume that K[0] == 0.0
        # indicates an uncalibrated camera.
        #######################################################################
        # Image acquisition info #
        #######################################################################
        #######################################################################
        # Calibration Parameters #
        #######################################################################
        # These are fixed during camera calibration. Their values will be the #
        # same in all messages until the camera is recalibrated. Note that #
        # self-calibrating systems may \"recalibrate\" frequently. #
        # #
        # The internal parameters can be used to warp a raw (distorted) image #
        # to: #
        # 1. An undistorted image (requires D and K) #
        # 2. A rectified image (requires D, K, R) #
        # The projection matrix P projects 3D points into the rectified image.#
        #######################################################################
        #######################################################################
        # Operational Parameters #
        #######################################################################
        # These define the image region actually captured by the camera #
        # driver. Although they affect the geometry of the output image, they #
        # may be changed freely without recalibrating the camera. #
        #######################################################################

        Fields

        1. std_msgs/Header header
          # Time of image acquisition, camera coordinate frame ID
          # Header timestamp should be acquisition time of image
          # Header frame_id should be optical frame of camera
          # origin of frame should be optical center of camera
          # +x should point to the right in the image
          # +y should point down in the image
          # +z should point into the plane of the image
        2. uint32 height
          # The image dimensions with which the camera was calibrated.
          # Normally this will be the full camera resolution in pixels.
        3. uint32 width
          # The image dimensions with which the camera was calibrated.
          # Normally this will be the full camera resolution in pixels.
        4. string distortion_model
          # The distortion model used. Supported models are listed in
          # sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a
          # simple model of radial and tangential distortion - is sufficent.
        5. float64[] d
          # The distortion parameters, size depending on the distortion model.
          # For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).
        6. float64[9] k
          # Intrinsic camera matrix for the raw (distorted) images.
          # [fx 0 cx]
          # K = [ 0 fy cy]
          # [ 0 0 1]
          # Projects 3D points in the camera coordinate frame to 2D pixel
          # coordinates using the focal lengths (fx, fy) and principal point
          # (cx, cy).
          # 3x3 row-major matrix
        7. float64[9] r
          # Rectification matrix (stereo cameras only)
          # A rotation matrix aligning the camera coordinate system to the ideal
          # stereo image plane so that epipolar lines in both stereo images are
          # parallel.
          # 3x3 row-major matrix
        8. float64[12] p
          # Projection/camera matrix
          # [fx' 0 cx' Tx]
          # P = [ 0 fy' cy' Ty]
          # [ 0 0 1 0]
          # By convention, this matrix specifies the intrinsic (camera) matrix
          # of the processed (rectified) image. That is, the left 3x3 portion
          # is the normal camera intrinsic matrix for the rectified image.
          # It projects 3D points in the camera coordinate frame to 2D pixel
          # coordinates using the focal lengths (fx', fy') and principal point
          # (cx', cy') - these may differ from the values in K.
          # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
          # also have R = the identity and P[1:3,1:3] = K.
          # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
          # position of the optical center of the second camera in the first
          # camera's frame. We assume Tz = 0 so both cameras are in the same
          # stereo image plane. The first camera always has Tx = Ty = 0. For
          # the right (second) camera of a horizontal stereo pair, Ty = 0 and
          # Tx = -fx' * B, where B is the baseline between the cameras.
          # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
          # the rectified image is given by:
          # [u v w]' = P * [X Y Z 1]'
          # x = u / w
          # y = v / w
          # This holds for both images of a stereo pair.
          # 3x4 row-major matrix
        9. uint32 binning_x
          # Binning refers here to any camera setting which combines rectangular
          # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
          # resolution of the output image to
          # (width / binning_x) x (height / binning_y).
          # The default values binning_x = binning_y = 0 is considered the same
          # as binning_x = binning_y = 1 (no subsampling).
        10. uint32 binning_y
          # Binning refers here to any camera setting which combines rectangular
          # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
          # resolution of the output image to
          # (width / binning_x) x (height / binning_y).
          # The default values binning_x = binning_y = 0 is considered the same
          # as binning_x = binning_y = 1 (no subsampling).
        11. RegionOfInterest roi
          # Region of interest (subwindow of full camera resolution), given in
          # full resolution (unbinned) image coordinates. A particular ROI
          # always denotes the same window of pixels on the camera sensor,
          # regardless of binning settings.
          # The default setting of roi (all values 0) is considered the same as
          # full resolution (roi.width = width, roi.height = height).

        Enums

          " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/msg/CameraInfo.msg\"))\n", + "display(msgs)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

          DiagnosticStatus

          # Copyright DB InfraGO AG and contributors
          # SPDX-License-Identifier: CC0-1.0
          #
          # This message holds the status of an individual component of the robot.

          Fields

          1. DiagnosticStatusLevel level
            # Level of operation enumerated above.
          2. string name
            # A description of the test/component reporting.
          3. string message
            # A description of the status.
          4. string hardware_id
            # A hardware unique string.
          5. KeyValue[] values
            # An array of values associated with the status.

          Enums

          1. DiagnosticStatusLevel
            # Possible levels of operations.
            • byte OK = 0
            • byte WARN = 1
            • byte ERROR = 2
            • byte STALE = 3
          " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/msg/DiagnosticStatus.msg\"))\n", + "display(msgs)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

          CameraInfo

          # This message defines meta information for a camera. It should be in a
          # camera namespace on topic \"camera_info\" and accompanied by up to five
          # image topics named:
          #
          # image_raw - raw data from the camera driver, possibly Bayer encoded
          # image - monochrome, distorted
          # image_color - color, distorted
          # image_rect - monochrome, rectified
          # image_rect_color - color, rectified
          #
          # The image_pipeline contains packages (image_proc, stereo_image_proc)
          # for producing the four processed image topics from image_raw and
          # camera_info. The meaning of the camera parameters are described in
          # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
          #
          # The image_geometry package provides a user-friendly interface to
          # common operations using this meta information. If you want to, e.g.,
          # project a 3d point into image coordinates, we strongly recommend
          # using image_geometry.
          #
          # If the camera is uncalibrated, the matrices D, K, R, P should be left
          # zeroed out. In particular, clients may assume that K[0] == 0.0
          # indicates an uncalibrated camera.
          #######################################################################
          # Image acquisition info #
          #######################################################################
          #######################################################################
          # Calibration Parameters #
          #######################################################################
          # These are fixed during camera calibration. Their values will be the #
          # same in all messages until the camera is recalibrated. Note that #
          # self-calibrating systems may \"recalibrate\" frequently. #
          # #
          # The internal parameters can be used to warp a raw (distorted) image #
          # to: #
          # 1. An undistorted image (requires D and K) #
          # 2. A rectified image (requires D, K, R) #
          # The projection matrix P projects 3D points into the rectified image.#
          #######################################################################
          #######################################################################
          # Operational Parameters #
          #######################################################################
          # These define the image region actually captured by the camera #
          # driver. Although they affect the geometry of the output image, they #
          # may be changed freely without recalibrating the camera. #
          #######################################################################

          Fields

          1. std_msgs/Header header
            # Time of image acquisition, camera coordinate frame ID
            # Header timestamp should be acquisition time of image
            # Header frame_id should be optical frame of camera
            # origin of frame should be optical center of camera
            # +x should point to the right in the image
            # +y should point down in the image
            # +z should point into the plane of the image
          2. uint32 height
            # The image dimensions with which the camera was calibrated.
            # Normally this will be the full camera resolution in pixels.
          3. uint32 width
            # The image dimensions with which the camera was calibrated.
            # Normally this will be the full camera resolution in pixels.
          4. string distortion_model
            # The distortion model used. Supported models are listed in
            # sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a
            # simple model of radial and tangential distortion - is sufficent.
          5. float64[] d
            # The distortion parameters, size depending on the distortion model.
            # For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).
          6. float64[9] k
            # Intrinsic camera matrix for the raw (distorted) images.
            # [fx 0 cx]
            # K = [ 0 fy cy]
            # [ 0 0 1]
            # Projects 3D points in the camera coordinate frame to 2D pixel
            # coordinates using the focal lengths (fx, fy) and principal point
            # (cx, cy).
            # 3x3 row-major matrix
          7. float64[9] r
            # Rectification matrix (stereo cameras only)
            # A rotation matrix aligning the camera coordinate system to the ideal
            # stereo image plane so that epipolar lines in both stereo images are
            # parallel.
            # 3x3 row-major matrix
          8. float64[12] p
            # Projection/camera matrix
            # [fx' 0 cx' Tx]
            # P = [ 0 fy' cy' Ty]
            # [ 0 0 1 0]
            # By convention, this matrix specifies the intrinsic (camera) matrix
            # of the processed (rectified) image. That is, the left 3x3 portion
            # is the normal camera intrinsic matrix for the rectified image.
            # It projects 3D points in the camera coordinate frame to 2D pixel
            # coordinates using the focal lengths (fx', fy') and principal point
            # (cx', cy') - these may differ from the values in K.
            # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
            # also have R = the identity and P[1:3,1:3] = K.
            # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
            # position of the optical center of the second camera in the first
            # camera's frame. We assume Tz = 0 so both cameras are in the same
            # stereo image plane. The first camera always has Tx = Ty = 0. For
            # the right (second) camera of a horizontal stereo pair, Ty = 0 and
            # Tx = -fx' * B, where B is the baseline between the cameras.
            # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
            # the rectified image is given by:
            # [u v w]' = P * [X Y Z 1]'
            # x = u / w
            # y = v / w
            # This holds for both images of a stereo pair.
            # 3x4 row-major matrix
          9. uint32 binning_x
            # Binning refers here to any camera setting which combines rectangular
            # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
            # resolution of the output image to
            # (width / binning_x) x (height / binning_y).
            # The default values binning_x = binning_y = 0 is considered the same
            # as binning_x = binning_y = 1 (no subsampling).
          10. uint32 binning_y
            # Binning refers here to any camera setting which combines rectangular
            # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
            # resolution of the output image to
            # (width / binning_x) x (height / binning_y).
            # The default values binning_x = binning_y = 0 is considered the same
            # as binning_x = binning_y = 1 (no subsampling).
          11. RegionOfInterest roi
            # Region of interest (subwindow of full camera resolution), given in
            # full resolution (unbinned) image coordinates. A particular ROI
            # always denotes the same window of pixels on the camera sensor,
            # regardless of binning settings.
            # The default setting of roi (all values 0) is considered the same as
            # full resolution (roi.width = width, roi.height = height).

          Enums

            " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/CameraInfo.msg\"))\n", + "display(msgs)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

            DiagnosticStatus

            # This message holds the status of an individual component of the robot.

            Fields

            1. DiagnosticStatusLevel level
              # Level of operation enumerated above.
            2. string name
              # A description of the test/component reporting.
            3. string message
              # A description of the status.
            4. string hardware_id
              # A hardware unique string.
            5. KeyValue[] values
              # An array of values associated with the status.

            Enums

            1. DiagnosticStatusLevel
              # Possible levels of operations.
              • byte OK = 0
              • byte WARN = 1
              • byte ERROR = 2
              • byte STALE = 3
            " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/DiagnosticStatus.msg\"))\n", + "display(msgs)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

            PointCloud2

            # This message holds a collection of N-dimensional points, which may
            # contain additional information such as normals, intensity, etc. The
            # point data is stored as a binary blob, its layout described by the
            # contents of the \"fields\" array.
            #
            # The point cloud data may be organized 2d (image-like) or 1d (unordered).
            # Point clouds organized as 2d images may be produced by camera depth sensors
            # such as stereo or time-of-flight.

            Fields

            1. std_msgs/Header header
              # Time of sensor data acquisition, and the coordinate frame ID (for 3d points).
            2. uint32 height
              # 2D structure of the point cloud. If the cloud is unordered, height is
              # 1 and width is the length of the point cloud.
            3. uint32 width
              # 2D structure of the point cloud. If the cloud is unordered, height is
              # 1 and width is the length of the point cloud.
            4. PointField[] fields
              # Describes the channels and their layout in the binary data blob.
            5. bool is_bigendian
              # Is this data bigendian?
            6. uint32 point_step
              # Length of a point in bytes
            7. uint32 row_step
              # Length of a row in bytes
            8. uint8[] data
              # Actual point data, size is (row_step*height)
            9. bool is_dense
              # True if there are no invalid points

            Enums

              " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "msgs = MessageDef.from_msg_file(Path(\"data/example_msgs/msg/PointCloud2.msg\"))\n", + "display(msgs)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 } diff --git a/docs/source/examples/data/example_msgs/CameraInfo.msg b/docs/source/examples/data/example_msgs/msg/CameraInfo.msg similarity index 100% rename from docs/source/examples/data/example_msgs/CameraInfo.msg rename to docs/source/examples/data/example_msgs/msg/CameraInfo.msg diff --git a/docs/source/examples/data/example_msgs/DiagnosticStatus.msg b/docs/source/examples/data/example_msgs/msg/DiagnosticStatus.msg similarity index 100% rename from docs/source/examples/data/example_msgs/DiagnosticStatus.msg rename to docs/source/examples/data/example_msgs/msg/DiagnosticStatus.msg diff --git a/docs/source/examples/data/example_msgs/PointCloud2.msg b/docs/source/examples/data/example_msgs/msg/PointCloud2.msg similarity index 100% rename from docs/source/examples/data/example_msgs/PointCloud2.msg rename to docs/source/examples/data/example_msgs/msg/PointCloud2.msg diff --git a/docs/source/howtos/howtos.rst b/docs/source/howtos/howtos.rst index 74cbcc0..4d5e4ad 100644 --- a/docs/source/howtos/howtos.rst +++ b/docs/source/howtos/howtos.rst @@ -13,25 +13,25 @@ This section contains a collection of examples that demonstrate how to use the l Using the CLI ============= -Importing ROS2 Messages: +Import ROS2 Messages: ------------------------ .. code-block:: bash $ python -m capella_ros_tools -i messages docs/source/examples/data/example_msgs -o capella docs/source/examples/data/empty_project_52 -l la --port 5000 --exists-action=k --no-deps -Exporting Capella Models +Import ROS2 Messages from Git Repository: ------------------------ .. code-block:: bash - $ python -m capella_ros_tools -i capella docs/source/examples/data/melody_model_60 -l la -o messages docs/source/examples/data/example_msgs --port 5000 + $ python -m capella_ros_tools -i messages git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss -o capella docs/source/examples/data/empty_project_52 -l la --port 5000 --exists-action=k -Import ROS2 Messages from Git Repository: ------------------------- +Export Capella Model +--------------------- .. code-block:: bash - $ python -m capella_ros_tools -i messages git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss -o capella docs/source/examples/data/empty_project_52 -l la --port 5000 --exists-action=k --no-deps + $ python -m capella_ros_tools -i capella docs/source/examples/data/melody_model_60 -l la -o messages docs/source/examples/data/example_msgs --port 5000 -Export Capella Models from Git Repository: +Export Capella Model from Git Repository: ------------------------ .. code-block:: bash diff --git a/docs/source/usage/usage.rst b/docs/source/usage/usage.rst index 9a1d58a..1c980f3 100644 --- a/docs/source/usage/usage.rst +++ b/docs/source/usage/usage.rst @@ -10,14 +10,14 @@ Usage This section describes how to use the Capella ROS Tools CLI. -Importing ROS2 Messages: +Import ROS2 Messages: ------------------------ .. code-block:: bash $ python -m capella_ros_tools -i messages -o capella -l --port= --exists-action= --no-deps -Exporting Capella Models ------------------------- +Export Capella Model +--------------------- .. code-block:: bash $ python -m capella_ros_tools -i capella -l -o messages --port