-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
2,706 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# app_manager_utils | ||
|
||
## Dependency | ||
|
||
- [PR2/app_manager kinetic-devel branch](https://github.com/PR2/app_manager) | ||
- [python-dateutil >= 2.7.0](https://github.com/dateutil/dateutil) | ||
|
||
## app_scheduler | ||
|
||
Scheduler for `app_manager` | ||
|
||
For detailed information, please read [app_scheduler](app_scheduler/README.md). | ||
|
||
## app_recorder | ||
|
||
Recorder plugin for `app_manager` | ||
|
||
For detailed information, please read [app_recorder](app_recorder/README.md). | ||
|
||
## app_uploader | ||
|
||
Uploader plugin for `app_manager` | ||
|
||
For detailed information, please read [app_uploader](app_uploader/README.md). | ||
|
||
## app_notifier | ||
|
||
Notifier plugin for `app_manager` | ||
|
||
For detailed information, please read [app_notifier](app_notifier/README.md). | ||
|
||
## app_notification_saver | ||
|
||
Notification saver plugin for `app_manager` | ||
|
||
For detailed information, please read [app_notification_saver](app_notification_saver/README.md). | ||
|
||
## app_publisher | ||
|
||
Publisher plugin for `app_manager` | ||
|
||
For detailed information, please read [app_publisher](app_publisher/README.md). |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(app_manager_utils) | ||
find_package(catkin REQUIRED) | ||
catkin_metapackage() |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>app_manager_utils</name> | ||
<version>2.2.12</version> | ||
<description>The app_manager_utils meta package</description> | ||
<maintainer email="[email protected]">Shingo Kitagawa</maintainer> | ||
<author email="[email protected]">Shingo Kitagawa</author> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<exec_depend>app_notification_saver</exec_depend> | ||
<exec_depend>app_notifier</exec_depend> | ||
<exec_depend>app_publisher</exec_depend> | ||
<exec_depend>app_recorder</exec_depend> | ||
<exec_depend>app_scheduler</exec_depend> | ||
<exec_depend>app_uploader</exec_depend> | ||
|
||
<export> | ||
<metapackage /> | ||
</export> | ||
</package> |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(app_notification_saver) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
message_generation | ||
rospy | ||
) | ||
|
||
add_service_files( | ||
FILES SaveAppNotification.srv | ||
) | ||
|
||
catkin_python_setup() | ||
|
||
generate_messages() | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS message_runtime | ||
) |
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 |
---|---|---|
@@ -0,0 +1,180 @@ | ||
# app_notification_saver | ||
|
||
Plugins and nodes to save notification to json file and pass it to `app_notifier` | ||
|
||
## `app_manager` plugins | ||
|
||
### `app_notification_saver/service_notification_saver`: General notification saver plugin | ||
|
||
This plugin saves notification via service call. | ||
|
||
#### `plugin_args`: Plugin arguments | ||
|
||
`None` | ||
|
||
#### `launch_args`: Plugin launch arguments | ||
|
||
- `json_path` : JSON path | ||
|
||
#### Sample plugin description | ||
|
||
```yaml | ||
plugins: | ||
- name: service_notification_saver | ||
type: app_notification_saver/service_notification_saver | ||
launch_args: | ||
json_path: /tmp/app_notification.json | ||
``` | ||
#### Save app notification | ||
You can save app notification with service call. | ||
```bash | ||
rosservice call /service_notification_saver/save_app_notification "title: 'object recognition' | ||
stamp: | ||
secs: 1627467479 | ||
nsecs: 13279914 | ||
location: 'kitchen' | ||
message: 'Dish is found'" | ||
``` | ||
#### Clear app notification | ||
You can also clear app notification. | ||
```bash | ||
rosservice call /service_notification_saver/clear_app_notification "{}" | ||
``` | ||
### `app_notification_saver/smach_notification_saver`: SMACH notification saver plugin | ||
|
||
This plugin saves notification via service call. | ||
|
||
#### `plugin_args`: Plugin arguments | ||
|
||
`None` | ||
|
||
#### `launch_args`: Plugin launch arguments | ||
|
||
- `json_path` : JSON path | ||
- `smach_status_topic`: SMACH status topic name | ||
|
||
#### Sample plugin description | ||
|
||
```yaml | ||
plugins: | ||
- name: smach_notification_saver | ||
type: app_notification_saver/smach_notification_saver | ||
launch_args: | ||
json_path: /tmp/app_notification.json | ||
smach_status_topic: /server_name/smach/container_status | ||
``` | ||
|
||
## Nodes | ||
|
||
### `service_notification_saver_node.py`: Node for general notification saver | ||
|
||
Save notification node via service call. | ||
|
||
#### Services | ||
|
||
- `~save_app_notification` (`app_notification_saver/SaveAppNotification`) | ||
|
||
Service to save app notification to JSON. | ||
|
||
- `~clear_app_notification` (`std_srvs/Empty`) | ||
|
||
Service to clear app notification in JSON. | ||
|
||
#### Parameters | ||
|
||
- `~json_path` (`String`, default: `/tmp/app_notification.json`) | ||
|
||
Path to json file which contains app notification | ||
|
||
#### Sample | ||
|
||
##### Launch service_notification_saver node | ||
|
||
```bash | ||
roslaunch app_notification_saver service_notification_saver.launch | ||
``` | ||
|
||
##### Save app notification | ||
|
||
You can save app notification with service call. | ||
|
||
```bash | ||
rosservice call /service_notification_saver/save_app_notification "title: 'object recognition' | ||
stamp: | ||
secs: 1627467479 | ||
nsecs: 13279914 | ||
location: 'kitchen' | ||
message: 'Dish is found'" | ||
``` | ||
|
||
##### Clear app notification | ||
|
||
You can also clear app notification. | ||
|
||
```bash | ||
rosservice call /service_notification_saver/clear_app_notification "{}" | ||
``` | ||
|
||
##### Check output JSON | ||
|
||
The sample output of the json file is like below: | ||
|
||
```json | ||
{ | ||
"object recognition": [ | ||
{ | ||
"date": "2021-07-28T19:17:59", | ||
"message": "Dish is found", | ||
"location": "kitchen" | ||
}, | ||
{ | ||
"date": "2021-07-28T19:18:09", | ||
"message": "Cup is found", | ||
"location": "kitchen" | ||
} | ||
], | ||
"navigation failure": [ | ||
{ | ||
"date": "2021-07-28T19:18:29", | ||
"message": "Stucked in front of the chair", | ||
"location": "living room" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### `smach_notification_saver_node.py`: Node for SMACH notification saver | ||
|
||
Save notification of smach state. | ||
|
||
#### Subscribe topics | ||
|
||
- `~smach/container_status` (`smach_msgs/SmachContainerStatus`, default: `/server_name/smach/container_status`) | ||
|
||
Smach status topic | ||
|
||
#### Parameters | ||
|
||
- `~json_path` (`String`, default: `/tmp/app_notification.json`) | ||
|
||
Path to json file which contains app notification | ||
|
||
#### Sample | ||
|
||
##### Launch smach_notification_saver node | ||
|
||
```bash | ||
# Launch only smach_notification_saver node | ||
roslaunch app_notification_saver smach_notification_saver.launch | ||
# Sample | ||
# Launch smach_notification_saver node and rosbag | ||
roslaunch app_notification_saver sample_smach_notification_saver.launch --screen | ||
``` |
6 changes: 6 additions & 0 deletions
6
app_manager_utils/app_notification_saver/app_notification_saver_plugin.yaml
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: app_notification_saver/service_notification_saver | ||
launch: app_notification_saver/service_notification_saver.launch | ||
module: null | ||
- name: app_notification_saver/smach_notification_saver | ||
launch: app_notification_saver/smach_notification_saver.launch | ||
module: null |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
app_manager_utils/app_notification_saver/launch/service_notification_saver.launch
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<launch> | ||
<!-- start: arguments --> | ||
<arg name="json_path" default="/tmp/app_notification.json" /> | ||
<!-- end: arguments --> | ||
|
||
<node name="service_notification_saver" pkg="app_notification_saver" | ||
type="service_notification_saver_node.py"> | ||
<rosparam subst_value="true"> | ||
json_path: $(arg json_path) | ||
</rosparam> | ||
</node> | ||
</launch> |
14 changes: 14 additions & 0 deletions
14
app_manager_utils/app_notification_saver/launch/smach_notification_saver.launch
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<launch> | ||
<!-- start: arguments --> | ||
<arg name="json_path" default="/tmp/app_notification.json" /> | ||
<arg name="smach_status_topic" default="/server_name/smach/container_status" /> | ||
<!-- end: arguments --> | ||
|
||
<node name="smach_notification_saver" pkg="app_notification_saver" | ||
type="smach_notification_saver_node.py" > | ||
<remap from="~smach/container_status" to="$(arg smach_status_topic)" /> | ||
<rosparam subst_value="true"> | ||
json_path: $(arg json_path) | ||
</rosparam> | ||
</node> | ||
</launch> |
11 changes: 11 additions & 0 deletions
11
app_manager_utils/app_notification_saver/node_scripts/service_notification_saver_node.py
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python | ||
|
||
import rospy | ||
|
||
from app_notification_saver import ServiceNotificationSaver | ||
|
||
|
||
if __name__ == '__main__': | ||
rospy.init_node('service_notification_saver_node') | ||
ServiceNotificationSaver() | ||
rospy.spin() |
10 changes: 10 additions & 0 deletions
10
app_manager_utils/app_notification_saver/node_scripts/smach_notification_saver_node.py
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
|
||
import rospy | ||
|
||
from app_notification_saver import SmachNotificationSaver | ||
|
||
if __name__ == '__main__': | ||
rospy.init_node('smach_notification_saver_node') | ||
SmachNotificationSaver() | ||
rospy.spin() |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<package format="3"> | ||
<name>app_notification_saver</name> | ||
<version>2.2.12</version> | ||
<description>The app_notification_saver package</description> | ||
|
||
<maintainer email="[email protected]">Shingo Kitagawa</maintainer> | ||
<author email="[email protected]">Naoya Yamaguchi</author> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<buildtool_depend condition="$ROS_PYTHON_VERSION == 2">python-setuptools</buildtool_depend> | ||
<buildtool_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_depend> | ||
|
||
<build_depend>message_generation</build_depend> | ||
<exec_depend>app_manager</exec_depend> | ||
<exec_depend>message_runtime</exec_depend> | ||
<exec_depend>rospy</exec_depend> | ||
<exec_depend>smach_msgs</exec_depend> | ||
|
||
<export> | ||
<app_manager plugin="${prefix}/app_notification_saver_plugin.yaml" /> | ||
</export> | ||
</package> |
9 changes: 9 additions & 0 deletions
9
app_manager_utils/app_notification_saver/sample/sample_smach_notification_saver.launch
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<launch> | ||
<node name="rosbag_play" pkg="rosbag" type="play" | ||
args="$(find app_notification_saver)/data/smach.bag --clock" | ||
output="screen" required="true" /> | ||
|
||
<include file="$(find app_notification_saver)/launch/smach_notification_saver.launch" > | ||
<arg name="smach_status_topic" value="/server_name/smach/container_status" /> | ||
</include> | ||
</launch> |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from catkin_pkg.python_setup import generate_distutils_setup | ||
from setuptools import find_packages | ||
from setuptools import setup | ||
|
||
|
||
d = generate_distutils_setup( | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
) | ||
|
||
setup(**d) |
3 changes: 3 additions & 0 deletions
3
app_manager_utils/app_notification_saver/src/app_notification_saver/__init__.py
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from app_notification_saver.app_notification_saver_base import AppNotificationSaver # NOQA | ||
from app_notification_saver.service_notification_saver import ServiceNotificationSaver # NOQA | ||
from app_notification_saver.smach_notification_saver import SmachNotificationSaver # NOQA |
Oops, something went wrong.