pitasc_library - ros/ros_scripts.xml

Model definitions

File contents

 1<?xml version="1.0" encoding="UTF-8"?>
 2
 3<pitasc>
 4
 5    <models>
 6
 7        <type id="script_topic_logger" prototype="script">
 8            <meta>
 9                <member id="description">Logs values from a ROS topic to a file.</member>
10                <member id="categories">publisher</member>
11                <member id="implementation">
12                    <!-- For Orocos topic logger is always external -->
13                    <clone prototype="orocos">
14                        <member id="package">cppitasc_ros_components</member>
15                        <member id="component">ScriptExtTopicLogger</member>
16                    </clone>
17                </member>
18            </meta>
19            <data>
20                <type id="topic" prototype="string_parameter">
21                    <meta>
22                        <member id="description">The ros topic to listen on</member>
23                    </meta>
24                </type>
25                <type id="fields" data_type="list:string_parameter" prototype="base">
26                    <meta>
27                        <member id="description">The Field in the topic to be logged. Syntax is comparable to 'rostopic echo': Lists with [], subitems with . (dot).
28
29Examples: "wrench.force", "wrench.force.x", "list[0]"</member>
30                    </meta>
31                </type>
32                <type id="package" prototype="string_parameter">
33                    <meta>
34                        <member id="description">A rospackage in the workspace to place the file in. Leave empty if absolute path is wanted.</member>
35                    </meta>
36                </type>
37                <type id="folder" prototype="string_parameter">
38                    <meta>
39                        <member id="description">An additional folder within the rospackage path. Creates folder if not existing.</member>
40                    </meta>
41                </type>
42                <type id="file_name" prototype="string_parameter">
43                    <meta>
44                        <member id="description">The name of the file to log the data into.
45
46Accepts subsequent folders, "~" for home (if package=="") and the following special artefacts:
47"{number}" -> starts at 0 and increases by one every time the logger is reentered within an application (e.g. application starts and stops logger in a loop);
48"{timestamp%Y-%m-%d_%H-%M-%S}" -> Is replaced by the timestamp at starting with the given structure.
49Examples: "{timestamp%Y-%m-%d}/{timestamp%H-%M-%S}_iteration_{number}.log" -> 2020-06-06/13-40-31_iteration_0.log</member>
50                    </meta>
51                </type>
52                <type id="file_mode" prototype="string_parameter">
53                    <data>w+</data>
54                    <meta>
55                        <member id="description">File creation flag:
56
57a  : if file already exists, new data will be appended,
58w  : new data will overwrite and replace already existing data,
59w+ : if file already exists, a new file will be created with additional surfix</member>
60                    </meta>
61                </type>
62            </data>
63        </type>
64
65        <type id="script_external_topic_logger" prototype="script_topic_logger">
66            <data>
67                <type id="name" prototype="string_parameter">
68                    <meta>
69                        <member id="description">Name of the external node to be created.</member>
70                    </meta>
71                </type>
72            </data>
73        </type>
74
75    </models>
76</pitasc>