Skip to content

Commit b8f4b59

Browse files
committed
[Documentation] Update ros1 and ros2 model description
1 parent 33f1719 commit b8f4b59

File tree

6 files changed

+214
-24
lines changed

6 files changed

+214
-24
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Publications:
4040
- [(Only for tooling developers) From Source code in eclipse](docu/Installation.md#option-2-using-the-eclipse-installer---source-installation-ros-tooling-developers)
4141
- VS Code plugin(tbd) - WIP [vscode-RosTooling](https://github.com/ipa320/vscode-RosTooling)
4242

43-
## Tutorials
43+
## Tutorials v3
4444

4545
- Create component models:
4646
- (Prerequisite) [Add communication objects](docu/NewCommunicationObjects.md)
47-
- [Create a ROS model from your source code(static code analyzer)](docu/NewRosModel.md)
47+
- [Create manually a new ROS component description](docu/RosModelDescription.md)
48+
- [Generation of code from models](https://github.com/CoreSenseEU/rossdl#usage)
4849
- [Create a ROS model from a deployed robot using our introspection at runtime tool](docu/IntrospectionNode.md)
49-
- [Create new ROS component description](docu/RosModelDescription.md)
50-
- [Generation of code from models](docu/CodeGeneration.md)
50+
- [Create a ROS model from your source code(static code analyzer)](docu/NewRosModel.md))
5151

5252
- Combine components to form a ROS System
5353
- [Create manually a new RosSystem description](docu/RosSystemModelDescription.md)

docu/IntrospectionNode.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Create a ROS model from a deployed robot using our introspection at runtime tool
1+
## Create a ROS model from a deployed robot using our introspection at runtime tool (for ROS 2 systems)
22

33
Please be sure that the tool is installed and your workspace setup, see the [installation guide](../README.md) for further details.
44

@@ -7,19 +7,23 @@ The tools documented here were conceived as a simple way to obtain models of sys
77
You can install the tools directly on your workspace using the following command:
88

99
```
10-
mkdir -p my_catkin_ws/src
11-
cd my_catkin_ws/src
12-
catkin_init_workspace
13-
rosinstall . https://raw.githubusercontent.com/ipa320/ros-model/master/docu/introspection.rosinstall
14-
cd my_catkin_ws
15-
catkin_make (or catkin build)
10+
cd YourRos2WS/src
11+
git clone git@github.com:ipa-nhg/ros2model.git
12+
cd YourRos2WS
13+
colcon build
1614
```
1715

18-
To start the monitoring software the snapshot node has to be started on the same machine where the software to be analysed is running:
16+
To ask the monitoring module to capture all the nodes running on the system, please use the following command:
1917

2018
```
21-
source my_catkin_ws/devel/setup.bash
22-
rosrun rosgraph_monitor rossystem_snapshot
19+
ros2 model running_node -ga -d ~/PathToModelsFolderOutput
2320
```
2421

25-
This script will generate automatically a new file (.rossystem) under the folder: 'rosgraph_monitor/results'.
22+
The folder **PathToModelsFolderOutput** will contain all the model files.
23+
24+
For a single node, the following command can be called:
25+
```
26+
ros2 model running_node [-o Outputfile] <node-name>
27+
```
28+
29+
For further information please check the [ros2model](https://github.com/ipa-cmh/ros2model) repository.

docu/NewRosModel.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1+
:bangbang::bangbang::bangbang::bangbang: This tutorial is only working for previous versions of the RosTooling (v2)
2+
3+
14
## Create a ROS model from your code
25

36
Please be sure that the tool is installed and your workspace setup, see the [installation guide](../README.md) for further details.
47

5-
To extract your model from ROS code ou have 3 options:
6-
- [Use the available web interface to autogenerate models from code hosted on GitHub](#cloud)
8+
To extract your model from ROS code ou have 2 options:
79
- [Call our docker container configuration for the extraction from a GitHub hosted repository (requires only the installation of Docker)](#docker-container)
810
- [Use a local build of your ROS package (requires the local installation of HAROS)](#local-ros-workspace)
911

10-
### Cloud
11-
12-
Under the link [Model extractor](http://ros-model.seronet-project.de/) a web service to extract automatically models from existing open source ROS packages is available. The user only has to give as input the URL address of the repository (for example https://github.com/ipa320/cob_driver), the name of the package that contains the node to be analysed (for example cob_sick_s300) and the name of th node ( for example cob_sick_s300). The resulted model will be displayed on the right side of the window.
13-
14-
![alt text](images/cob_sick_s300_cloud.png)
15-
1612
### Docker container
1713

1814
Clone the repository [ros-model-extractors](https://github.com/ipa320/ros-model-extractors) and follow its [documentation instructions](https://github.com/ipa320/ros-model-extractors#ros-model-extractors).

docu/RosModelDescription.md

Lines changed: 191 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,191 @@
1-
## TBD
1+
# HOW TO DESCRIBE ROS NODES USING THE LANGUAGE
2+
3+
4+
5+
Component models have two types of extensions, either .ros1 for ROS version 1 packages and .ros2 for ROS 2 packages. In both cases the language allows to describea pockage that contains ros nodes and their interfaces.
6+
To create a new model, you can easily just create a new file with the correct extension. For example my_node.ros2.
7+
8+
## ROS (1)
9+
10+
In ros1 the grammar is as follows:
11+
```
12+
my_awesome_pkg: #Name of the package
13+
**fromGitRepo: ** "http://github.com/MyAccount/RepoName:BranchName" # Optional, Git reopsitory path that contains the source code
14+
**artifacts:**
15+
awesome: # Name of the artifact (as it is named in the CMakeLists)
16+
**node:** awesome_node # Name of the node
17+
**publishers:** # (Optional) List of publishers
18+
awesome_pub:
19+
**type:** "std_msgs/msg/Bool"
20+
**subscribers:** # (Optional) List of subscribers
21+
awesome_sub:
22+
**type:** "std_msgs/msg/Bool"
23+
**serviceclients:** # (Optional) List of service clients
24+
awesome_client:
25+
**type:** "std_srvs/srv/Empty"
26+
**serviceservers:** # (Optional) List of service servers
27+
awesome_server:
28+
**type:** "std_srvs/srv/Empty"
29+
**actionclients:** # (Optional) List of action clients
30+
awesome_action:
31+
**type:** "control_msgs/action/JointTrajectory"
32+
**actionservers:** # (Optional) List of action servers
33+
awesome_action:
34+
**type:** "control_msgs/action/JointTrajectory"
35+
**parameters:** # (Optional) List of parameters
36+
awesome_param:
37+
**type:** String
38+
**default:** "Hello"
39+
```
40+
41+
42+
The format is based the YAML file format. All the words marked in the template with '**' are keywords that compose the model, they can't be modified.
43+
44+
45+
See the following model exmaple for the known teleop ROS package:
46+
47+
```
48+
teleop:
49+
artifacts:
50+
teleop_twist_joy_node:
51+
node: teleop_twist_joy_node
52+
publishers:
53+
cmd_vel:
54+
type: "geometry_msgs/msg/Twist"
55+
subscribers:
56+
joy:
57+
type:"sensor_msgs/msg/Joy"
58+
```
59+
60+
## ROS 2
61+
62+
The ros2 grammar is as follows:
63+
```
64+
my_awesome_pkg:
65+
**fromGitRepo: ** "http://github.com/MyAccount/RepoName:BranchName"
66+
**artifacts:**
67+
awesome:
68+
**node:** awesome_node
69+
**publishers:**
70+
awesome_pub:
71+
**type:** "std_msgs/msg/Bool"
72+
**qos:**
73+
**depth:** 10
74+
**durability:** volatile
75+
**history:** keep_all
76+
**profile:** default_qos
77+
**reliability:** best_effort
78+
**subscribers:**
79+
awesome_sub:
80+
**type:** "std_msgs/msg/Bool"
81+
**qos:**
82+
**depth:** 10
83+
**durability:** transient_local
84+
**history:** keep_last
85+
**profile:** sensor_qos
86+
**reliability:** reliable
87+
**serviceclients:**
88+
awesome_client:
89+
**type:** "std_srvs/srv/Empty"
90+
**qos:**
91+
**depth:** 10
92+
**durability:** volatile
93+
**history:** keep_all
94+
**profile:** services_qos
95+
**reliability:** best_effort
96+
**serviceservers:**
97+
awesome_server:
98+
**type:** "std_srvs/srv/Empty"
99+
**qos:**
100+
**depth:** 10
101+
**durability:** volatile
102+
**history:** keep_all
103+
**profile:** services_qos
104+
**reliability:** best_effort
105+
**actionclients:**
106+
awesome_action:
107+
**type:** "control_msgs/action/JointTrajectory"
108+
**qos:**
109+
**depth:** 10
110+
**durability:** volatile
111+
**history:** keep_all
112+
**profile:** default_qos
113+
**reliability:** best_effort
114+
**actionservers:**
115+
awesome_action:
116+
**type:** "control_msgs/action/JointTrajectory"
117+
**qos:**
118+
**depth:** 10
119+
**durability:** volatile
120+
**history:** keep_all
121+
**profile:** default_qos
122+
**reliability:** best_effort
123+
**parameters:**
124+
awesome_param:
125+
**type:** String
126+
**default:** "Hello"
127+
**qos:**
128+
**depth:** 10
129+
**durability:** volatile
130+
**history:** keep_all
131+
**profile:** parameter_qos
132+
**reliability:** best_effort
133+
```
134+
135+
The only remarkable difference with the ROS 1 model is that the quality of service can be defined for all the different interfaces. The quality of service atrributes are optional and they allow the following options:
136+
137+
- depth : it must be an integer.
138+
- durability: volatile / transient_local
139+
- history: keep_all / keep_last
140+
- profile: default_qos / sensor_qos / services_qos/ parameter_qos
141+
- reliability: best_effort / reliable
142+
143+
144+
See the following example for the [arucos_ros](https://github.com/pal-robotics/aruco_ros) driver:
145+
146+
```
147+
aruco_ros:
148+
fromGitRepo: "https://github.com/pal-robotics/aruco_ros.git:humble-devel"
149+
artifacts:
150+
marker_publisher:
151+
node: marker_publisher
152+
subscribers:
153+
image_raw:
154+
type: "sensor_msgs/msg/Image"
155+
publishers:
156+
debug:
157+
type: "sensor_msgs/msg/Image"
158+
markers:
159+
type: "aruco_msgs/msg/MarkerArray"
160+
markers_list:
161+
type: "std_msgs/msg/UInt32MultiArray"
162+
result:
163+
type: "sensor_msgs/msg/Image"
164+
parameters:
165+
camera_frame:
166+
type: String
167+
image_is_rectified:
168+
type: Boolean
169+
marker_size:
170+
type: Double
171+
reference_frame:
172+
type: String
173+
raw_image_topic:
174+
type: String
175+
use_camera_info:
176+
type: Boolean
177+
use_sim_time:
178+
type: Boolean
179+
camera_info_topic:
180+
type: String
181+
```
182+
183+
## Textual model editor
184+
185+
The textual editor contains checker embedded, for example:
186+
187+
![alt text](images/RosModelEmbededChecker.gif)
188+
189+
It incorporates also the auto-complete function. This is available by pressing **Ctrl** + the space bar:
190+
191+
![alt text](images/RosModelAutocomplete.gif)
484 KB
Loading
443 KB
Loading

0 commit comments

Comments
 (0)