From b1e4ca17089ed862d1b9bda2ee812d73754f9512 Mon Sep 17 00:00:00 2001 From: huyenngn Date: Fri, 26 Apr 2024 08:59:32 +0200 Subject: [PATCH] docs: Adapt docs to new fixes --- .vscode/launch.json | 2 +- README.md | 46 +++++++++++++++++++++++++---------- capella_ros_tools/__main__.py | 2 +- docs/source/howtos.rst | 5 ++-- docs/source/usage.rst | 17 +++++++------ 5 files changed, 48 insertions(+), 24 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ee90f4b..df92bd3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -28,7 +28,7 @@ "-m", "git+https://github.com/DSD-DBS/coffee-machine", "-l", - "oa", + "sa", "-o", "tests/data/coffee_msgs" ] diff --git a/README.md b/README.md index 7d841cf..4ce1eac 100644 --- a/README.md +++ b/README.md @@ -16,25 +16,45 @@ Read the [full documentation on Github pages](https://dsd-dbs.github.io/capella- # Examples -Import ROS .msg files to Capella model layer's root data package: +Import local ROS .msg files to Capella model layer's root data package: ```sh - python -m capella_ros_tools \ - import \ - -i tests/data/data_model/example_msgs \ - -m tests/data/empty_project_60 \ - -l la \ - --no-deps +python -m capella_ros_tools \ +import \ +-i tests/data/data_model/example_msgs \ +-m tests/data/empty_project_60 \ +-l la \ +--no-deps ``` -Export Capella model layer's root data package as ROS .msg files: +Import remote ROS .msg files to Capella model layer's root data package: ```sh - python -m capella_ros_tools \ - export \ - -m tests/data/melody_model_60 \ - -l la \ - -o tests/data/melody_msgs +python -m capella_ros_tools \ +import \ +-i git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss \ +-m tests/data/empty_project_60 \ +-l la +``` + +Export local Capella model layer's root data package as ROS .msg files: + +```sh +python -m capella_ros_tools \ +export \ +-m tests/data/melody_model_60 \ +-l la \ +-o tests/data/melody_msgs +``` + +Export remote Capella model layer's root data package as ROS .msg files: + +```sh +python -m capella_ros_tools \ +export \ +-m git+https://github.com/DSD-DBS/coffee-machine \ +-l sa \ +-o tests/data/coffee_msgs ``` # Installation diff --git a/capella_ros_tools/__main__.py b/capella_ros_tools/__main__.py index 41447cf..0cda4d0 100644 --- a/capella_ros_tools/__main__.py +++ b/capella_ros_tools/__main__.py @@ -125,7 +125,7 @@ def import_msgs( "-r", "--root", type=click.UUID, - help="The UUID of the root package to import the messages to.", + help="The UUID of the root package to import the messages from.", ) @click.option( "-o", diff --git a/docs/source/howtos.rst b/docs/source/howtos.rst index 741e724..697a831 100644 --- a/docs/source/howtos.rst +++ b/docs/source/howtos.rst @@ -31,7 +31,7 @@ Import ROS2 Messages from Git Repository: python -m capella_ros_tools \ import \ -i git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss \ - -m tests/data/ empty_project_60 \ + -m tests/data/empty_project_60 \ -l la Export Capella data package: @@ -40,7 +40,8 @@ Export Capella data package: python -m capella_ros_tools \ export \ - -m tests/data/melody_model_60 -l la \ + -m tests/data/melody_model_60 \ + -l la \ -o tests/data/melody_msgs Export Capella data package from Git Repository: diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 800fe99..ab61512 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -16,11 +16,13 @@ Import ROS2 Messages: python -m capella_ros_tools import -i -m -l -o --no-deps -* **-i/--input**, import ROS2 messages from path -* **-m/--model**, write to Capella model at path -* **-l/--layer**, use Capella model layer -* **-o/--out**, write generated decl YAML to path (optional) +* **-i/--input**, path to folder with .msg files. +* **-m/--model**, path to the Capella model. +* **-l/--layer**, layer to import the messages to. +* **-r/--root**, UUID of the root package to import the messages to. +* **-t/--type**, UUID of the types package to import the generated data types to. * **--no-deps**, flag to disable import of ROS2 dependencies (e.g. std_msgs) +* **-o/--output**, path to output decl YAML. Export Capella Model (experimental): ------------------------------------ @@ -28,6 +30,7 @@ Export Capella Model (experimental): python -m capella_ros_tools export -m -l -o -* **-m/--model**, export Capella model from path -* **-l/--layer**, use Capella model layer -* **-o/--output**, write ROS2 messages to +* **-m/--model**, path to the Capella model. +* **-l/--layer**, layer to export the messages from. +* **-r/--root**, UUID of the root package to export the messages from. +* **-o/--output**, path to output folder.