Skip to content

Commit c65b656

Browse files
committed
Update README.md to clarify installation instructions for ROS 2 and enhance usage examples for node and system model generation
1 parent ec249bb commit c65b656

File tree

1 file changed

+40
-61
lines changed

1 file changed

+40
-61
lines changed

README.md

Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,22 @@ In addition, the Toolchain offers automatic extractors of the models from the or
1616
For the static code analysis we made available a web interface able to inspect code hosted on Git and get its model representation as feedback [http://ros-model.seronet-project.de/](http://ros-model.seronet-project.de/).
1717

1818

19-
## Install with ROS
19+
## Install with ROS 2 (Humble or Rolling)
2020
1. clone this repository into the source folder in your workspace, such as:
2121
```
2222
ws/src/ros2model
2323
```
2424
2. Source ROS workspace
25+
26+
Humble:
2527
```
2628
source /opt/ros/humble/setup.bash
2729
```
30+
31+
Rolling:
32+
```
33+
source /opt/ros/rolling/setup.bash
34+
```
2835
3. Back to the folder "ws", create and active venv
2936
```
3037
python3 -m venv venv --system-site-packages --symlinks
@@ -44,67 +51,39 @@ For the static code analysis we made available a web interface able to inspect c
4451
source install/local_setup.bash
4552
```
4653
6. config python path
47-
in this case we are using python3.10 in venv
54+
adjust the path to match the Python minor version in your virtual environment
4855
```
49-
export PYTHONPATH=$PYTHONPATH:$(pwd)/venv/lib/python3.10/site-packages/
56+
export PYTHONPATH=$PYTHONPATH:$(pwd)/venv/lib/$(python3 -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')/site-packages/
5057
```
5158

5259
## Run
53-
1. Create ros node models from a run-time system:
54-
```
55-
56-
ros2 model node -o test/nodes # it will save generated file in folder "test/nodes"
57-
```
58-
59-
You can run the command below to get more usage information.
60-
```
61-
ros2 model node -h
62-
```
63-
64-
```
65-
usage: ros2 model node [-h] [--spin-time SPIN_TIME] [-s] [--no-daemon] [-o OUTPUT_FOLDER] [--include_hidden_nodes]
66-
[--include_hidden_interfaces]
67-
68-
Create .ros2 for each node in a runtime system
69-
70-
options:
71-
-h, --help show this help message and exit
72-
--spin-time SPIN_TIME
73-
Spin time in seconds to wait for discovery (only applies when not using an already running daemon)
74-
-s, --use-sim-time Enable ROS simulation time
75-
--no-daemon Do not spawn nor use an already running daemon
76-
-o OUTPUT_FOLDER, --output_folder OUTPUT_FOLDER
77-
The folder for storing the generated models.
78-
--include_hidden_nodes
79-
Consider hidden nodes.
80-
--include_hidden_interfaces
81-
Consider hidden topics, services or actions.
82-
```
83-
84-
2. Create a ros system model from a run-time system:
85-
```
86-
ros2 model system -o test/turtlesim # save the system in test folder and named as "turtlesim.rossystem"
87-
```
88-
You can run the command below to get more usage information.
89-
```
90-
ros2 model system -h
91-
```
92-
```
93-
usage: ros2 model system [-h] [--spin-time SPIN_TIME] [-s] [--no-daemon] [-o OUTPUT_FILE] [--include_hidden_nodes]
94-
[--include_hidden_interfaces]
95-
96-
Create .rossystem for a runtime system
97-
98-
options:
99-
-h, --help show this help message and exit
100-
--spin-time SPIN_TIME
101-
Spin time in seconds to wait for discovery (only applies when not using an already running daemon)
102-
-s, --use-sim-time Enable ROS simulation time
103-
--no-daemon Do not spawn nor use an already running daemon
104-
-o OUTPUT_FILE, --output_file OUTPUT_FILE
105-
The system model file path.
106-
--include_hidden_nodes
107-
Consider hidden nodes.
108-
--include_hidden_interfaces
109-
Consider hidden topics, services or actions.
110-
```
60+
### Node models from a running system
61+
Generate component models for each node discovered at runtime. Use `--include-description` if you need the `robot_description` parameter in the exported file and `--from-launch` to refine package/executable data with launch files.
62+
```
63+
ros2 model node -o test/nodes --include-description --from-launch my_pkg/bringup.launch.py
64+
```
65+
More options:
66+
```
67+
ros2 model node -h
68+
```
69+
70+
### System model from a running system
71+
Capture a full `.rossystem` model. The `--include-description` and `--from-launch` flags work the same way as for node models.
72+
```
73+
ros2 model system -o test/turtlesim.rossystem --include-description --from-launch turtlesim_gazebo/launch/sim_launch.py
74+
```
75+
More options:
76+
```
77+
ros2 model system -h
78+
```
79+
80+
### Interface models from package definitions
81+
Generate `.ros` models for topics, services, and actions declared in interface packages. Use `--all` to export every available package or pass `-p <package>` multiple times to target specific ones.
82+
```
83+
ros2 model msg --all -o test/interfaces
84+
ros2 model msg -p std_msgs -p geometry_msgs -o test/interfaces
85+
```
86+
More options:
87+
```
88+
ros2 model msg -h
89+
```

0 commit comments

Comments
 (0)