Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop/fetch] [jsk_robot_startup] Record image topic to mongodb every time #1883

Merged
6 changes: 6 additions & 0 deletions jsk_fetch_robot/jsk_fetch_startup/launch/fetch_lifelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@
- sound_play/SoundRequestActionGoal
- sound_play/SoundRequestActionResult
</rosparam>

<include file="$(find jsk_robot_startup)/launch/lifelog.launch" >
<arg name="image" value="/head_camera/rgb/image_rect_color" />
<arg name="manager" value="mongodb_lifelog_nodelet_manager" />
</include>

</launch>
56 changes: 56 additions & 0 deletions jsk_robot_common/jsk_robot_startup/launch/interaction.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<launch>
<!-- strelka -->
<arg name="google_chat_credentials_json" default="$(find jsk_robot_startup)/auth/tribal-quasar-343006-1025e6fc703f.json" />
<arg name="project_id" default="tribal-quasar-343006" />

<!-- common settings -->
<arg name="openai_credentials_json" default="$(find jsk_robot_startup)/auth/openai_credentials.json" />

<arg name="google_credentials_json" default="$(find jsk_robot_startup)/auth/eternal-byte-236613-4bc6962824d1.json" />

<arg name="chat_use_helper" default="true" doc="set false when your program respond to chat" />

<arg name="launch_google_chat" default="true" />
<arg name="launch_gdrive_server" default="true" />

<!-- Google Chat ROS -->
<include file="$(find google_chat_ros)/launch/google_chat.launch" if="$(arg launch_google_chat)">
<arg name="receiving_mode" value="pubsub" />
<arg name="project_id" value="$(arg project_id)" />
<!-- <arg name="override_project_id" value="true" /> -->
<arg name="subscription_id" value="chat-sub" />
<arg name="respawn" value="true" />
<arg name="google_cloud_credentials_json" value="$(arg google_chat_credentials_json)"/>
<arg name="to_dialogflow_client" value="false" />
<arg name="use_helper" value="$(arg chat_use_helper)" />
</include>

<!-- Dialogflow Client ROS -->
<include file="$(find dialogflow_task_executive)/launch/dialogflow_ros.launch">
<arg name="override_project_id" value="true" />
<arg name="credential" value="$(arg google_credentials_json)" />
<arg name="project_id" value="collaborative-remembering-kwit" />
<arg name="enable_hotword" value="false" />
</include>

<!-- Google Cloud Language -->
<include file="$(find ros_google_cloud_language)/launch/analyze_text.launch">
<arg name="google_cloud_credentials_json" value="$(arg google_credentials_json)" />
</include>

<!-- gdrive_ros -->
<include file="$(find gdrive_ros)/launch/gdrive_server.launch" if="$(arg launch_gdrive_server)">
<arg name="settings_yaml" value="$(find jsk_robot_startup)/auth/pydrive_settings.yaml" />
<arg name="respawn" value="true" />
<arg name="node_name" value="gdrive_ros" />
</include>

<!-- openai_ros -->
<group ns="openai">
<node pkg="openai_ros" type="openai_node.py" name="openai" output="screen">
<rosparam command="load" file="$(arg openai_credentials_json)" />
</node>
</group>


</launch>
147 changes: 147 additions & 0 deletions jsk_robot_common/jsk_robot_startup/launch/lifelog.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<launch>
<arg name="use_mail" default="false" />
<arg name="min_percent" default="5" doc="parameter for video_to_scene"/>
<arg name="max_percent" default="15" doc="parameter for video_to_scene"/>

<arg name="logger_save_rgb" default="false" />
<arg name="logger_save_depth" default="false" />
<arg name="logger_save_tf" default="false" />
<arg name="logger_save_joint_states" default="false" />
<arg name="logger_save_base_trajectory" default="false" />
<arg name="logger_save_object_detection" default="false" />
<arg name="logger_save_action" default="false" />
<arg name="logger_save_smach" default="false" />
<arg name="logger_save_faces" default="false" />
<arg name="logger_save_dialogflow" default="false" />
<arg name="logger_save_app" default="false" />
<arg name="logger_map_frame" default="odom" />
<arg name="logger_save_speech" default="false" />
<arg name="logger_save_google_chat" default="false" />

<arg name="image" default="usb_cam/image_raw" />

<arg name="launch_mongodb" default="false" />
<arg name="launch_common_logger" default="false" />

<arg name="manager" default="mongodb_record_nodelet_manager" />

<param name="robot/database" value="jsk_robot_lifelog"/>


<!-- logging database -->
<param name="mongodb_replicate_on_write" value="true" /> <!-- need to set True to query from extra serveres, otherwise it only query from local server -->
<include file="$(find jsk_robot_startup)/lifelog/mongodb.launch" if="$(arg launch_mongodb)">
<arg name="use_daemon" value="true"/>
<arg name="port" value="27017" />
<arg name="repl_set_mode" value="false" />
<arg name="replicate" default="true" />
</include>

<group if="$(arg use_mail)" >
<node pkg="jsk_robot_startup" type="email_topic.py" name="email_topic" output="screen" />

<node name="smach_to_mail" pkg="jsk_robot_startup" type="smach_to_mail.py" output="screen">
<remap from="~smach/container_status" to="/server_name/smach/container_status" />
<param name="sender_address" command='python -c "import rospy;print(rospy.get_param(\"robot/name\")+\"@jsk.imi.i.u-tokyo.ac.jp\")"' />
<param name="receiver_address" command='python -c "import rospy;print(rospy.get_param(\"robot/type\")+\"@jsk.imi.i.u-tokyo.ac.jp\")"' />
</node>
</group>

<include file="$(find jsk_robot_startup)/lifelog/common_logger.launch" if="$(arg launch_common_logger)">
<arg name="save_rgb" value="$(arg logger_save_rgb)" />
<arg name="save_depth" value="$(arg logger_save_depth)" />
<arg name="save_tf" value="$(arg logger_save_tf)" />
<arg name="save_joint_states" value="$(arg logger_save_joint_states)" />
<arg name="save_base_trajectory" value="$(arg logger_save_base_trajectory)" />
<arg name="save_object_detection" value="$(arg logger_save_object_detection)" />
<arg name="save_action" value="$(arg logger_save_action)" />
<arg name="save_smach" value="$(arg logger_save_smach)" />
<arg name="save_faces" value="$(arg logger_save_faces)" />
<arg name="save_dialogflow" value="$(arg logger_save_dialogflow)" />
<arg name="save_app" value="$(arg logger_save_app)" />
<arg name="save_speech" value="$(arg logger_save_speech)" />
<arg name="save_google_chat" value="$(arg logger_save_google_chat)" />

<arg name="enable_monitor" value="false" />
<arg name="log_rate" value="1.0" />
<arg name="launch_manager" value="true" />
<arg name="manager" value="$(arg manager)" />
<arg name="map_frame_id" value="$(arg logger_map_frame)" />
<arg name="approximate_sync" value="true"/>
</include>

<!-- outputs $(arg image)/output/compressed when new scene found -->
<include file="$(find jsk_perception)/launch/video_to_scene.launch" >
<arg name="INPUT_IMAGE" value="$(arg image)" />
<arg name="IMAGE_TRANSPORT" default="compressed" />
<arg name="launch_manager" value="true" />
<arg name="manager" value="vidoe_to_scene_nodelet_manager" />
<arg name="min_percent" value="$(arg min_percent)" />
<arg name="max_percent" value="$(arg max_percent)" />
</include>

<!-- publish /publish_trigger_mongodb_event when video_to_scene, */class or dialogflow are detected -->
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_video_to_scene"
args="--wait-for-start $(arg image)/output/compressed /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header[&quot;callerid&quot;])' --import std_msgs" />

<!-- <node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_aws_auto_checkin" -->
<!-- args="-\-wait-for-start /aws_auto_checkin_app/output/class /publish_trigger_mongodb_event std_msgs/Header -->
<!-- 'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header[&quot;callerid&quot;])' -\-import std_msgs" /> -->
<!-- <node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_aws_detect_faces" -->
<!-- args="-\-wait-for-start /aws_detect_faces/attributes /publish_trigger_mongodb_event std_msgs/Header -->
<!-- 'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header[&quot;callerid&quot;])' -\-import std_msgs" /> -->
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_dialogflow_client"
args="--wait-for-start /dialogflow_client/text_action/result /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header[&quot;callerid&quot;])' --import std_msgs" />
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_google_chat_ros_send_goal"
args="--wait-for-start /google_chat_ros/send/goal /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header[&quot;callerid&quot;])' --import std_msgs" />
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_google_chat_ros_message_activity"
args="--wait-for-start /google_chat_ros/message_activity /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=rospy.Time.now(), frame_id=m._connection_header[&quot;callerid&quot;])' --import std_msgs rospy" />

<!-- republish compressed/throttled image data only when /publish_trigger_mongodb_event is published -->
<node name="camera_throttle_nodelet"
pkg="nodelet" type="nodelet"
args="load jsk_topic_tools/SynchronizedThrottle $(arg manager)" >
<rosparam subst_value="true">
approximate_sync: true
topics:
- /publish_trigger_mongodb_event
- $(arg image)/compressed
</rosparam>
</node>

<!-- store thottled image -->
<group ns="lifelog">
<include file="$(find jsk_robot_startup)/lifelog/lifelog_rgb_image.launch" >
<arg name="node_name" value="hand_color_logger" />
<arg name="image" value="$(arg image)/compressed/throttled" />
<arg name="manager" value="$(arg manager)" />
</include>
</group>

<!-- save classification data -->
<!-- sample code for object detection
<node name="classification_logger"
pkg="jsk_robot_startup" type="mongo_record.py" >
<rosparam subst_value="true">
topics:
- /spot/ncb_provider/hand_color_image/class
</rosparam>
</node>
-->

<!-- save bbox data -->
<!-- sample code for object detection
<node name="bbox_logger"
pkg="jsk_robot_startup" type="mongo_record.py" >
<rosparam subst_value="true">
topics:
- /spot/ncb_provider/bbox_array
</rosparam>
</node>
-->

</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<launch>
<!-- <include file="$(find jsk_robot_startup)/launch/lifelog.launch" > -->
<!-- <arg name="logger_save_action" value="true" /> -->
<!-- <arg name="logger_save_smach" value="true" /> -->
<!-- <!-\- <arg name="logger_save_faces" value="true" /> -\-> -->
<!-- <arg name="logger_save_dialogflow" value="true" /> -->
<!-- <arg name="image" value="/head_camera/rgb/image_rect_color" /> -->
<!-- <arg name="launch_mongodb" value="false" /> -->
<!-- </include> -->
<include file="$(find jsk_robot_startup)/launch/interaction.launch" ns="db_talker" >
<arg name="chat_use_helper" value="false" />
<arg name="launch_google_chat" value="false" />
<arg name="launch_gdrive_server" value="false" />
</include>
<include file="$(find jsk_perception)/launch/vqa.launch" >
<arg name="host" value="133.11.216.160" />
<arg name="port" value="8888" />
<arg name="run_api" value="false" />
</include>
<include file="$(find jsk_perception)/launch/classification.launch" >
<arg name="host" value="133.11.216.160" />
<arg name="port" value="9999" />
<arg name="run_api" value="false" />
</include>

</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<launch>
<arg name="launch_manager" default="true" />
<arg if="$(arg launch_manager)" name="manager" default="mongodb_record_nodelet_manager" />
<arg unless="$(arg launch_manager)" name="manager" />
<arg name="respawn" default="false" />
<arg name="image" default="image" />
<arg name="node_name" default="rgb_image_logger" />

<node name="$(arg node_name)"
pkg="nodelet" type="nodelet"
args="load jsk_robot_lifelog/LightweightLogger /$(arg manager)"
respawn="$(arg respawn)">
<remap from="~input" to="$(arg image)" />
<rosparam subst_value="true">
enable_monitor: false
vital_check: false
</rosparam>
</node>
</launch>
Loading