|
| 1 | +# app_notification_saver |
| 2 | + |
| 3 | +Plugins and nodes to save notification to json file and pass it to `app_notifier` |
| 4 | + |
| 5 | +## `app_manager` plugins |
| 6 | + |
| 7 | +### `app_notification_saver/service_notification_saver`: General notification saver plugin |
| 8 | + |
| 9 | +This plugin saves notification via service call. |
| 10 | + |
| 11 | +#### `plugin_args`: Plugin arguments |
| 12 | + |
| 13 | +`None` |
| 14 | + |
| 15 | +#### `launch_args`: Plugin launch arguments |
| 16 | + |
| 17 | +- `json_path` : JSON path |
| 18 | + |
| 19 | +#### Sample plugin description |
| 20 | + |
| 21 | +```yaml |
| 22 | +plugins: |
| 23 | + - name: service_notification_saver |
| 24 | + type: app_notification_saver/service_notification_saver |
| 25 | + launch_args: |
| 26 | + json_path: /tmp/app_notification.json |
| 27 | +``` |
| 28 | +
|
| 29 | +#### Save app notification |
| 30 | +
|
| 31 | +You can save app notification with service call. |
| 32 | +
|
| 33 | +```bash |
| 34 | +rosservice call /service_notification_saver/save_app_notification "title: 'object recognition' |
| 35 | +stamp: |
| 36 | + secs: 1627467479 |
| 37 | + nsecs: 13279914 |
| 38 | +location: 'kitchen' |
| 39 | +message: 'Dish is found'" |
| 40 | +``` |
| 41 | +
|
| 42 | +#### Clear app notification |
| 43 | +
|
| 44 | +You can also clear app notification. |
| 45 | +
|
| 46 | +```bash |
| 47 | +rosservice call /service_notification_saver/clear_app_notification "{}" |
| 48 | +``` |
| 49 | +
|
| 50 | +### `app_notification_saver/smach_notification_saver`: SMACH notification saver plugin |
| 51 | + |
| 52 | +This plugin saves notification via service call. |
| 53 | + |
| 54 | +#### `plugin_args`: Plugin arguments |
| 55 | + |
| 56 | +`None` |
| 57 | + |
| 58 | +#### `launch_args`: Plugin launch arguments |
| 59 | + |
| 60 | +- `json_path` : JSON path |
| 61 | +- `smach_status_topic`: SMACH status topic name |
| 62 | + |
| 63 | +#### Sample plugin description |
| 64 | + |
| 65 | +```yaml |
| 66 | +plugins: |
| 67 | + - name: smach_notification_saver |
| 68 | + type: app_notification_saver/smach_notification_saver |
| 69 | + launch_args: |
| 70 | + json_path: /tmp/app_notification.json |
| 71 | + smach_status_topic: /server_name/smach/container_status |
| 72 | +``` |
| 73 | + |
| 74 | +## Nodes |
| 75 | + |
| 76 | +### `service_notification_saver_node.py`: Node for general notification saver |
| 77 | + |
| 78 | +Save notification node via service call. |
| 79 | + |
| 80 | +#### Services |
| 81 | + |
| 82 | +- `~save_app_notification` (`app_notification_saver/SaveAppNotification`) |
| 83 | + |
| 84 | + Service to save app notification to JSON. |
| 85 | + |
| 86 | +- `~clear_app_notification` (`std_srvs/Empty`) |
| 87 | + |
| 88 | + Service to clear app notification in JSON. |
| 89 | + |
| 90 | +#### Parameters |
| 91 | + |
| 92 | +- `~json_path` (`String`, default: `/tmp/app_notification.json`) |
| 93 | + |
| 94 | + Path to json file which contains app notification |
| 95 | + |
| 96 | +#### Sample |
| 97 | + |
| 98 | +##### Launch service_notification_saver node |
| 99 | + |
| 100 | +```bash |
| 101 | +roslaunch app_notification_saver service_notification_saver.launch |
| 102 | +``` |
| 103 | + |
| 104 | +##### Save app notification |
| 105 | + |
| 106 | +You can save app notification with service call. |
| 107 | + |
| 108 | +```bash |
| 109 | +rosservice call /service_notification_saver/save_app_notification "title: 'object recognition' |
| 110 | +stamp: |
| 111 | + secs: 1627467479 |
| 112 | + nsecs: 13279914 |
| 113 | +location: 'kitchen' |
| 114 | +message: 'Dish is found'" |
| 115 | +``` |
| 116 | + |
| 117 | +##### Clear app notification |
| 118 | + |
| 119 | +You can also clear app notification. |
| 120 | + |
| 121 | +```bash |
| 122 | +rosservice call /service_notification_saver/clear_app_notification "{}" |
| 123 | +``` |
| 124 | + |
| 125 | +##### Check output JSON |
| 126 | + |
| 127 | +The sample output of the json file is like below: |
| 128 | + |
| 129 | +```json |
| 130 | +{ |
| 131 | + "object recognition": [ |
| 132 | + { |
| 133 | + "date": "2021-07-28T19:17:59", |
| 134 | + "message": "Dish is found", |
| 135 | + "location": "kitchen" |
| 136 | + }, |
| 137 | + { |
| 138 | + "date": "2021-07-28T19:18:09", |
| 139 | + "message": "Cup is found", |
| 140 | + "location": "kitchen" |
| 141 | + } |
| 142 | + ], |
| 143 | + "navigation failure": [ |
| 144 | + { |
| 145 | + "date": "2021-07-28T19:18:29", |
| 146 | + "message": "Stucked in front of the chair", |
| 147 | + "location": "living room" |
| 148 | + } |
| 149 | + ] |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +### `smach_notification_saver_node.py`: Node for SMACH notification saver |
| 154 | + |
| 155 | +Save notification of smach state. |
| 156 | + |
| 157 | +#### Subscribe topics |
| 158 | + |
| 159 | +- `~smach/container_status` (`smach_msgs/SmachContainerStatus`, default: `/server_name/smach/container_status`) |
| 160 | + |
| 161 | + Smach status topic |
| 162 | + |
| 163 | +#### Parameters |
| 164 | + |
| 165 | +- `~json_path` (`String`, default: `/tmp/app_notification.json`) |
| 166 | + |
| 167 | + Path to json file which contains app notification |
| 168 | + |
| 169 | +#### Sample |
| 170 | + |
| 171 | +##### Launch smach_notification_saver node |
| 172 | + |
| 173 | +```bash |
| 174 | +# Launch only smach_notification_saver node |
| 175 | +roslaunch app_notification_saver smach_notification_saver.launch |
| 176 | +
|
| 177 | +# Sample |
| 178 | +# Launch smach_notification_saver node and rosbag |
| 179 | +roslaunch app_notification_saver sample_smach_notification_saver.launch --screen |
| 180 | +``` |
0 commit comments