-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] Update ros1 and ros2 model description
- Loading branch information
Showing
6 changed files
with
214 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Create a ROS model from a deployed robot using our introspection at runtime tool | ||
## Create a ROS model from a deployed robot using our introspection at runtime tool (for ROS 2 systems) | ||
|
||
Please be sure that the tool is installed and your workspace setup, see the [installation guide](../README.md) for further details. | ||
|
||
|
@@ -7,19 +7,23 @@ The tools documented here were conceived as a simple way to obtain models of sys | |
You can install the tools directly on your workspace using the following command: | ||
|
||
``` | ||
mkdir -p my_catkin_ws/src | ||
cd my_catkin_ws/src | ||
catkin_init_workspace | ||
rosinstall . https://raw.githubusercontent.com/ipa320/ros-model/master/docu/introspection.rosinstall | ||
cd my_catkin_ws | ||
catkin_make (or catkin build) | ||
cd YourRos2WS/src | ||
git clone [email protected]:ipa-nhg/ros2model.git | ||
cd YourRos2WS | ||
colcon build | ||
``` | ||
|
||
To start the monitoring software the snapshot node has to be started on the same machine where the software to be analysed is running: | ||
To ask the monitoring module to capture all the nodes running on the system, please use the following command: | ||
|
||
``` | ||
source my_catkin_ws/devel/setup.bash | ||
rosrun rosgraph_monitor rossystem_snapshot | ||
ros2 model running_node -ga -d ~/PathToModelsFolderOutput | ||
``` | ||
|
||
This script will generate automatically a new file (.rossystem) under the folder: 'rosgraph_monitor/results'. | ||
The folder **PathToModelsFolderOutput** will contain all the model files. | ||
|
||
For a single node, the following command can be called: | ||
``` | ||
ros2 model running_node [-o Outputfile] <node-name> | ||
``` | ||
|
||
For further information please check the [ros2model](https://github.com/ipa-cmh/ros2model) repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,191 @@ | ||
## TBD | ||
# HOW TO DESCRIBE ROS NODES USING THE LANGUAGE | ||
|
||
|
||
|
||
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. | ||
To create a new model, you can easily just create a new file with the correct extension. For example my_node.ros2. | ||
|
||
## ROS (1) | ||
|
||
In ros1 the grammar is as follows: | ||
``` | ||
my_awesome_pkg: #Name of the package | ||
**fromGitRepo: ** "http://github.com/MyAccount/RepoName:BranchName" # Optional, Git reopsitory path that contains the source code | ||
**artifacts:** | ||
awesome: # Name of the artifact (as it is named in the CMakeLists) | ||
**node:** awesome_node # Name of the node | ||
**publishers:** # (Optional) List of publishers | ||
awesome_pub: | ||
**type:** "std_msgs/msg/Bool" | ||
**subscribers:** # (Optional) List of subscribers | ||
awesome_sub: | ||
**type:** "std_msgs/msg/Bool" | ||
**serviceclients:** # (Optional) List of service clients | ||
awesome_client: | ||
**type:** "std_srvs/srv/Empty" | ||
**serviceservers:** # (Optional) List of service servers | ||
awesome_server: | ||
**type:** "std_srvs/srv/Empty" | ||
**actionclients:** # (Optional) List of action clients | ||
awesome_action: | ||
**type:** "control_msgs/action/JointTrajectory" | ||
**actionservers:** # (Optional) List of action servers | ||
awesome_action: | ||
**type:** "control_msgs/action/JointTrajectory" | ||
**parameters:** # (Optional) List of parameters | ||
awesome_param: | ||
**type:** String | ||
**default:** "Hello" | ||
``` | ||
|
||
|
||
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. | ||
|
||
|
||
See the following model exmaple for the known teleop ROS package: | ||
|
||
``` | ||
teleop: | ||
artifacts: | ||
teleop_twist_joy_node: | ||
node: teleop_twist_joy_node | ||
publishers: | ||
cmd_vel: | ||
type: "geometry_msgs/msg/Twist" | ||
subscribers: | ||
joy: | ||
type:"sensor_msgs/msg/Joy" | ||
``` | ||
|
||
## ROS 2 | ||
|
||
The ros2 grammar is as follows: | ||
``` | ||
my_awesome_pkg: | ||
**fromGitRepo: ** "http://github.com/MyAccount/RepoName:BranchName" | ||
**artifacts:** | ||
awesome: | ||
**node:** awesome_node | ||
**publishers:** | ||
awesome_pub: | ||
**type:** "std_msgs/msg/Bool" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** default_qos | ||
**reliability:** best_effort | ||
**subscribers:** | ||
awesome_sub: | ||
**type:** "std_msgs/msg/Bool" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** transient_local | ||
**history:** keep_last | ||
**profile:** sensor_qos | ||
**reliability:** reliable | ||
**serviceclients:** | ||
awesome_client: | ||
**type:** "std_srvs/srv/Empty" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** services_qos | ||
**reliability:** best_effort | ||
**serviceservers:** | ||
awesome_server: | ||
**type:** "std_srvs/srv/Empty" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** services_qos | ||
**reliability:** best_effort | ||
**actionclients:** | ||
awesome_action: | ||
**type:** "control_msgs/action/JointTrajectory" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** default_qos | ||
**reliability:** best_effort | ||
**actionservers:** | ||
awesome_action: | ||
**type:** "control_msgs/action/JointTrajectory" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** default_qos | ||
**reliability:** best_effort | ||
**parameters:** | ||
awesome_param: | ||
**type:** String | ||
**default:** "Hello" | ||
**qos:** | ||
**depth:** 10 | ||
**durability:** volatile | ||
**history:** keep_all | ||
**profile:** parameter_qos | ||
**reliability:** best_effort | ||
``` | ||
|
||
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: | ||
|
||
- depth : it must be an integer. | ||
- durability: volatile / transient_local | ||
- history: keep_all / keep_last | ||
- profile: default_qos / sensor_qos / services_qos/ parameter_qos | ||
- reliability: best_effort / reliable | ||
|
||
|
||
See the following example for the [arucos_ros](https://github.com/pal-robotics/aruco_ros) driver: | ||
|
||
``` | ||
aruco_ros: | ||
fromGitRepo: "https://github.com/pal-robotics/aruco_ros.git:humble-devel" | ||
artifacts: | ||
marker_publisher: | ||
node: marker_publisher | ||
subscribers: | ||
image_raw: | ||
type: "sensor_msgs/msg/Image" | ||
publishers: | ||
debug: | ||
type: "sensor_msgs/msg/Image" | ||
markers: | ||
type: "aruco_msgs/msg/MarkerArray" | ||
markers_list: | ||
type: "std_msgs/msg/UInt32MultiArray" | ||
result: | ||
type: "sensor_msgs/msg/Image" | ||
parameters: | ||
camera_frame: | ||
type: String | ||
image_is_rectified: | ||
type: Boolean | ||
marker_size: | ||
type: Double | ||
reference_frame: | ||
type: String | ||
raw_image_topic: | ||
type: String | ||
use_camera_info: | ||
type: Boolean | ||
use_sim_time: | ||
type: Boolean | ||
camera_info_topic: | ||
type: String | ||
``` | ||
|
||
## Textual model editor | ||
|
||
The textual editor contains checker embedded, for example: | ||
|
||
![alt text](images/RosModelEmbededChecker.gif) | ||
|
||
It incorporates also the auto-complete function. This is available by pressing **Ctrl** + the space bar: | ||
|
||
![alt text](images/RosModelAutocomplete.gif) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.